Unable to connect Qgroundcontrol to PX4

I installed PX4 and Qgroundcontrol on my ubuntu 22.04. I use ROS2 humble

I can run a PX4 simulation (with make px4_sitl gazebo) and Qgroundcontrol but I’m unable to connect both together. Indeed I tried to create a new Comm link with these options:

Name: px4
Automatically Connect on Start
Type: TCP
Server Address: 127.0.0.1
Port: 4560

All tools are on my machine, it’s why I did put 127.0.0.1 (aka localhost)

And I use TCP cause apparently PX4 use this protocol, this is my logs when I run my PX4 simulation:

______  __   __    ___ 
| ___ \ \ \ / /   /   |
| |_/ /  \ V /   / /| |
|  __/   /   \  / /_| |
| |     / /^\ \ \___  |
\_|     \/   \/     |_/

px4 starting.

INFO  [px4] startup script: /bin/sh etc/init.d-posix/rcS 0
INFO  [init] found model autostart file as SYS_AUTOSTART=10015
INFO  [param] selected parameter default file parameters.bson
INFO  [param] selected parameter backup file parameters_backup.bson
  SYS_AUTOCONFIG: curr: 0 -> new: 1
  SYS_AUTOSTART: curr: 0 -> new: 10015
  CAL_ACC0_ID: curr: 0 -> new: 1310988
  CAL_GYRO0_ID: curr: 0 -> new: 1310988
  CAL_ACC1_ID: curr: 0 -> new: 1310996
  CAL_GYRO1_ID: curr: 0 -> new: 1310996
  CAL_ACC2_ID: curr: 0 -> new: 1311004
  CAL_GYRO2_ID: curr: 0 -> new: 1311004
  CAL_MAG0_ID: curr: 0 -> new: 197388
  CAL_MAG0_PRIO: curr: -1 -> new: 50
  CAL_MAG1_ID: curr: 0 -> new: 197644
  CAL_MAG1_PRIO: curr: -1 -> new: 50
  SENS_BOARD_X_OFF: curr: 0.0000 -> new: 0.0000
  SENS_DPRES_OFF: curr: 0.0000 -> new: 0.0010
INFO  [dataman] data manager file './dataman' size is 7868392 bytes
INFO  [init] PX4_SIM_HOSTNAME: localhost
INFO  [simulator_mavlink] Waiting for simulator to accept connection on TCP port 4560
Gazebo multi-robot simulator, version 11.10.2
Copyright (C) 2012 Open Source Robotics Foundation.
Released under the Apache 2 License.
http://gazebosim.org

[Msg] Waiting for master.
[Msg] Connected to gazebo master @ http://127.0.0.1:11345
[Msg] Publicized address: 132.207.153.244
[Msg] Warning: Ignoring XDG_SESSION_TYPE=wayland on Gnome. Use QT_QPA_PLATFORM=wayland to run on Wayland anyway.

So when I launch QgroundControl, I have this message: “Error on link px4. Error on socket: Connection refused”

And this is logs:

./QGroundControl.AppImage 
Warning: Ignoring XDG_SESSION_TYPE=wayland on Gnome. Use QT_QPA_PLATFORM=wayland to run on Wayland anyway.
Settings location "/home/user/.config/QGroundControl.org/QGroundControl.ini" Is writable?: true
Filter rules "*Log.debug=false\nGStreamerAPILog.debug=true\nqt.qml.connections=false"
System reported locale: QLocale(French, Latin, France) ; Name "fr_FR" ; Preffered (used in maps):  "fr-FR"
LocalizationLog: Qt lib localization for "fr_FR" is not present
"FactMetaData::createFromJsonObject _parseEnum for gridLines failed. Enum strings/values count mismatch - strings:values 1:2"
VideoReceiverLog: Stop called on empty URI
VideoReceiverLog: Stop called on empty URI
MAVLinkLogManagerLog: MAVLink logs directory: "/home/user/Documents/QGroundControl/Logs"
qt.network.ssl: QSslSocket: cannot resolve EVP_PKEY_base_id
qt.network.ssl: QSslSocket: cannot resolve SSL_get_peer_certificate
Ignoring ssl certificates due to OpenSSL version mismatch
Map Cache in: "/home/user/.cache/QGCMapCache300" / "qgcMapCache.db"
qt.network.ssl: QSslSocket: cannot call unresolved function SSL_get_peer_certificate
setCurrentPlanViewSeqNum
setCurrentPlanViewSeqNum
qt.network.ssl: QSslSocket: cannot call unresolved function EVP_PKEY_base_id
qt.positioning.geoclue2: Unable to start the client: "org.freedesktop.DBus.Error.AccessDenied" "Geolocation disabled for UID 1000"
QGCPositionManager error 0
"v4.3.0"

Apparently, there is no easy way to change the protocol/port used by PX4 so the only solution was to do the right Comm link in Qgroundcontrol but it doesn’t work for me. So I don’t have any idea, maybe an other person had this error and know the answer

I just found the answer, I did run the make command many times so if I well understood it did launch several px4 client and I noticed there was many UAVs in my simulation. So I think there was conflict between all instances.

To solve the problem I just kill all processes:

killall -9 gzserver gzclient px4

Then I did my make command in a terminal then launch QGC in an other one and it workd with the settings I show above)

I am receiving a similar error, except I am not using PX4, how do you know what processes to kill:

judahwo@Marcus-Laptop:~$ ./QGroundControl.AppImage
Settings location “/home/judahwo/.config/QGroundControl.org/QGroundControl.ini” Is writable?: true
Filter rules “*Log.debug=false\nGStreamerAPILog.debug=true\nqt.qml.connections=false”
System reported locale: QLocale(C, Default, Default) ; Name “C” ; Preffered (used in maps): “C”
LocalizationLog: Qt lib localization for “C” is not present
LocalizationLog: Error loading source localization for “C”
LocalizationLog: Error loading json localization for “C”
Error loading text-to-speech plug-in “speechd”
MAVLinkLogManagerLog: MAVLink logs directory: “/home/judahwo/Documents/QGroundControl/Logs”
qt.network.ssl: QSslSocket: cannot resolve EVP_PKEY_base_id
qt.network.ssl: QSslSocket: cannot resolve SSL_get_peer_certificate
Ignoring ssl certificates due to OpenSSL version mismatch
Map Cache in: “/home/judahwo/.cache/QGCMapCache300” / “qgcMapCache.db”
qt.network.ssl: QSslSocket: cannot call unresolved function SSL_get_peer_certificate
setCurrentPlanViewSeqNum
setCurrentPlanViewSeqNum
qt.network.ssl: QSslSocket: cannot call unresolved function EVP_PKEY_base_id
Adding target QHostAddress(“127.0.0.1”) 14550
“v4.3.0”

It’s saying I am getting an OpenSSL version mismatch and the same SSL_get_peer_certificate error