I found my blog’s most common question is “Why does the QGroundControl not connect to the Raspberry PI?” I faced many times the QGroundControl not connected suddenly, I will trace the issue follow the steps below:
1. Issues of Network :
– Did the QGroundControl PC and the Raspberry PI joined to the ZeroTier network?
2. Issues of QGroundControl settings:
– Check the QGroundControl Comm Links setting
– Check the vehicle paramenter SER_TEL1_BAUND
3. Issues of mavlink-router:
– Did the mavlink-router
started?
– Check the mavlink-router
config
4. Issues of Raspberry Pi:
– Check the serial port settings
– Did the serial port receiving data?
1. Did the QGroundControl PC and the Raspberry PI joined to the ZeroTier network?
Check your ZeroTier account, the QGroundControl PC and the Raspberry PI should be "ONLINE". (I use the zerotier to setup the private network. If you didn’t setup it, pleas read here first.)
If the drone is OFFLINE, you should check:
- Did your Raspberry PI setup/start correctly?
- Did your 4G/WiFi network setup/start correctly?
2. Check the QGroundControl CommL inks
Open the QGroundControl > Application Settings > Comm Links.
Did you setup the UDP Connection?
Did you click the Connect button?
2a. Check the vehicle paramenter SER_TEL1_BAUND
Open the QGroundControl > Vehicle Setup > Parameters.
Search SER_TEL1_BAUD
, the setting should be 38400 8N1
This setup assume you:
3 mavlink-router issues
3.1 Did the mavlink-router started?
Run the command below in the Raspberry PI:
systemctl status mavlink-router
If your mavlink-router is running correctly, you will see something like this:
If you found the mavlink-router inactive (dead)
:
You can try to start it manually and make it start when system boot:
sudo systemctl start mavlink-router
sudo systemctl enable mavlink-router
If there is error, you can check the error and try to fix it.
If there is no useful information, you can try:
sudo journalctl -u mavlink-router
It will echo the log of mavlink-router service. It provides more information to locate the issue.
If you even can’t find the mavlink-router, you can read here to install it.
Check the mavlink-router config
If the mavlink-router is working, you can check the config file.
cat /etc/mavlink-router/main.conf
Please check:
- The Banud is
38400
which matches the QGroundControl setting above; - The Device is
/dev/serial0
, some Raspberry PI will use/dev/ttyAMA0
. You can trial and error or read here for how difference versions of Raspberry Pi handle serial ports.
Issues of Rsapberry Pi
Check the serial port settings
Please check here to make sure you enabled the serial port.
Did the serial port receiving data?
Sometime, I want to know did I connect the correct serial port? Did the serial port receiving data? I will use a python module serial.tools.miniterm
to check it.
Install the pyserial
module
pip install pyserial
Run the command
python3 -m serial.tools.miniterm /dev/serial0 38400
If the serial port is receiving the data, you will see the screen print like this:
If there is no return, it means the serial port do not receiving data.
Issues of hardware
Check again the wiring is correct.
Wiring and connecting the Pixhawk to Raspberry Pi
Last Update: April 10, 2022.