I explained not so clear. I could get all telemetry using mavlink and mavlink router (I have builded) if raspberry is connected to the network. But I am asking a little bit different for example my system
ground station (Missio planner + plugin C#) -> Telemetry(3dr) <-------> Telemetry(3dr) <- pixhawk <- raspberry pi <-camera
Now I want to send a message to raspberry from my plugin to change a camera mode and want to get from raspberry acknowledge. How to do it without raspberry connection to network ? only using UART between pixhawk and raspberry. On raspberry python script is used. Pixhawk is just a pass through system.
At google I can find only some tips and discussions
step by step
I have written 2 python scripts, one at rasp and on on PC. And at monitoring script I can’t see heartbeat of rasp in mavlink data flow
However, from rasp I can monitor pixhawk also as from pc, so I have a link.
PC script which monitors all messages
from pymavlink import mavutil
import time
# Start a connection listening to a UDP port
the_connection = mavutil.mavlink_connection('COM8', baud=921600)
# Wait for the first heartbeat
# This sets the system and component ID of remote system for the link
the_connection.wait_heartbeat()
while True:
try:
print(the_connection.recv_match().to_dict())
except:
pass
time.sleep(0.1)
rasp script sends ~1Hz heartbeat to inform about component
from pymavlink import mavutil
import time
# Start a connection listening to a UDP port
the_connection = mavutil.mavlink_connection('/dev/ttyAMA0', baud=921600)
# Wait for the first heartbeat
# This sets the system and component ID of remote system for the link
the_connection.wait_heartbeat()
# Send heartbeat from a MAVLink application.
while True:
the_connection.mav.heartbeat_send(mavutil.mavlink.MAV_TYPE_ONBOARD_CONTROLLER,
mavutil.mavlink.MAV_AUTOPILOT_INVALID, 0, 0, 0)
time.sleep(1)