meshtastic / firmware

Meshtastic device firmware
https://meshtastic.org
GNU General Public License v3.0
2.99k stars 715 forks source link

[Bug]: PicoW Hardware Firmware Crash On Bad Packet #3959

Closed Vanguard4893 closed 3 weeks ago

Vanguard4893 commented 1 month ago

Category

Other

Hardware

Raspberry Pi Pico (W)

Firmware Version

2.3.9.f06c56a5

Description

Hi guys - I think I may have found something else awry with the Pico firmware, after several hours running, it looks like the node has received a malformed packet, which has caused a total crash of the firmware. Please see relevant log output below.

ERROR | 17:12:19 39729 [Router] Invalid protobufs in received mesh packet (bad psk?)!
WARN  | 17:12:19 39729 [Router] No suitable channel found for decoding, hash was 0x96!
DEBUG | 17:12:19 39729 [Router] packet decoding failed or skipped (no PSK?) (id=0x1d2cc19b fr=0xc4 to=0xff, WantAck=0, HopLim=0 Ch=0x96 encrypted rxtime=1716397939 rxSNR=-9.25 rxRSSI=-113 ho
rxtime=1716397939 rxSNR=-9.25 rxRSSI=-113 hopStart=3)
DEBUG | 17:12:19 39729 [Router] Delivering rx packet (id=0x1d2cc19b fr=0xc4 to=0xff, WantAck=0, HopLim=0 Ch=0x96 encrypted rxtime=1716397939 rxSNR=-9.25 rxRSSI=-113 hopStart=3)
DEBUG | 17:12:19 39729 [Router] Forwarding to phone (id=0x1d2cc19b fr=0xc4 to=0xff, WantAck=0, HopLim=0 Ch=0x96 encrypted rxtime=1716397939 rxSNR=-9.25 rxRSSI=-113 hopStart=3)
DEBUG | 17:12:19 39729 [Router] Using channel 4 (hash 0x96)
DEBUG | 17:12:19 39729 [Router] Using AES128 key!
DEBUG | 17:12:19 39729 [Router] Installing AES128 key!
ERROR | 17:12:19 39730 [Router] Invalid portnum (bad psk?)!
WARN  | 17:12:19 39730 [Router] No suitable channel found for decoding, hash was 0x96!
WARN  | 17:12:19 39730 [Router] ToPhone queue is full, dropping packet.
INFO  | 17:12:19 39730 [Router] Asked module 'routing' to send a response
DEBUG | 17:12:19 39730 [Router] No one responded, send a nak
ERROR | 17:12:19 39730 [Router] Alloc an err=8,to=0xe2e4f8c4,idFrom=0x1d2cc19b,id=0x1f7240e2
DEBUG | 17:12:19 39730 [Router] Add packet record (id=0x1f7240e2 fr=0x39 to=0xc4, WantAck=0, HopLim=4 Ch=0x96 Portnum=5 requestId=1d2cc19b rxtime=1716397939 priority=120)
ERROR | 17:12:19 39730 [Router] Invalid channel index 150 > 8, malformed packet received?

Relevant log output

See content
Vanguard4893 commented 1 month ago

I should add, that this problem is present both on custom SX1262-based hardware and with the Waveshare SX1262 module.

EDIT:

The last packet received when this failure occurs is the following:

  From: 530602636 / !1fa05a8c
  To: 3663102084 / !da568084
  SNR: -11.5
  RSSI: -115
  Port Number: NODEINFO_APP
  Node Information:
    ID: !1fa05a8c
    Long Name: M7OMW Owen
    Short Name: C3P0
    MAC Address: CLYfoFqM
    Hardware Model: TBEAM

{'from': 1978240620, 'to': 4294967295, 'decoded': {'portnum': 'POSITION_APP', 'payload': b'\r\x00\x80\xdd\x1f\x15\x00\x80\xd0\xfe\x18\x99\x01%\x83\\Pf\xb8\x01\x10', 'position': {'latitudeI': 534609920, 'longitudeI': -19890176, 'altitude': 153, 'time': 1716542595, 'precisionBits': 16, 'raw': latitude_i: 534609920
longitude_i: -19890176
altitude: 153
time: 1716542595
precision_bits: 16
, 'latitude': 53.460992, 'longitude': -1.9890176}}, 'id': 196031333, 'rxTime': 1716539418, 'rxSnr': -12.0, 'hopLimit': 2, 'rxRssi': -116, 'raw': from: 1978240620
to: 4294967295
decoded {
  portnum: POSITION_APP
  payload: "\r\000\200\335\037\025\000\200\320\376\030\231\001%\203\Pf\270\001\020"
}
id: 196031333
rx_time: 1716539418
rx_snr: -12
hop_limit: 2
rx_rssi: -116
, 'fromId': '!75e98e6c', 'toId': '^all'} 

Received packet:
  From: 1978240620 / !75e98e6c
  To: 4294967295 / !ffffffff
  Hop Limit: 2
  SNR: -12.0
  RSSI: -116
  Port Number: POSITION_APP
  Position:
    Latitude: 53.460992
    Longitude: -1.9890176
    Altitude: 153