From 8603cb256038c8f082a7de5a0e5ca7d3670b8c58 Mon Sep 17 00:00:00 2001 From: Kamil Krzywda Date: Wed, 23 Sep 2026 19:39:20 +0000 Subject: [PATCH] fix: bridge port is 4403, not 4003 (v0.1.1) meshtastic-serial-bridge listens on TCP 4403; update MESH_PORT default in mesh.service.ts, docker-compose.yml and docs. --- CHANGELOG.md | 4 ++++ ORCHESTRATOR.md | 2 +- README.md | 4 ++-- docker-compose.yml | 2 +- package.json | 2 +- src/mesh/mesh.service.ts | 2 +- 6 files changed, 10 insertions(+), 6 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 9cb8ccb..f78fa02 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,9 @@ # Changelog +## v0.1.1 — 2026-09-23 19:38 + +- Fixed the default bridge port to `4403`, the meshtastic-serial-bridge's actual TCP port (the old value pointed at a closed port). Updated the `MESH_PORT` default in code, the docker-compose environment, and docs. + ## v0.1.0 — 2026-09-23 18:54 - New `GET /api/channels` endpoint listing the device's Meshtastic channels as `{ index, name, uplinkEnabled, downlinkEnabled }`; psk/keys are redacted and never exposed over HTTP. Channels are collected from `FromRadio.channel` frames streamed during initial sync (before `config_complete_id`) and reset on every bridge reconnect so stale data is dropped after a disconnect. diff --git a/ORCHESTRATOR.md b/ORCHESTRATOR.md index 462fdcb..78a0014 100644 --- a/ORCHESTRATOR.md +++ b/ORCHESTRATOR.md @@ -49,7 +49,7 @@ Credentials are deliberately NOT stored in this file — see §1 for where they ## 7. App architecture quick map - `src/mesh/codec.ts` — framing (`extractFrames`, `frame`) + protobuf encode/decode (`decodeFromRadio`, `buildTextToRadio`); unit tests in codec.spec.ts. -- `src/mesh/mesh.service.ts` — TCP connection to the bridge (MESH_HOST/MESH_PORT env, defaults 192.168.1.4:4003), buffer + frame extraction on data, FromRadio dispatch (`myInfo` → myNodeNum, `channel` → upsert into channelMap keyed by index — reset on every reconnect, `configCompleteId` → ready log, `packet` → text-message logging), fixed-interval reconnect (MESH_RECONNECT_MS, default 5 s). +- `src/mesh/mesh.service.ts` — TCP connection to the bridge (MESH_HOST/MESH_PORT env, defaults 192.168.1.4:4403), buffer + frame extraction on data, FromRadio dispatch (`myInfo` → myNodeNum, `channel` → upsert into channelMap keyed by index — reset on every reconnect, `configCompleteId` → ready log, `packet` → text-message logging), fixed-interval reconnect (MESH_RECONNECT_MS, default 5 s). - `src/mesh/mesh.controller.ts` — `GET /status`, `POST /send`, `GET /channels` (all under the `/api` global prefix set in main.ts; Scalar docs at `/`, OpenAPI JSON at `/docs-json`). ## 8. Finding current state (this file keeps no snapshots) diff --git a/README.md b/README.md index 3b9b1d5..063b292 100644 --- a/README.md +++ b/README.md @@ -1,7 +1,7 @@ # 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 +Meshtastic serial bridge (raw socat pipe) at `192.168.1.4:4403`, parses inbound protobuf frames, logs received text messages, and exposes HTTP endpoints to send text. ## Local run @@ -42,7 +42,7 @@ curl http://localhost:3000/api/channels ## Env vars - `MESH_HOST` (default `192.168.1.4`) — bridge host -- `MESH_PORT` (default `4003`) — bridge port +- `MESH_PORT` (default `4403`) — bridge port - `MESH_RECONNECT_MS` (default `5000`) — reconnect interval in ms - `PORT` (default `3000`) — HTTP listen port diff --git a/docker-compose.yml b/docker-compose.yml index 63fa52d..cf5f1b3 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -3,7 +3,7 @@ services: build: . environment: MESH_HOST: 192.168.1.4 - MESH_PORT: '4003' + MESH_PORT: '4403' restart: unless-stopped networks: - dev_net diff --git a/package.json b/package.json index 8425d08..797d003 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "mesh-bot", - "version": "0.1.0", + "version": "0.1.1", "description": "", "author": "", "private": true, diff --git a/src/mesh/mesh.service.ts b/src/mesh/mesh.service.ts index 613e5ae..3641fe8 100644 --- a/src/mesh/mesh.service.ts +++ b/src/mesh/mesh.service.ts @@ -17,7 +17,7 @@ import { export class MeshService implements OnModuleInit, OnModuleDestroy { private readonly logger = new Logger(MeshService.name); private readonly host = process.env.MESH_HOST ?? '192.168.1.4'; - private readonly port = parseInt(process.env.MESH_PORT ?? '4003', 10); + private readonly port = parseInt(process.env.MESH_PORT ?? '4403', 10); // ponytail: fixed-interval retry, no backoff — fine for single-bridge use private readonly reconnectMs = parseInt( process.env.MESH_RECONNECT_MS ?? '5000', -- 2.54.0