A small, simple web hook server in Go for sending downlinks via chirpstack4
- Go 79.9%
- HTML 20.1%
| cmd/webhook | ||
| downlink.go | ||
| go.mod | ||
| go.sum | ||
| LICENSE | ||
| README.md | ||
| README_loranam.html | ||
| README_loranam.md | ||
| webhook | ||
cs4apiproxy
HTTP webhook proxy for enqueuing ChirpStack LoRaWAN downlinks via gRPC.
Binaries
cmd/webhook
HTTP server that translates REST-style webhook calls into ChirpStack gRPC DeviceService.Enqueue requests. All downlink operations and errors are logged with the requesting client's IP address.
Endpoints:
| Method | Path | Behaviour |
|---|---|---|
| POST | /devices/{devEUI}/down/push |
Enqueue downlink(s) |
| POST | /devices/{devEUI}/down/replace |
Flush existing queue, then enqueue downlink(s) |
Request format:
{
"downlinks": [
{
"frm_payload": "vu8=",
"f_port": 15,
"confirmed": true
}
]
}
frm_payload— base64-encoded payload (decoded before forwarding to gRPC).f_port— LoRaWAN FPort (must be > 0).confirmed— whether the downlink is confirmed (optional, defaults tofalse).
Authentication:
The ChirpStack API token is passed in the Authorization: Bearer <token> (or X-API-Token) header. The server forwards the same token to the gRPC Enqueue call as bearer credentials.
Options:
| Flag | Env | Default |
|---|---|---|
-server |
CHIRPSTACK_SERVER |
192.168.2.23:8080 |
-http |
HTTP_ADDR |
:8080 |
Example:
go run ./cmd/webhook/ -server 192.168.2.23:8080 -http :8080
curl -X POST http://localhost:8080/devices/3333333333333333/down/push \
-H "Authorization: Bearer eyJ0eXAiOiJKV1Qi..." \
-H "Content-Type: application/json" \
-d '{"downlinks":[{"frm_payload":"vu8=","f_port":15}]}'
downlink.go
Standalone CLI tool that enqueues a single hardcoded downlink. Used as a reference / one-off test.
License
AGPL-3.0 — see LICENSE.