Guitarmath / arducopter

Automatically exported from code.google.com/p/arducopter
0 stars 0 forks source link

Real RSSI support #477

Closed GoogleCodeExporter closed 8 years ago

GoogleCodeExporter commented 8 years ago
To handle RSSI you have to buid your own function, it'll be nice to have 
something Out of the box with Arducopter.
For exemple in test.pde, something to display current RSSI value and store min 
value and max value in EEPROM.

To display value, add something like this in test.pde :
add this definition :
static int8_t   test_rssi(uint8_t argc,         const Menu::arg *argv); 

Add this menu :
{"rssi",        test_rssi},

Add this function :
static int8_t
test_rssi(uint8_t argc, const Menu::arg *argv)
{
    static AP_AnalogSource_Arduino RSSI_pin(RADIO_RSSI_PORT);

    print_hit_enter();
    while(1) {
        delay(1000);

        Serial.printf_P(PSTR("RSSI signal: %d \n"), RSSI_pin.read_average());

        if(Serial.available() > 0){
            return (0);
        }
    }

    return (0);
}

It will also be necessary to update GCS_Mavlink.pde in function send_radio_in :
Instead of "const uint8_t rssi = 1;" have a function to read current value and 
transform this value to percent, like this :

static uint8_t read_rssi()
{
static AP_AnalogSource_Arduino RSSI_pin(RADIO_RSSI_PORT);
uint16_t rssi_value = constrain(RSSI_pin.read_average(), g.min_rssi_value, 
g.max_rssi_value);
return (uint8_t) ( 100 * (rssi_value - g.min_rssi_value) / ( g.max_rssi_value - 
g.min_rssi_value)

}

Original issue reported on code.google.com by airma...@gmail.com on 2 Sep 2012 at 9:56

GoogleCodeExporter commented 8 years ago
Closing all issues on the old issues list by marking them WontFix.

If this is still a valid issue please re-raise it on the new GitHub issues 
list: https://github.com/diydrones/ardupilot/issues

Thanks!

Original comment by rmackay...@gmail.com on 21 Jul 2013 at 2:14