Skip to content

[Bug]: Malformed packet issue with Node serial transport #808

Description

@bergie

Before submitting

  • I have searched existing issues to make sure this bug hasn't already been reported
  • I have updated to the latest version of the software to verify the issue still exists
  • I have cleared cache/cookies/storage or tried in a private/incognito window (if applicable)

Hardware

Heltec V3

Connection Type

Serial

Local or Hosted

http://meshtastic.local

Firmware Version

2.7.4

Operating System

Linux

Browser

Node.js

Expected Behavior

Serial connection stays up and we're able to send and receive packets.

Actual Behavior

Using the serial transport, I'm seeing this failure occur after a few hours (<6) of operation. After this the socket becomes closed.

Aug 21 19:44:21 lille-oe-pi signalk-server[56700]: Error sending packet 739111562 Error: illegal tag: field no 6 wire type 6
Aug 21 19:44:21 lille-oe-pi signalk-server[56700]:     at BinaryReader.tag (file:///home/pi/.signalk/node_modules/@meshtastic/core/dist/mod.mjs:1937:59)
Aug 21 19:44:21 lille-oe-pi signalk-server[56700]:     at readMessage (file:///home/pi/.signalk/node_modules/@meshtastic/core/dist/mod.mjs:5557:32)
Aug 21 19:44:21 lille-oe-pi signalk-server[56700]:     at readMessageField (file:///home/pi/.signalk/node_modules/@meshtastic/core/dist/mod.mjs:5674:2)
Aug 21 19:44:21 lille-oe-pi signalk-server[56700]:     at readField (file:///home/pi/.signalk/node_modules/@meshtastic/core/dist/mod.mjs:5604:23)
Aug 21 19:44:21 lille-oe-pi signalk-server[56700]:     at readMessage (file:///home/pi/.signalk/node_modules/@meshtastic/core/dist/mod.mjs:5569:3)
Aug 21 19:44:21 lille-oe-pi signalk-server[56700]:     at fromBinary (file:///home/pi/.signalk/node_modules/@meshtastic/core/dist/mod.mjs:5539:2)
Aug 21 19:44:21 lille-oe-pi signalk-server[56700]:     at Object.write (file:///home/pi/.signalk/node_modules/@meshtastic/core/dist/mod.mjs:12370:27)
Aug 21 19:44:21 lille-oe-pi signalk-server[56700]:     at invokePromiseCallback (node:internal/webstreams/util:172:10)
Aug 21 19:44:21 lille-oe-pi signalk-server[56700]:     at node:internal/webstreams/util:177:23
Aug 21 19:44:21 lille-oe-pi signalk-server[56700]:     at writableStreamDefaultControllerProcessWrite (node:internal/webstreams/writablestream:1129:5)
Aug 21 19:44:21 lille-oe-pi signalk-server[56700]:     at writableStreamDefaultControllerAdvanceQueueIfNeeded (node:internal/webstreams/writablestream:12>
Aug 21 19:44:21 lille-oe-pi signalk-server[56700]:     at writableStreamDefaultControllerWrite (node:internal/webstreams/writablestream:1118:3)
Aug 21 19:44:21 lille-oe-pi signalk-server[56700]:     at writableStreamDefaultWriterWrite (node:internal/webstreams/writablestream:1008:3)
Aug 21 19:44:21 lille-oe-pi signalk-server[56700]:     at [kChunk] (node:internal/webstreams/readablestream:1587:31)
Aug 21 19:44:21 lille-oe-pi signalk-server[56700]:     at readableStreamFulfillReadRequest (node:internal/webstreams/readablestream:2120:24)
Aug 21 19:44:21 lille-oe-pi signalk-server[56700]:     at readableStreamDefaultControllerEnqueue (node:internal/webstreams/readablestream:2312:5)
Aug 21 19:44:21 lille-oe-pi signalk-server[56700]:     at transformStreamDefaultControllerEnqueue (node:internal/webstreams/transformstream:508:5)
Aug 21 19:44:21 lille-oe-pi signalk-server[56700]:     at TransformStreamDefaultController.enqueue (node:internal/webstreams/transformstream:324:5)
Aug 21 19:44:21 lille-oe-pi signalk-server[56700]:     at Object.transform (file:///home/pi/.signalk/node_modules/@meshtastic/core/dist/mod.mjs:12251:18)
Aug 21 19:44:21 lille-oe-pi signalk-server[56700]:     at invokePromiseCallback (node:internal/webstreams/util:172:10)
Aug 21 19:44:21 lille-oe-pi signalk-server[56700]:     at Object.<anonymous> (node:internal/webstreams/util:177:23)
Aug 21 19:44:21 lille-oe-pi signalk-server[56700]:     at transformStreamDefaultControllerPerformTransform (node:internal/webstreams/transformstream:527

The backtrace points to this line in our codebase:

const decodedMessage = fromBinary(

Steps to Reproduce

Run signalk-meshtastic on Node.js 22+
Connect to a Heltec V3.2 node using USB serial connection
Wait for crash

Relevant console output

Screenshots

No response

Additional Context

This happened when testing if using serial would be a way to work around meshtastic/firmware#7706

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't workingstale

    Type

    No type

    Fields

    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions