inav icon indicating copy to clipboard operation
inav copied to clipboard

Add support for SoftRF (ADS-B / FLARM)

Open SAMUD opened this issue 2 months ago • 11 comments

Current Behavior / Desired Behavior

INAV is compatible to different ADS-B solutions like the PingRX and ADSBee. I think it would be cool to add support for SoftRF because this is a simple DIY solution with a regular ELRS receiver and a custom firmware --> https://github.com/lyusupov/SoftRF/wiki/Nano-Edition

Suggested Solution

Currently it seems to me that the needed MAVlink messages for the communication with SoftRF (which works with Arduplane) are not integrated in INAV. Plugging in a Radiomaster XR1 flashed with SoftRF shows no communication with the FlightController in the webinterface of SoftRF.

Image

SAMUD avatar Oct 12 '25 18:10 SAMUD

Duplicates:

  1. https://github.com/iNavFlight/inav/issues/3849
  2. https://github.com/iNavFlight/inav/discussions/7883

lyusupov avatar Oct 14 '25 10:10 lyusupov

Oh. The master of SoftRF is here :D

Sadly the other two issues have been closed or no response from INAV. But as INAV has support for ADS-B now I hope there is the possibility to implement it - or that SoftRF could take the route and use the existing implementation in INAV which is compatible with the other ADS-B receivers mentioned here: https://github.com/iNavFlight/inav/blob/master/docs/ADSB.md

If I understand the documentation correctly, SoftRF uses the Mavlink ADSB_VEHICLE message to send information about aircrafts nearby and thats also what INAV expects. However there seems to be a problem requesting the GNSS position from the flight controller. I tried to find more information on what MAVLINK messages are required/used, but was unable to find something. So perhaps a dev could look into this?

SAMUD avatar Oct 14 '25 11:10 SAMUD

Image

lyusupov avatar Oct 14 '25 11:10 lyusupov

Image

lyusupov avatar Oct 14 '25 11:10 lyusupov

To be sure my hardware is okay, i flashed the XR1 back to elrs, changed the port in INAV to Receiver and tested if it works. Hardware and wiring is okay.

From what I understand SoftRF changes the Status in the WebUI from "NONE" to "MAV" as soon as it gets a valid GPS position.

INAV should be sending MAVLINK ID 24 GPS_RAW_INT as soon at it has a valid GPS fix. Image

However if I look into the mavlink source code in SoftRF: Image It seems to me, that SoftRF is only using the ID 24 if MAVLINK10 is not defined, which it is currently in mavlink.h: Image

@lyusupov does SoftRF work if you remove the define and use the ID24? Would it be possible to build a version without the define and i will test it for you? Or am i totally wrong with my findings and it's something else?

SAMUD avatar Oct 14 '25 16:10 SAMUD

Since year 2017, the SoftRF project uses REFERENCE MAVLINK PROTOCOL V1.0 IMPLEMENTATTION CREATED BY MAVLINK TEAM.

@SAMUD So, if you have any issues with the iNAV -you should look for root cause of them in iNAV source code.

An autopilot have to supply at least one valid MAVLINK HEARTBEAT message in order to trigger SoftRF MAVLINK status flag -

Image

lyusupov avatar Oct 14 '25 16:10 lyusupov

Ok. So that means that SoftRF wants to talk Mavlink1 and INAV Mavlink2?

SAMUD avatar Oct 14 '25 17:10 SAMUD

... and INAV Mavlink2?

You tell us... I know nothing about iNav - I use ArduPilot.

An ArduPilot user can assign either MAVLINK V1 or MAVLINK V2 to any of telemetry ports available . The connection baud rate can also be selected in it's Mission Planner.

lyusupov avatar Oct 14 '25 18:10 lyusupov

Inav has limited support for MAVLINK. Currently INAV is not care about ADSB device, INAV just listen for ADSB_VEHICLE mavlink frame. If ADSB device would need more interaction then

  1. move ADSB from Telemetry settings to peripheral
Image
  1. for ADSB peripheral set port as mavlink, send all necesesary malink frames and listen to ADSB_VEHICLE

Documentation of softRF is not clear for me, Why softRF needs GPS data? For FLARM transmitting?

error414 avatar Oct 19 '25 06:10 error414

@error414

Why SoftRF needs GPS data?

From FC to SoftRF

Required

MAVLINK_MSG_ID_HEARTBEAT MAVLINK_MSG_ID_SYSTEM_TIME - accurate GNSS time for Air V7 / ADS-L / OGNTP frequency hopping MAVLINK_MSG_ID_GPS_RAW_INT - own aircraft position

Recommended

MAVLINK_MSG_ID_SYS_STATUS - FC battery charge level MAVLINK_MSG_ID_VFR_HUD - barometric altitude MAVLINK_MSG_ID_ATTITUDE - pitch, roll, yaw MAVLINK_MSG_ID_ADSB_VEHICLE - traffic from other connected ADS-B receivers (if any)

From SoftRF to FC

MAVLINK_MSG_ID_ADSB_VEHICLE - air traffic received by SoftRF sub-1GHz radio request for MAV_DATA_STREAM_EXTENDED_STATUS request for MAV_DATA_STREAM_EXTRA3

lyusupov avatar Oct 19 '25 09:10 lyusupov

I am working on more MAVLINK integration , i'll look into what's missing. I know VFR_HUD, HEARTBEAT, ATTITUDE, SYS_STATUS and ADSB_VEHICLE are already in there; but i'm not sure if it responds to stream requests. I'll take a look soon.

@error414

Why SoftRF needs GPS data?

From FC to SoftRF

Required

MAVLINK_MSG_ID_HEARTBEAT MAVLINK_MSG_ID_SYSTEM_TIME - accurate GNSS time for Air V7 / ADS-L / OGNTP frequency hopping MAVLINK_MSG_ID_GPS_RAW_INT - own aircraft position

Recommended

MAVLINK_MSG_ID_SYS_STATUS - FC battery charge level MAVLINK_MSG_ID_VFR_HUD - barometric altitude MAVLINK_MSG_ID_ATTITUDE - pitch, roll, yaw MAVLINK_MSG_ID_ADSB_VEHICLE - traffic from other connected ADS-B receivers (if any)

From SoftRF to FC

MAVLINK_MSG_ID_ADSB_VEHICLE - air traffic received by SoftRF sub-1GHz radio request for MAV_DATA_STREAM_EXTENDED_STATUS request for MAV_DATA_STREAM_EXTRA3

xznhj8129 avatar Nov 04 '25 22:11 xznhj8129