Add support for SoftRF (ADS-B / FLARM)
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.
Duplicates:
- https://github.com/iNavFlight/inav/issues/3849
- https://github.com/iNavFlight/inav/discussions/7883
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?
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.
However if I look into the mavlink source code in SoftRF:
It seems to me, that SoftRF is only using the ID 24 if MAVLINK10 is not defined, which it is currently in mavlink.h:
@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?
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 -
Ok. So that means that SoftRF wants to talk Mavlink1 and INAV Mavlink2?
... 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.
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
- move ADSB from Telemetry settings to peripheral
- 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
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
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.
Why SoftRF needs GPS data?
From FC to SoftRF
Required
MAVLINK_MSG_ID_HEARTBEATMAVLINK_MSG_ID_SYSTEM_TIME- accurate GNSS time for Air V7 / ADS-L / OGNTP frequency hoppingMAVLINK_MSG_ID_GPS_RAW_INT- own aircraft positionRecommended
MAVLINK_MSG_ID_SYS_STATUS- FC battery charge levelMAVLINK_MSG_ID_VFR_HUD- barometric altitudeMAVLINK_MSG_ID_ATTITUDE- pitch, roll, yawMAVLINK_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 forMAV_DATA_STREAM_EXTENDED_STATUSrequest forMAV_DATA_STREAM_EXTRA3