Ardupilot / PX4
Last updated
Last updated
This page contains setup and usage details for using the cellular M.2 PCB with Ardupilot and PX4 based systems - specifically using the and .
These instructions are probably not the quickest/easiest way to get this all configured and working, but it at least works for me.
It is assumed that Initial testing with PC and Mounting has already been followed.
This guide uses a serial connection between the router and flight controller, but ethernet should also work.
Warning! Most serial/telemetry connectors and 5V outputs on standard Ardupilot/PX4 flight controllers cannot supply enough current for higher power devices like cellular modules. Use a dedicated 5V regulator or BEC.
PC
JC M.2 cellular adapter PCB
Compatible cellular module (EM7455)
Antennas - NGFF / MHF4 / IPEX if using EM7455, for 3G/4G frequencies
SIM card (3G/4G)
CBU UAV Router
Cube Orange+ (or other Ardupilot / PX4 flight controller)
USB to Ethernet adapter (if you are using a PC without an ethernet port)
5V regulator/BEC (do not power directly from standard FC 5V)
4-pin JST-GH to 4-pin JST-GH cable for USB connection
4-pin JST cable to 5V regulator for power
4-pin JST-GH cable for serial connection with FC (to 6-pin JST-GH for pixhawk style FCs like Cube Orange)
M3 bolts for M.2 cellular module, M.2 adapter PCB, and UAV Router
M3 spacers if stacking
Low-profile or button head for under M.2 cellular module.
Connect M.2 adapter PCB and CBU UAV Router using 4-pin JST-GH cable. Ideally avoid running alongside noisy signals (ESCs etc.).
Power CBU UAV Router using dedicated 5V regulator.
Connect CBU UAV Router to FC using serial connection.
Set up cellular module as per Initial testing with PC
Connect CBU UAV router LAN to PC ethernet (or ethernet to USB adapter)
Tailscale is used to create a secure point-to-point connection between the UAV Router and another device (i.e. ground station PC).
Add two devices (PCs you intend to connect to the UAV is a good place to start) and test the connection as shown on the setup page.
Go to the Admin Console, which will show all 'machines' that you have access to with your Tailscale account. From here you can also share devices with other accounts, and see devices shared with your account.
Configure the serial / telemetry port on your flight controller with MAVLink2 protocol, and a baud rate of 115200.
Open the customize installed packages dropdown and add the following to the installed packages box: kmod-usb-core kmod-usb2 tailscale ser2net nano iptables-nft kmod-ipt-conntrack kmod-ipt-conntrack-extra kmod-ipt-conntrack-label kmod-nft-nat kmod-ipt-nat kmod-usb-net-cdc-mbim umbim luci-proto-mbim kmod-usb-serial-option picocom
and the following to the script to run box:
Click request build
When build is successful, click SYSUPGRADE button to download the new image .bin file.
Connect 5V power to CBU UAV Router.
Once powered, connect to a PC using the ethernet adapter (use a ethernet-USB adapter if needed)
Once connected, open a web browser and go to 192.168.1.1
User login: root
, there is no password by default (no need to set one, we are about to flash new firmware)
Flash generated firmware
Go to system > backup / flash firmware > flash new firmware image
Select and upload previously generated firmware
Untick 'keep settings'
Press continue
Wait a few minutes
Unplug ethernet adapter and plug back in
Wait a few minutes
Go to 192.168.1.1
Log back in and set a password
edit the LAN interface to 192.168.2.1
click save
click save & apply
Appy with revert after connectivity loss
quickly go to 192.168.2.1 (you should see the web interface and be able to log in)
go to network > wireless
click scan
select relevant wifi network (if also using cellular module later, choosing hotspot makes testing this easier as it can be turned off)
tick replace wireless configuration
enter password
submit
click save
click save & apply
wait for configuration changes to load
Install PuTTY (or other SSH tool)
connect to 192.168.2.1
accept any security alert
login as 'root' with previously chosen password
Connect serial port of UAV Router (R1/T1) to serial port on flight controller (that has been configured to MAVLink2)
Try to connect to the FC in Mission Planner using TCP option with IP 1982.168.2.1 and remote port 5760 (using the same laptop connected via Ethernet or Wi-Fi)
Use PuTTY (or similar) to SSH back into the router at 192.168.2.1
try to start tailscale with tailscale up
if you get an error saying 'failed to connect to local tailscaled'
run opkg install iptables-nft kmod-ipt-conntrack kmod-ipt-conntrack-extra kmod-ipt-conntrack-label kmod-nft-nat kmod-ipt-nat
then service tailscale restart
then try tailscale up
again
It should give you a tailscale URL - copy this into your web browser and login
click connect
you should see 'success' in the router SSH terminal, and it should show up as connected (with a green dot) in the Tailscale machines list
Rename machine if desired
log back into the 192.168.2.1 OpenWrt web interface
go to network > interfaces > add new interface
name: tailscale
, protocol: Unmanaged
, device: tailscale0
click Create interface
click save.
go to network > firewall
add a new zone
name: tailscale
input: accept
output: accept
forward: accept
masquerading: tick
MSS clamping: tick
covered networks: tailscale
allow forward to destination zones: LAN
allow forward to destination zones: LAN
click save
click save & apply
wait for config to apply
run service tailscale restart
in SSH terminal, or reboot router.
Copy the 100.xxx.yyy.zzz IP address and try to connect to the FC in Mission Planner, again with TCP and port as 5760.
If successful, try using a different PC which is connected to the same Tailscale network, but not on the same physical / WiFi network.
Connect M.2 cellular module (already tested as per Initial testing with PC) to UAV router's USB connector
SSH into router using PuTTY (or similar) using either local IP 192.168.2.1, or tailscale IP.
run ls -l /dev/cdc*
to check if the cellular module is found (you should see something like /dev/cdc-wdm0
if not, first run opkg update
then opkg install kmod-usb-net-cdc-mbim umbim luci-proto-mbim kmod-usb-serial-option picocom
reboot router
wait a few minutes
reconnect via SSH
try again
log back into OpenWrt web interface
go to network > interfaces
add new interface
name: cellular
protocol MBIM Cellular
(reboot first if not available)
create interface
modem device: /dev/cdc-wdm0
input relevant APN. This will depend on the network SIM card you have installed. It will likely be in a format such as mob.asm.net (SMARTY), mobile.o2.co.uk (o2)
PDP Type: IPv4 only (usually)
go to firewall settings
choose WAN
click save
click save & apply
turn off hotspot or go out of wifi range (to force cellular connection)
try to connect to the FC in Mission Planner, using TCP with the tailscale IP for the router and port as 5760.
Connect camera ethernet port to UAV Router (custom JST-GH cable)
Connect camera to power source (11V-25.2V or 3S to 6S)
Change camera IP
In 'gimbal config' change:
IP Config to a suitable IP on the same subnet as the router, e.g. 192.168.2.100
Gateway IP to 192.168.2.1
Coding format to H264
Video Output Mode to Close
Click Save
Set Tailscale to advertise LAN
connect to router via SSH
run tailscale up --advertise-routes=192.168.2.0/24
(or tailscale up --advertise-routes=192.168.2.0/24 -ssh
if you had Tailscale SSH to machine enabled)
go to the Tailscale admin console and select the UAV router machine
approve the subnet
Change Tailscale firewall rule on UAV router
login to the openwrt web interface
go to network > firewall > traffic rules
add a new rule:
Name Allow Tailscale to LAN
Source Zone tailscale
Destination Zone lan
Action Accept
Click save
Click save and apply
start Mission Planner
right click on the HUD and select Video > Set GStreamer Source
input the GStreamer pipeline: rtspsrc location=rtsp://192.168.2.100:8554/main.264 latency=0 ! queue ! application/x-rtp ! rtph264depay ! avdec_h264 ! videoconvert ! video/x-raw,format=BGRA ! appsink name=outsink
You should now see video!
If you do not already have a Tailscale account, go to and create an account (or login with a Google account).
See for more comprehensive, up to date information.
Go to , search for HILINK HLK-7628N. At the time of writing there are config issues with 24.x firmware, so select the latest 23.x from the dropdown.
follow the to connect to a WiFi network
follow from step 6:
These steps roughly follow
Steps loosly based on
Ethernet / IP cameras can also be connected to the router for relatively low-latency video over cellular. The below guidance is based on the , and assumes the same working setup as above.
Install SIYI Assistant app
Connect to video output