-
Notifications
You must be signed in to change notification settings - Fork 1.5k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Modify FrSky D-series telemetry for compatibility with Lua script #3116
Modify FrSky D-series telemetry for compatibility with Lua script #3116
Conversation
The only difference with X-series is a distance sensor ID: X-series use 0420. |
@alexeystn could we move the common code to a separate file? It looks like there’s quite some duplicated code in sport and d8 telemetry (I’m viewing on mobile, so I might be wrong) |
@alexeystn Nice! I don't have a D-series Rx to test, but it seems solid. So the distance sensor on the transmitter will by default be named @fiam Yes, there is a bit of duplication between |
I’d suggest we rename frsky.c to frsky_d8.c and we use frsky.c to put the common code. @digitalentity? |
@teckel12 Yes, that is correct. |
I second the rename. It's very confusing |
@fiam @DzikuVx Not that anything we do won't be confusing. But, making it Maybe |
|
@fiam 👍 For FrSky telemetry options it should be |
Today I have checked these changes with D8R-II-Plus in the field. Telemetry screen worked correctly. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I reviewed the D-series telemetry and didn't notice the dummy values, good catch!
@alexeystn Do you want to create the |
@teckel12 That was my mistake, I left them after bench-testing inside the house without GPS accidentally. |
@alexeystn I believe that's right. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Visual inspection seems correct. Will compile this branch and test in the next couple days.
@alexeystn I also wanted to bring up the issue with the 16-bit variable overflow for the flight modes. Do you happen to know if it's unsigned or signed? If it's unsigned there's probably an easy fix. But if it's signed, the D-series would never get a FAILSAFE notification. |
@teckel12 I assigned Failsafe to the aux channel in configurator so that I could test it without real signal loss. When I toggle the switch, I see "Failsafe" notification on Taranis' screen. It means, unsigned 16-bit variable is sent correctly to D8R-II. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Still haven't tested the code, but I like the 16-bit overflow fix.
src/main/telemetry/frsky.c
Outdated
// todo: prevent 16-bit variable from overflow, | ||
// D-series receivers transmit only 16-bit values | ||
else | ||
if (FLIGHT_MODE(AUTO_TUNE)) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@alexeystn Would this be more readable and more in line with the code standard to be
else if (FLIGHT_MODE(AUTO_TUNE))
tmpi += 20000;
src/main/telemetry/frsky.c
Outdated
// D-series receivers transmit only 16-bit values | ||
else | ||
if (FLIGHT_MODE(AUTO_TUNE)) | ||
tmpi += 20000; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Maybe a note to clarify why it's being done this way (as a year from now someone will probably see this as a mistake and "correct" it). Something like this:
// intentionally reverse order and else if to prevent 16 bit overflow
@alexeystn I compiled your branch last night and was planning on testing tonight, but something came up. Will test on Wednesday. Sorry for the delay. |
@alexeystn Tested this PR on two quads today (SmartPort telemetry) and both worked without a problem. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Works good with S.Port
@alexeystn For Lua Telemetry distance support I need to verify the exact distance sensor name. Delete the I need to know this for two reasons. First, documentation. And secondly, so the script can use the default sensor name instead of needing to rename it (making it easier for users). Thanks! |
@teckel12 Even though D8-receiver operates with 8-bit sensor IDs, Taranis displays it as Since it is a string, not a number, it makes difference. You are right. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
👍
@alexeystn Perfect! SPlissken has also agreed to test D-series receivers with Lua Telemetry. |
@fiam @alexeystn I got a third confirmation from @SPlissken that this branch is functional with both X-series and D-series receivers. I'd say it's good to merge. |
Can you resolve the conflicts so we can merge it for 2.0? |
Yes, I'll try to resolve them within a day or two. |
Thanks @alexeystn. Feel free to ping me after doing so and I'll merge right away. |
@fiam I think it's done. |
Thanks @alexeystn! Merging. |
This PR makes old FrSky D-series telemetry receivers fully compatible with Lua Telemetry script by @teckel12.
Please, add 'In progress' label. I've run successful bench tests with D8R-II Plus receiver, but need to test it out in the field to make sure everything is ok.