Servers by jDrones

Help to edit mavlink config file

Hello Experts,

I’m trying to edit the mavlink-router config file’s so that it will auto connect to my Pixhawk FC when Rpi boots up. So I enter terminal command:

$ sudo nano /etc/mavlink-router/config.d

Then enter the ff:
[UartEndpoint to_fc]
Device = /dev/ttyAMA0
Baud = 921600

[UdpEndpoint to_14550_external]
Mode = eavesdropping
Address = 192.168.1.163
Port = 14550
PortLock = 0

Then Ctrl ‘X’, ‘O’ to save.

Then when i go back to check if the file is there ($ nano /etc/mavlink-router/config.d) - NOTHING!
It’s just blank. Can someone pls help. Thank you!

Edit

sudo nano /etc/mavlink-router/main.conf

ctrl x
y

Corrado

Thank you so much the reply.

I tried that one and was able to save the to the file using the command you stated.
But does’t seem to work when my Rpi boots up.
I still need to ssh my Rpi & type the command in udp format before i open the MP in order to see the mavlink signal.
The ipaddress i stated after the Mode is the ipaddress of my PC running MP.

did you enable the service?

sudo systemctl enable mavlink-router.service

this will make it run on startup

Once rasp has done the boot you can check service status with:

sudo systemctl status mavlink-router.service

image

I tried that command it did’nt work.

image

And this is the file main.conf that I created. The one that you suggest.

I compiled and installed from source, maybe i am remembering it wrong, i’ll take a look tomorrow and see but i am pretty sure mavlink-router.service was created when compiled and installed.
Did you compile and install it from source?

NO. I didn’t because I only follow whats in the ardupilot documentation to setup the mavlink in the companion computers.
Sorry I didn’t get what you mean when you say “compile and install it from source” because I am not that kind of developer skill. I assume you are.

Hi , Apsync start “cmavnode” as default mavlink comunication router.
The script rc.local woulb be contain the follow statements

The first line start the mavlink router

sudo -H -u apsync /bin/bash -c ‘~apsync/start_cmavnode/autostart_cmavnode.sh’

The second line start the logger

sudo -H -u apsync /bin/bash -c ‘~apsync/dflogger/autostart_dflogger.sh’

The third line start the web server

sudo -H -u apsync /bin/bash -c ‘~apsync/start_cherrypy/autostart_cherrypy.sh’

After the connection to Apsync , the server application will start the port to redirect the mavlink
comunication
1 Web server port 80
2 UDP port 14655 for ground controlo ( MP or QGC )

You can change the port/address configuration

$ nano /Apsync/start_cmavnode/cmavnode.conf

 #Serial connection to pixhawk
     [aseriallink]
     type=serial
     port=/dev/ttyS0
     baud=921600
     sim_enable=false
 
#Connection to ground control in udp 
[to_mavproxy]
type=udp
targetip=127.0.0.1
targetport=14655  
localport=14656
sim_enable=false

#connection to dflogger
[to_dflogger]
type=udp
targetip=127.0.0.1
targetport=14555
localport=14556
sim_enable=false

#connection to web server
[to_apweb]
type=udp
targetip=127.0.0.1
targetport=14755
localport=14756
sim_enable=false
timeout=9999999

You should not any changes to start, is ready to comunicate with a set of default ports
Don’t wrong the serial connection , and remember the set same baudrate (921600)

Does this mean apsync Rpi should be use rather than set it up manually?

cmavnode and mavlink-router are 2 different things, that do the same thing. What i like about mavlink-router is that is configured as a service in the last release and is very handy to stop and start it as needed.
But i think cmavnode is as good as mavlink-router, i just never used it.

Yes, i agree with you . I don’t know only if mavlink-router is installed by default

I want only say that probably mavlink-route is not installed. Check if cmavnode is launched in rc.local
In this case you can configure cmavnode.conf instead of /etc/mavlink-router/config.d
They do the same things

Can you try

sudo systemctl enable mavlink-router

sudo systemctl start mavlink-router

That’s the result.

Prob not installed. If you want to install it:

Servers by jDrones