meshtastic / python

The Python CLI and API for talking to Meshtastic devices
https://meshtastic.org
Apache License 2.0
333 stars 149 forks source link

[FYI] /dev/ttyUSB0 vs /dev/ACM0 #599

Open brad28b opened 1 week ago

brad28b commented 1 week ago

This is mostly an FYI in case it helps others, including developers if this is some kind of bug.

I had one of my RAK4631 nodes connected to an old Raspberry Pi 2 running Debian. And the Meshtastic Python CLI was always really hit and miss. Sometimes it'd work, after a long while, other times, it wouldn't work at all (timeouts).

Today I moved my node and plugged it into a different Linux (Ubuntu) box (more modern Intel NUC), and the first difference I noticed was that the meshtastic python CLI never failed on any command, it connected to the radio instantly, and always succeeded without any delay.

The only difference I can see is that on the old Raspberry Pi the RAK4631 was detected as /dev/ttyUSB0, where as on the Intel NUC it's detected as /dev/ttyACM0

Not sure what the significance of that is. But it works reliably now.

joneyes commented 1 week ago

Oddly enough I have come across a similar problem today with Lilygo Tlora T3S3 and Heltec Wireless Stick Lite V3. The heltec flashes using CLI without fail on the Pi and is detected as tty/USB0 It also passes the test with esptool.py chip_id

The T3S3 on the other hand is detected as tty/ACM0 cannot be flashed via CLI unless the boot button is pressed, and that is the only way it will pass the esptool.py chip_id test too (though it doesn't recover from this either without a power cycle.) I also have a Tbeam Supreme, which is S3 core, and this behaves the same as the T3S3.

Pressing the boot button is a bit of a pain, as the Pi and the T3S3 are in a weatherproof box outside - this is the reason i got the WSL. Unfortunately, the WSL is not as good as the T3S3 and it often fails to receive ack's for Tx packets, I think it's a bit deaf or off frequency....

It doesn't seem to be possible to flash the Lilygo's using flasher.meshtastic page from Chromium on the Pi - i don't think it gets on with the change of state of the port. Now I can bring the T3S3 inside onto the Windows PC and it will happily flash using flasher.meshtastic using the 1200bd reset first - this changes the USB port address. The behaviour is the same on a windows machine with CLI on the Lilygo S3 units - the boot button has to be pressed to get them into flash mode. There's obviously a way around it if the web flasher can do it?