UDP not connecting over default port for PX4 using MAVROS

So I’m trying to get a offboard script to communicate via MAVROS using UDP. but when I run the roslaunch mavros px4.launch fcu_url:=udp://@ its not connecting when I check the diagnostics topic. TCP connects fine but I can’t seem to get a heartbeat over UDP.

The wifi chip is plugged Telem1 on a pixhawk 3 pro. and the laptop is connected to the wifi created by the drone. its a ESP8266MOD wifi module connected to the PC via p2p connection.

I’ve tried different versions of the same command as well:

udp://:14540@:14540
udp://0.0.0.0:14540@192.168.4.1:14540
udp://@:14540
udp://:14540@192.168.4.1
udp://:14540@:14550

Which one is that? And how is it connected to the computer?

wifi chip: ESP8266MOD
connected via p2p connection.

And that’s the issue isn’t it? I just checked the specs and it states it has TCP stack but not that it has a UDP stack. And now that I look at it the 6789 port is probably the only port open on it as that is the one engraved in the back.

Do you have docs of this module?

No I can’t seem to find any or anyone who knows where they might be. as for the module it self its only has near unreadable chines branding on it and the name,pw,ip and TCP port on the back.

however a nmap scan of the ports revealed that except for the 6789/tcp port a UDP port for dhcps is open on 67.

Mannaged to track it down:

https://www.banggood.com/Wireless-Wifi-to-Uart-Telemetry-Module-With-Antenna-for-Mini-APM-Flight-Controller-p-1065339.html?cur_warehouse=CN

It sounds like you should try to connect to port 6789 over TCP (and not UDP) then. Does that work?

Yes TCP works. I now have flashed one of the wifi chips with the software from the docs. Is there a way tot tell the FCU which of the ports to use via its parameters or something, because it now seems to listen to the TCP port? Even the auto discover from the QGC does not find it on the network over udp on the flashed chip. both moduls are running in AP mode.

So after asking on slack it seems the last issue was that the baud rate of the module did not match the that of the old module. after changing that in parameters everything started to work. I also moved the module to telem 2.

While I was on Linux this part of the issue helped me solve my problem.

So to sum it up:

  • I flashed the module with the firmware that was in the docs. hat was easy as with the way the module was made you only had the short gpo0 to ground and connect it via the pins that where already there.
  • Changed the parameters to the correct baud rate so that the chip and the firmware could communicate.
  • moved the module from telem1 to telem2 port.
  • Ran mavros px4.launch with ` roslaunch mavros px4.launch fcu_url:=udp://:14550@:14570 gcs_url:=udp://:14570@localhost:14551
  • told QGC to listen on port 14551 and to not auto connect on UDP.

Nice thx for the notes. Are the docs on px4.io correct and up to date? If not I’d appreciate pointers about what’s wrong or pull requests would be even better.