firmware icon indicating copy to clipboard operation
firmware copied to clipboard

[Bug]: Crashes with PineDIO LoRa USB

Open Pigpog opened this issue 1 year ago • 1 comments

Category

Hardware Compatibility, Other

Hardware

Linux Native

Firmware Version

d73cbf14d5b0cf8a3f94d8028b9ab60d297fed96 (master) and older

Description

When I use Meshtastic on Linux Native with the PineDIO LoRa USB, it crashes with the following error some time after initializing:

ERROR | 20:12:12 30 [RadioIf] Radiolib error -20 when attempting SX126X scanChannel!
program: src/mesh/SX126xInterface.cpp:311: bool SX126xInterface<T>::isChannelActive() [with T = SX1262]: Assertion `result != RADIOLIB_ERR_WRONG_MODEM' failed.

Sometimes I get this error instead:

DEBUG | 20:35:16 94 [RadioIf] Starting low level send (id=0x0ed98382 fr=0x8b to=0xff, WantAck=0, HopLim=3 Ch=0x8 encrypted rxtime=1727642100 hopStart=3 priority=100)
ERROR | 20:35:16 94 [RadioIf] startTransmit failed, error=-705
ERROR | 20:35:16 94 [RadioIf] NOTE! Recording critical error 11 at src/mesh/RadioLibInterface.cpp:481
free(): double free detected in tcache 2

Sometimes it crashes immediately, and in other cases I've let it run without interacting for hours before encountering the crash.

Steps to reproduce:

  • Clone Meshtastic firmware
  • Build for native with PlatformIO
  • Configure for sx1262 and gpio in config.yaml
  • Load spi-ch341-usb kernel module and connect PineDIO LoRa USB
  • echo spidev | sudo tee /sys/bus/spi/devices/spi0.0/driver_override; echo spi0.0 | sudo tee /sys/bus/spi/drivers/spidev/bind (set spi device driver)
  • Run Meshtastic

I have tried many times to correct this issue by checking my GPIO configuration and altering parts of the code.

OS: Arch Linux CPU: Intel i7-2600 Kernel: Custom build (config changes), based on 6.10.7

The only other Meshtastic device within range is my T-Beam in the same room running Meshtastic.

If any more details are desired I will be more than happy to oblige.

Relevant log output

INFO  | 20:12:12 30 [NodeInfoModule] Sending our nodeinfo to mesh (wantReplies=1)
INFO  | 20:12:12 30 [NodeInfoModule] sending owner !3cca498b/PineDio LoRa USB/DIO
DEBUG | 20:12:12 30 [NodeInfoModule] Initial packet id 2027501777
DEBUG | 20:12:12 30 [NodeInfoModule] Partially randomized packet id 2673798354
DEBUG | 20:12:12 30 [NodeInfoModule] Update DB node 0x3cca498b, rx_time=1727640732
DEBUG | 20:12:12 30 [NodeInfoModule] handleReceived(LOCAL) (id=0x9f5eecd2 fr=0x8b to=0xff, WantAck=0, HopLim=3 Ch=0x0 Portnum=4 WANTRESP rxtime=1727640732 priority=10)
DEBUG | 20:12:12 30 [NodeInfoModule] No modules interested in portnum=4, src=LOCAL
DEBUG | 20:12:12 30 [NodeInfoModule] Add packet record (id=0x9f5eecd2 fr=0x8b to=0xff, WantAck=0, HopLim=3 Ch=0x0 Portnum=4 WANTRESP rxtime=1727640732 priority=10)
DEBUG | 20:12:12 30 [NodeInfoModule] Expanding short PSK #1
DEBUG | 20:12:12 30 [NodeInfoModule] Using AES128 key!
DEBUG | 20:12:12 30 [NodeInfoModule] enqueuing for send (id=0x9f5eecd2 fr=0x8b to=0xff, WantAck=0, HopLim=3 Ch=0x8 encrypted rxtime=1727640732 hopStart=3 priority=10)
DEBUG | 20:12:12 30 [NodeInfoModule] txGood=0,rxGood=0,rxBad=0
INFO  | 20:12:12 30 Telling client we have new packets 2
ERROR | 20:12:12 30 [RadioIf] Radiolib error -20 when attempting SX126X scanChannel!
program: src/mesh/SX126xInterface.cpp:311: bool SX126xInterface<T>::isChannelActive() [with T = SX1262]: Assertion `result != RADIOLIB_ERR_WRONG_MODEM' failed.
Aborted

Pigpog avatar Sep 29 '24 20:09 Pigpog

At least one of the problems is that the Busy line isn't actually connected. A developer is working on a replacement user-mode driver that's showing a lot of promise.

jp-bennett avatar Oct 16 '24 06:10 jp-bennett

I have been directed to the CH341 branch, which is an exciting development. I think I'll close this issue, since bugs with the ch341 branch are off-topic here. Thanks!

Pigpog avatar Nov 09 '24 23:11 Pigpog