mavlink / qgroundcontrol

Cross-platform ground control station for drones (Android, iOS, Mac OS, Linux, Windows)
http://qgroundcontrol.io
3.26k stars 3.59k forks source link

QGC appears to open/take control of USB Serial interfaces it isn't configured to use #10206

Open spiderkeys opened 2 years ago

spiderkeys commented 2 years ago

Expected Behavior

If there is not a CommLink automatically configured to use a serial device, nor a box selected under General settings to automatically connect via Pixhawk, then that serial device should never be opened by QGC.

Current Behavior

Steps to Reproduce:

Steps are provided above, but the strangest thing is that the behavior appears to be random. Sometimes it happens, sometimes it doesn't.

Out of 10 tries, 7 didn't cause the issue and 3 did.

System Information

When posting bug reports, include the following information

MaEtUgR commented 2 years ago

You might have already done this but for reference. If you don't turn of these auto connection options QGC will capture serial connections. image

And you said there is a manual connecting Serial connection in use and you did disable the auto connection on that one. image But it might be the source of the issue. I would try removing it, restarting QGC and see if it persists. Just to see if there's a bug in that part.

spiderkeys commented 2 years ago

Thanks, the autoconnection box is unchecked for the one serial comm link I have defined (ttyACM0). I have a separate serial adapter (ttyUSB0) which is connected to the console uart pins on my FMU, which is the interface seeing the issue. There is no comm link entry in QGC for ttyUSB0, in this case.

Similarly, all of the auto connection boxes in the QGC general settings are also disabled (pixhawk, SiK, px4flow, etc):

Edit: I will give a try completely removing the manual serial link for ttyACM0 though, just in case that has an effect on the behavior.

zdanek commented 2 years ago

If you confirm this as a bug and you will describe steps to reproduce and then expected behavior I can fix this as I'm currently making some of my tweaks around serial comm and know this piece of QGC code.

spiderkeys commented 2 years ago

I can confirm now that it happens whether there are manually created Comm Links or not.

Settings: Screenshot from 2022-03-17 11-33-38

Comm Links: Screenshot from 2022-03-17 11-33-30

Picocom + nsh:

spiderkeys commented 2 years ago

The FMU physical setup, for context: Screenshot from 2022-03-17 11-45-25

mrpollo commented 2 years ago

I have no experience with devices, have you seen anything like this before @DonLakeFlyer?

DonLakeFlyer commented 2 years ago

Shouldn't happen if autoconnect is turned off. Keeping in mind that you need to reboot QGC after you turn autoconnect off for it to take affect.

spiderkeys commented 2 years ago

Can confirm that autoconnect is disabled across multiple QGC restarts, w.r.t. this issue.

DonLakeFlyer commented 2 years ago

Someone will need to debug through this to figure out what is going on. Maybe RTK code trying to connect?

spiderkeys commented 2 years ago

My guesses are similar to yours - either some individual device driver/module is trying to access FTDI devices, or the Firmware Setup subsystem is taking control of it. I've noticed that Firmware Setup also disregards the fact that no manual or autoconnect links are specified.

DonLakeFlyer commented 2 years ago

I forgot there was a setting to turn off RTK autoconnect. Only other thing I can think of is Qt NMEA code trying to connect to an external source.

henrykotze commented 2 years ago

This is perhaps not related, but I have seen similar behavior when I connect FMUv5 using USB and NXP UCAN32K via serial2USB. There were some weird behavior on the NSH console of the NXP board. I will need to test again to make double sure.

zdanek commented 2 years ago

I'm doing some RTK related changes (actually making RTK run with Android device :D) I think I can dig into it.