VOXL ESC FPV queries
-
@Alex-Kushleyev I currently use, VOXL2 USB 3.0 Expansion Adapter connected to VOXL2. From the UART7 port of the Expansion Adapter I have connected to 6-PIN Telemetry1 Port in Flight Core V2.
My connection is similar to this,
As you mentioned earlier, I'm establishing connection through port
/dev/ttyHS1
. When I run thecat
command to read the messages from this port, I get garbled data as below,.
I'm not exactly clear when you mean if I have tried connecting to VOXL2 from QGC and access the Flight Core V2. Few things I have tried is,
-
Connecting to FlightCore V2 by connecting to Wifi of VOXL2. I also have a Wifi setup on VOXL2, which also acts as my Telemetry line. From QGC I connect to this local network to access FC data and PX4 parameters on Flight Core V2.
-
I have tried and tested few mavlink message commads which communicate with PX4 directly for C2C.
-
-
@tom As per your response on shifting to
voxl-inspect-mavlink mavlink_offboard
, I see that even in mavlink server documentation from ModalAI that service pipeline is not listed. Is it that something that has to be explicitly be enabled somewhere?
Even as per the documentation, I dont see this service pipeline listed. -
@Jetson-Nano I could have the naming wrong. If you inspect
mavlink_onboard
what kind of data do you see? -
@tom This is the output I get,
-
@Jetson-Nano Since you don't have voxl-px4 running I think that data is likely coming from your external flight controller
-
@tom yes, the message is coming from external flight controller, Flight core v2. Now can you share how to double check if the RC message is set up to forward to voxl-mavlink-server from Flight Core (if not, how to enable it) and how to actually read that message?
-
@Jetson-Nano Probably should also look at the pipe for messages from the flight controller to the GCS (Labeled mavlink_to_gcs in the above diagram but you'll have to double check that name). Generally the flight controller is configured with two mavlink streams. One is the onboard stream that has high rate messages and is intended for local use (e.g. on VOXL or VOXL 2) and the other is more the default settings for communication with a GCS. You can configure what each of these streams contain in PX4. You can add streams, change stream rates, etc. all via PX4 configuration. Please refer to the PX4 documentation for details on how to do this.
-
Hi @Eric-Katzfey, I was thinking another approach, where we can use pymavlink to get the RC_channel data. Any inputs to the mentioned approach, is it feasible?
-
@Jetson-Nano Yes, that should work. You should be able to send heartbeats from a Python script using pymavlink and connect to the flight controller via voxl-mavlink-server. Then you should start receiving all the normal messages sent out by the flight controller to the GCS which should include the RC channels message.
-
Thank you @Eric-Katzfey ,for the confirmation with respect to the approach. Can you help me the code, maybe with providing a sample code.
I wrote a code to receive the data but the code was not connecting the Flight controller. I am providing the code here, Can you verify the code.
from pymavlink import mavutil import time import logging logging.basicConfig(level=logging.INFO) # Connection string for voxl-mavlink-server connection_string = 'udp:192.168.8.1:14558' # Function to send a heartbeat message def send_heartbeat(mavlink_connection): mavlink_connection.mav.heartbeat_send( mavutil.mavlink.MAV_TYPE_GCS, # Type: Ground Control Station mavutil.mavlink.MAV_AUTOPILOT_INVALID, # Autopilot: Not a specific autopilot 0, # Base mode 0, # Custom mode mavutil.mavlink.MAV_STATE_ACTIVE # State: Active ) logging.info("Heartbeat sent.") def main(): try: logging.info(f"Connecting to {connection_string}...") # Establish MAVLink connection mav = mavutil.mavlink_connection(connection_string) # Send an initial heartbeat to register as a GCS logging.info("Sending initial heartbeat...") send_heartbeat(mav) # Wait for heartbeat from the flight controller logging.info("Waiting for heartbeat from the flight controller...") mav.wait_heartbeat(timeout=10) logging.info(f"Heartbeat received! System_ID: {mav.target_system}, Component_ID: {mav.target_component}") # Request RC_CHANNELS data stream at 1 Hz mav.mav.request_data_stream_send( mav.target_system, mav.target_component, mavutil.mavlink.MAV_DATA_STREAM_RC_CHANNELS, 1, # Stream rate in Hz (1 Hz) 1 # Enable the stream ) # Periodically send heartbeats to keep the connection alive last_heartbeat_time = time.time() while True: # Send a heartbeat every 1 second current_time = time.time() if current_time - last_heartbeat_time > 1: send_heartbeat(mav) last_heartbeat_time = current_time # Listen for incoming messages msg = mav.recv_match(blocking=True) if msg: msg_type = msg.get_type() logging.info(f"Received message: {msg_type}") # If it's an RC_CHANNELS message, print the values if msg_type == 'RC_CHANNELS': logging.info(f"Channel 1: {msg.chan1_raw}") logging.info(f"Channel 2: {msg.chan2_raw}") logging.info(f"Channel 3: {msg.chan3_raw}") logging.info(f"Channel 4: {msg.chan4_raw}") except KeyboardInterrupt: logging.info("Exiting program.") except Exception as e: logging.error(f"An error occurred: {e}") if __name__ == "__main__": main()
The following is the output I got and it was stuck here and not moving forward.
INFO:root:Connecting to udp:192.168.8.1:14559... INFO:root:Sending initial heartbeat... INFO:root:Heartbeat sent. INFO:root:Waiting for heartbeat from the flight controller... INFO:root:Heartbeat received! System_ID: 0, Component_ID: 0