Hello all,
I have been trying to connect my Raspberry Pi to the Herelink UART port and exchange heartbeats between the gcs and rpi using pymavlink. I am able to connect to my Cubeblack with missionplanner using the 5.8Ghz hotspot.
However with Rpi I am not able to detect any serial data or the heartbeats on the UART port of air unit.
I am using the two reference codes from mavlink.io
Code on gcs side:
#####################################################
from pymavlink import mavutil
import time
master = mavutil.mavlink_connection(βudp:0.0.0.0:14550β)
msg = None
while True:
master.mav.heartbeat_send(mavutil.mavlink.MAV_TYPE_GCS,mavutil.mavlink.MAV_AUTOPILOT_INVALID, 0, 0, 0)
try:
msg = master.recv_match()
except:
pass
print(msg)
time.sleep(1)
####################################
Code on RPi:
####################################
from pymavlink import mavutil
import time
master = mavutil.mavlink_connection(β/dev/ttyAMA0β,baud=57600)
msg = None
while True:
master.mav.heartbeat_send(mavutil.mavlink.MAV_TYPE_ONBOARD_CONTROLLER,mavutil.mavlink.MAV_AUTOPILOT_INVALID, 0, 0, 0)
try:
msg = master.recv_match()
except:
pass
print(msg)
time.sleep(1)
####################################
Can someone guide me on how to properly implement this?