RSSI
Purpose
determine signal strength from different sources / GPIO pins
Considerations
Need to keep functions generic for GPIOs
What is providing the RSSI signal? What is the form of the data (Need to ask Aidan Bowers)
Related hardware: An RC Link
RFD900.
SiK Manual: https://files.rfdesign.com.au/Files/documents/Software manual.pdf
Datasheet: http://files.rfdesign.com.au/Files/documents/RFD900 DataSheet.pdf
RFD900x software: https://files.rfdesign.com.au/Files/documents/RFD900x Peer-to-peer V3.X User Manual V1.3.pdf
RFD900x hardware: http://files.rfdesign.com.au/Files/documents/RFD900 DataSheet.pdf
Need to see how RFD900 sends RSSI signals and how it interfaces with the actual flight controller. Then can determine what signal needs to be "decoded"
Will the PPM driver be what calls the RSSI module?
(2021 year was PWM, this year 2022 will need to look into RFD900)
We are no longer using singleton, need to get rid of that
Functions:
Normalized and unnormalized function returning signal strength
Threshold function returning a bool representing ‘good signal' and bad signal, or a function returning one out of a scale of judgements, e.g. ‘no signal', ‘bad signal’, ’ok signal' , ‘good signal', 'strong signal’ represented as an integer
For pull request:
Make LOS/RSSI branch (after weekend)
Research
Notes about RSSI:
https://www.youtube.com/watch?v=nZxMvTCN_pI&t=340s&ab_channel=AndyRC
Some RSSI Types
Basic analog signal (eg. voltage range between 0.0 and 5.0, or 0.0 and 3.3)
PWM signal
PPM signal
PPM vs. PWM:
Notes about RFD900:
According to SiK Manual, RFD900 has:
TX pin that is UART
which protocol?
GPIOs
Digital
ADC
PWM capable
“Mavlink radio status reporting”, including local RSSI and remote RSSI
So the RFD900 can use Mavlink serial protocol for RSSI reporting
Can be configured by AT commands (use RT commands for remote modem):
you can send AT commands to get RSSI report
If the report goes to CLI, would calling the AT commands in a shell script and reading the rssi from there be a viable solution?
RFD900 uses PPM, but do we ever directly deal w/ the PPM, or does it get converted to a serial protocol first by the RFD900?
RFD900 carries RC PPM and Mavlink telemetry at the same time, so either or can be chosen
Can RSSI come through the RC PPM?
Ardupilot implementation reference
AP_RSSI.cpp calls on AP_HAL_SITL/AnalopIn.cpp class for its ‘channel’ function
AnalogIn.cpp has ‘channel’ function which returns a pointer to an AnalogSource object by calling the ADCSource object constructor. Pointer is stored in rssi_analog_source variable
(ADCSource inherits from AnalogSource, is declared in AP_HAL_SITL/AnalogIn)
https://github.com/ArduPilot/ardupilot/blob/master/libraries/AP_HAL_SITL/AnalogIn.cpp
AnalogSource is an abstract class, defined in a different AnalogIn file, AP_HAL/AnalogIn
AnalogSource constructor requires inputting a pointer to a SITL_State object
In AP_RSSI.cpp, AnalogIn object is actually a member variable of AP_HAL::HAL.h class
A hal.h object called hal is accessed using ‘extern’ keyword
In AP_RSSI.cpp read_pin_rssi function
ADCSource voltage_average() function is called on rssi_analog_source variable
voltage_average() returns a manipulated (normalized to between 0.0f and 5.0f) output of ADCSource read_average() function. read_average() returns return of ADCSource read_latest() function.
read_latest(), depending on the pin, returns the appropriate pin value from the _sitlState member variable of ADCSource, which holds a pointer to a sitlState object
(the desired pin is an argument of the ‘channel’ function mentioned earlier)
the pin values are from 0.0f to 1023.0f
AP_RSSI.cpp also has functions which get PWM values