Closed AlexisTM closed 3 years ago
Nothing immediately comes to mind here, but I'd suggest you try to instrument the mavlink module and debug through the serial console (or debugger) to see the USB mavlink instance is doing.
To Reproduce Steps to reproduce the behavior:
- Power the Pixhawk with the USB
- Wait for the LED to be blue breathing
- Wait an additional 10 seconds
- Try to connect Mavros, QGc or
cat /dev/ttyACM0
- When connecting, few messages are received
- The connection hangs: No message can be sent or received
In step 5 do you happen to know specifically which messages are getting through?
The messages are the typical messages the Pixhawk was supposed to send such as IMU data, position data, ...
Note that I do not have a serial cable as of now and cannot debug further. :disappointed:
Could it be caused by the age of the Pixhawk? It is an old 3DR Pixhawk.
Could it be caused by the age of the Pixhawk? It is an old 3DR Pixhawk.
Unlikely unless the physical connection is questionable.
Using the same cables with other USB-CDC devices, I do not have the issue. (tested with 3 other devices using CDC)
Possible solution - https://github.com/PX4/PX4-Autopilot/pull/16180.
@dagar I will test this! Thanks!
[Closing this in the meantime]
Describe the bug
If we do not connect the USB to a consumer right after the bootloader, once the RGB LED starts breathing blue (in a window of few seconds), the Pixhawk is inaccessible, no message can be received or sent anymore, but the TTY ACM driver is still up and running, thinking it can communicate.
I could replicate the exact same behavior going one level down, using
libusb1.0
instead of using the kernelusb-cdc-acm
driver but the exact same behavior happened. This seems to indicate that the last burst would come from the Pixhawk's buffer and not the tty driver buffer. As the log shows below, if nobody subscribes to the data in/dev/ttyACM0
, the USB connection is not initialized.To Reproduce Steps to reproduce the behavior:
cat /dev/ttyACM0
Steps to reproduce the behavior after successful connection:
cat /dev/ttyACM0
Expected behavior
Steps to reproduce the behavior after successful connection:
cat /dev/ttyACM0
Log Files and Screenshots
sudo apt install vusb-analyzer usbmon
Following a USB log file showing the problem. The Pixhawk in this log is DEV 1018. To view it, download it, rename it to remove the
.txt
and open it with vusb-analyzer:usbmon.mon.txt
History of the log:
0.00s
: Start the log6.00s
: Connect Pixhawk12.50s
: Pixhawk left the Bootloader (CDC driver advertised)13.50s
: Mavlink node started on/dev/ttyACM0
(showing normal behavior)21.25s
: Mavlink node manually stopped37.70s
: Mavlink node started on/dev/ttyACM0
(showing a stuck behavior)Normal start:
Failing start:
Example log https://review.px4.io/plot_app?log=85f3ab21-074b-4a19-9baa-820d606824c2
To reproduce the log:
Drone: