Feature/serial connection - #180
Conversation
Add ability to connect to Meshtastic devices via serial/USB in addition to the existing Bluetooth and WiFi options. This is more reliable than BLE on devices like Raspberry Pi where SimpleBLE has known issues. Changes: - Add NodeSerialConnection class using the serialport npm package - Add serial port detection and listing API endpoint (/serialPorts) - Add Serial.svelte UI component showing available serial devices - Modify connect() to detect serial paths (/dev/ttyACM*, COM*, etc) - Serial devices appear as clickable buttons in the web UI The serial connection implements the Meshtastic protobuf-over-serial protocol (0x94 0xc3 framing) and supports auto-connect via the ADDRESS environment variable (e.g. ADDRESS=/dev/ttyACM0).
|
@Outrun207 I am not an official reviewer but in order to expedite merging this change, my suggestion would be to back out the README.md changes here that pertain to the proposed new Docker container, as that feels out of scope for "adding serial support" unless I am missing something. I would encourage creating a separate PR for the Docker container, one that includes the build spec for the container so it can be adopted into the project completely. |
|
Thank you @Outrun207 for the PR submission! I agree with @aaronsilber regarding the Docker container being a separate PR and integrated into the project. I will try to find time to fully review this as it is a big value-add. My concerns are mainly around how well the serialport dependency will package into the distributable for each respective platform. |
Am successfully running this off of my Raspberry Pi. Powering and connecting to the radio via USB.
Summary
Adds the ability to connect to Meshtastic radios via serial/USB, in addition to the existing Bluetooth and WiFi options.
Serial devices appear as clickable buttons in the web UI — no need to type a path manually.
Why
The Raspberry Pi's onboard Bluetooth adapter has known issues with the SimpleBLE library (frequent scan stop failed
crashes). Serial/USB is a more reliable alternative when the radio is physically connected.
Changes
protocol (0x94 0xc3 framing) using the serialport npm package
Usage
Connect a Meshtastic radio via USB. It will appear in the web UI under "Serial Devices". Click to connect. Or set
ADDRESS=/dev/ttyACM0 as an environment variable for auto-connect on startup.