Frsky bidirectional telemetry implementation

Yes I see. Thanks again for all the information.

…Eric I think I’ve just found the bug in my lua code that prevented the use of the correct CRC algo, thanks for raising the CRC issue or this would have gone undetected :slight_smile:

Hey, you have found many a wrinkle in my code :stuck_out_tongue_closed_eyes:

Will you let me know if/when you switch?

sure, I need to do some testing first but should be soon

Hi Eric, my latest branch has the CRC fix and the FrskLuaGCS as well, so the correct algo should be

#include <stdio.h>
#include <stdint.h>

void update_crc(int16_t* crc, uint8_t c)
{
*crc += c; //0-1FF
*crc += *crc >> 8;
*crc &= 0xFF;
}

int main()
{
int16_t crc=0;

uint8_t bytes[23] = {
    0x00,0x11,
    0x16,0x71,0x3D,0x0A,
    
    0x01,0x3E,
    0x41,0x54,0x43,0x5F,
    
    0x02,0x52,
    0x41,0x54,0x5F,0x52,
    
    0x03,0x4C,
    0x4C,0x5F,0x50
};
for (uint8_t i=0;i<sizeof(bytes);i++) {
    update_crc(&crc,bytes[i]);
    
    printf("%d: %02X -> %02X\n",i, bytes[i], crc);
}
}

result would be:

0: 00 -> 00                                                                                                                            
1: 11 -> 11                                                                                                                            
2: 16 -> 27                                                                                                                            
3: 71 -> 98                                                                                                                            
4: 3D -> D5                                                                                                                            
5: 0A -> DF                                                                                                                            
6: 01 -> E0                                                                                                                            
7: 3E -> 1F                                                                                                                            
8: 41 -> 60                                                                                                                            
9: 54 -> B4                                                                                                                            
10: 43 -> F7                                                                                                                           
11: 5F -> 57                                                                                                                           
12: 02 -> 59                                                                                                                           
13: 52 -> AB                                                                                                                           
14: 41 -> EC                                                                                                                           
15: 54 -> 41                                                                                                                           
16: 5F -> A0                                                                                                                           
17: 52 -> F2                                                                                                                           
18: 03 -> F5                                                                                                                           
19: 4C -> 42                                                                                                                           
20: 4C -> 8E                                                                                                                           
21: 5F -> ED                                                                                                                           
22: 50 -> 3E

Great! I’ve only implemented on mavlite message type so far, but I can move ahead now with the others.

1 Like

Hi Alex-I just wanted to let you know that I have your LuaGCS working on a Radiomaster TX16S and so far all is working fine. PixRacer FC with your Binary (was running Master anyway). I only made one parameters change to test and it set it no problem.

Big thanks for the great work!

Thanks Dave!
really appreciate your feedback!
May I ask your MPM and receiver model and firmware version?

It has an internal MPM but on this craft I’m using an R9 module with a R9MM-OTA flashed with ACCST firmware. Standard Sport telemetry.

Ahn ok, I assumed you were using the MPM module.
We’re collecting some firmware combinations known to work because full bidirectional support is all about firmware versions and wiring!
Did you try the uninverted pad on your r9mm-ota by any chance?

No, didn’t try that output, just Sport.PixRacers make this easy. The Rx firmware version is 190201 which is the only ACCST version available. I have a Pixhawk with an X8R bound to the MPM on the bench, I’ll give that a go.

Pixhawk1 (converter cable) with an X8R on the MPM is working. This version of MPM firmware (latest):

1 Like

Alex-The KakuteF7 Test Release firmware Zip file is empty.

Also, if you want to add a Rover build to the PixRacer FC I’ll test it :slight_smile:

Thanks Dave, the KakuteF7 build failed for lack of flash, I had to disable a couple features to make it fit

define HAL_PARACHUTE_ENABLED 0
define HAL_SPRAYER_ENABLED 0
define HAL_BATTMON_SMBUS_ENABLE 0
define HAL_BATTMON_FUEL_ENABLE 0

Done, happy testing :slight_smile:

Thanks Dave!
Now we need some ACCESS testers and ACCST D16 v2.x

What a productive day! All similar configs but confirmed working:
PixRacer, Copter, R9M Module, R9MM-OTA, ACCST
PixRacer, Copter, R9M Module, R9, ACCST
PixRacer, Rover, R9M Module, R9 Slim, ACCST
KakuteF7, Copter, R9M Module, R9MM (old version), ACCST
Pixhawk, Copter, MPM Internal Module, X8R, ACCST

None of the ACCST versions are v2.x but no reason to believe it wouldn’t work as the MPM module supports it.

1 Like

This looks amazing. Been busy for months but I am looking forward to trying this out. Does anyone know if Eric’s Mav2Passthrru is working with this yet or are we restricted to Frsky – which is fine as I have a R9MM somewhere.

Hi Marc, not working yet but Eric is working on it, should happen soon!

Alex- Confirmed ACCST D16 V2.1.0 is working:
Kakute F7, Copter, MPM Internal Module, R-XSR, ACCST V2.1.0

Could I ask a favor? I’m not sure which version of Master your firmware is current with but Dr. Piper added an enhancement/fix to master relative to the Dynamic notch filter in recent days. I’m using that feature in Master on a couple craft. Possible to update your PixRacer build to current Master to include it?

In general what’s the status of merging the Lua GCS into Master?

Hi Dave, this PR is under active review, so hopefully not far from getting into master.

My builds are based on master as the July 10, this is the commit I rebased on https://github.com/ArduPilot/ardupilot/commit/aca70ffd34c9f8fdb87c0ae68e3c4b3ebc4ac1c3