1.2 KiB
1.2 KiB
mesh-bot
Minimal NestJS bot for Meshtastic. Long-running service that TCP-connects to a
Meshtastic serial bridge (raw socat pipe) at 192.168.1.4:4003, parses inbound
protobuf frames, logs received text messages, and exposes HTTP endpoints to send text.
Local run
npm i
npm run start:dev
Docker
docker compose up -d --build
Exposed via Traefik only (no published ports) at http://bot.dev.kkhost.pl.
Endpoints
GET /status—{ connected, myNodeNum, host, port }POST /send— body{ "text": "...", "to"?: <node number | "!b" | "broadcast"> }, returns{ id }
curl http://localhost:3000/status
curl -X POST http://localhost:3000/send -H 'content-type: application/json' -d '{"text":"hi"}'
curl -X POST http://localhost:3000/send -H 'content-type: application/json' -d '{"to":123456789,"text":"hello"}'
to omitted, "!b", or "broadcast" sends to the broadcast address 0xffffffff.
Env vars
MESH_HOST(default192.168.1.4) — bridge hostMESH_PORT(default4003) — bridge portPORT(default3000) — HTTP listen port
Note: the serial bridge accepts only ONE client at a time — if another app is connected to the radio, this bot will not get a connection.