DSM Telemetry support

More
23 Apr 2015 14:48 - 23 Apr 2015 14:51 #31528 by vlad_vy
Replied by vlad_vy on topic DSM Telemetry support
PB, can you change at main trunk next things?
        case 0x16: //GPS sensor (always second GPS packet)
            update = update16;
            Telemetry.gps.altitude = altitude + (bcd_to_u8(packet[3]) * 100
                                               + bcd_to_u8(packet[2])) * 100; //In meters * 1000 (16Bit decimal, 1 unit is 0.1m)
Current code sometimes doubles, triples altitude value if data type 0x17 GPS packet get lost.

Also, for() cycle doesn't work. It seems all values are writed to Telemetry.p.dsm.flog.fades[0].
        case 0x7f: //TM1000 Flight log
        case 0xff: //TM1100 Flight log
            update = update7f;
            //Telemetry.p.dsm.flog.fades[0] = pkt16_to_u8(packet+2); //FadesA 0xFFFF = (not connected)
            //Telemetry.p.dsm.flog.fades[1] = pkt16_to_u8(packet+4); //FadesB 0xFFFF = (not connected)
            //Telemetry.p.dsm.flog.fades[2] = pkt16_to_u8(packet+6); //FadesL 0xFFFF = (not connected)
            //Telemetry.p.dsm.flog.fades[3] = pkt16_to_u8(packet+8); //FadesR 0xFFFF = (not connected)
            //Telemetry.p.dsm.flog.frameloss = pkt16_to_u8(packet+10);
            //Telemetry.p.dsm.flog.holds = pkt16_to_u8(packet+12);
            for(int i = 2; i < 14; i+=2) {
                *(u8*)&Telemetry.p.dsm.flog = pkt16_to_u8(packet+i);
            }
            Telemetry.p.dsm.flog.volt[1] = pkt16_to_volt(packet+14);
            break; 
Last edit: 23 Apr 2015 14:51 by vlad_vy.

Please Log in or Create an account to join the conversation.

More
23 Apr 2015 15:09 #31529 by PhracturedBlue
Replied by PhracturedBlue on topic DSM Telemetry support
Can you file a ticket (or point me at one if it already exists)?

Please Log in or Create an account to join the conversation.

More
23 Apr 2015 15:17 #31530 by PhracturedBlue
Replied by PhracturedBlue on topic DSM Telemetry support
Also, does this fix the fades issue:
            //Telemetry.p.dsm.flog.holds = pkt16_to_u8(packet+12);
            u8 *flog = (u8*)&Telemetry.p.dsm.flog;
            for(int i = 2; i < 14; i+=2) {
                *flog++ = pkt16_to_u8(packet+i);
            }
            Telemetry.p.dsm.flog.volt[1] = pkt16_to_volt(packet+14);
            break;

Please Log in or Create an account to join the conversation.

More
23 Apr 2015 15:24 - 23 Apr 2015 15:35 #31532 by vlad_vy
Replied by vlad_vy on topic DSM Telemetry support
www.deviationtx.com/mantisbt/view.php?id=611

It works fine. After Tx power off and power on:
FadesA = 45
FadesB = 255 (always)
FadesL = 45
FadesR = 255 (always)
Loss = 0
Holds = 1

Once more:
FadesA = 89
FadesB = 255 (always)
FadesL = 89
FadesR = 255 (always)
Loss = 0
Holds = 2
Last edit: 23 Apr 2015 15:35 by vlad_vy.

Please Log in or Create an account to join the conversation.

More
23 Apr 2015 16:00 #31534 by PhracturedBlue
Replied by PhracturedBlue on topic DSM Telemetry support
You say it works fine, but having B and R be 255 always, and A and L being the same looks suspicious. I don't know anything about how fades display in DSM. Is this result typical? Would it help to enable debug and show the raw packet coming in?

Please Log in or Create an account to join the conversation.

More
23 Apr 2015 16:09 - 23 Apr 2015 16:12 #31536 by vlad_vy
Replied by vlad_vy on topic DSM Telemetry support
It's normal when I restart Tx. Both Fades have to be changed equally. Fades = 255 (really 0xFFFF) for disabled receivers and satellites.
Last edit: 23 Apr 2015 16:12 by vlad_vy.

Please Log in or Create an account to join the conversation.

More
24 Apr 2015 08:41 #31560 by Indigo
Replied by Indigo on topic DSM Telemetry support

Thomas.Heiss wrote: Tested re-occuring holds with test build devo10-v4.0.1-72057cf:

Holds >= 1

on 2nd/3rd hold does not always re-alarm (sound) even the hold counter is incremented.
...


This issue is now fixed: "Telemetry alarms don't always re-alarm (sound)."

If you want to test it to make sure it's fixed, you can download latest from Test Builds.

Please Log in or Create an account to join the conversation.

More
24 Apr 2015 08:50 #31561 by Indigo
Replied by Indigo on topic DSM Telemetry support

vlad_vy wrote: It's normal when I restart Tx. Both Fades have to be changed equally. Fades = 255 (really 0xFFFF) for disabled receivers and satellites.


vlad_vy, can you please check my test build, that FadesA & FadesL display correctly and that FadesB & FadesR are displayed as "not connected" (zero and inverted). I'm unable to test this myself, my model (NanoQX) seems to just transmit 0 for all fades.

And is Latitude and Longitude working?

Thanks :)

Please Log in or Create an account to join the conversation.

More
24 Apr 2015 13:03 #31565 by Indigo
Replied by Indigo on topic DSM Telemetry support
I've been thinking about how to restore support for GPS telemetry to DSM2/DSMX modules on Devo7e. The GPS data handling code will need to be made smaller than it currently is.

The GPS data is received in a format ready for display (degrees, minutes) and is then converted into a seconds value and later back into a different display format (degrees, minutes, seconds). Storing the value in seconds is not very useful. If I wanted to set telemetry alarms to alert me if I stray past a certain latitude or longitude, I'm not going to know the value "in seconds" to be able to set an alarm. However, if the coordinate values were to remain in their original format of degrees, minutes the comparison > <= operators would still work if I were to set alarm values in same data format.

Same goes for gps altitude, velocity and time. The only disadvantage would be not being able to choose the display format. So displayed formats would be fixed: Latitude and longitude in degrees, minutes; altitude in m, velocity in m/s, time in 24hr GMT.

Please Log in or Create an account to join the conversation.

More
24 Apr 2015 15:06 - 24 Apr 2015 15:08 #31571 by vlad_vy
Replied by vlad_vy on topic DSM Telemetry support
What about split flies and cutlets? Do not parse telemetry inside cb() code, but write raw data to global buffer with two pointers (write and read pointers). Then inside telemetry display code read buffer from read pointer up to write pointer, parse values, average if needed, reset pointers and display values. If it possible.
Last edit: 24 Apr 2015 15:08 by vlad_vy.

Please Log in or Create an account to join the conversation.

More
24 Apr 2015 15:08 #31572 by PhracturedBlue
Replied by PhracturedBlue on topic DSM Telemetry support
I can't say that'll make me happy. Devo adn DSM and FrSky do not use the same format for telemetry. Converting to a common format makes the code more manageable and lets us use common functions everywhere. Storing GPS data differently for different protocols will likely add more code into the main body of deviation, and will certainly make adding new protocols more complicated.
I also don't think you'll save very much at the protocol level. there are likely better places to spend optimization effort. I'd start by looking at the disassembly for the dsm protocol and figure out which functions are largest.
Prove me wrong :)

Please Log in or Create an account to join the conversation.

More
24 Apr 2015 15:11 #31573 by vlad_vy
Replied by vlad_vy on topic DSM Telemetry support
Indigo, with latest build nothing changed. Latitude and Longitude have zero values.

Is GPS telemetry display code common for Devo and DSM?

Please Log in or Create an account to join the conversation.

More
24 Apr 2015 16:04 #31576 by PhracturedBlue
Replied by PhracturedBlue on topic DSM Telemetry support
yes

Please Log in or Create an account to join the conversation.

More
25 Apr 2015 06:49 #31591 by vlad_vy
Replied by vlad_vy on topic DSM Telemetry support
Indigo, with latest build a9e60ff nothing changed. Latitude and Longitude have zero values.

Please Log in or Create an account to join the conversation.

More
25 Apr 2015 07:31 - 25 Apr 2015 07:34 #31594 by vlad_vy
Replied by vlad_vy on topic DSM Telemetry support
Next code will correct problem with Latitude and Longitude:
            Telemetry.gps.latitude  =  pkt32_to_coord(&pkt[4]) * ((end_byte & 0x01)? 1: -1); //1=N(+), 0=S(-)
            Telemetry.gps.longitude = (pkt32_to_coord(&pkt[8]) + ((end_byte & 0x04)? 360000000: 0)) //1=+100 degrees
                                                                  * ((end_byte & 0x02)? 1: -1); //1=E(+), 0=W(-)
Last edit: 25 Apr 2015 07:34 by vlad_vy.

Please Log in or Create an account to join the conversation.

More
25 Apr 2015 07:54 #31595 by Indigo
Replied by Indigo on topic DSM Telemetry support
Thanks, I've added those brackets and also added brackets to this:
static int pkt32_to_coord(u8 *ptr)
 {
     // (decimal, format DD MM.MMMM)
     return bcd_to_int(ptr[3]) * 3600000
          + bcd_to_int(((u32)ptr[2] << 16) | ((u32)ptr[1] << 8) | ptr[0]) * 6;
 }

With both our changes it should now work. I've recompiled and re-uploaded a9e60ff to Test Builds. Thanks :)

Please Log in or Create an account to join the conversation.

More
25 Apr 2015 08:09 #31596 by vlad_vy
Replied by vlad_vy on topic DSM Telemetry support
DSM protocol GPS telemetry is OK. What is about Devo GPS Speed? Devo GPS Speed always invariable with red background. If reboot Tx, value changed, but remains invariable with red background.

Please Log in or Create an account to join the conversation.

More
25 Apr 2015 08:25 - 25 Apr 2015 08:36 #31597 by Indigo
Replied by Indigo on topic DSM Telemetry support
Thank you, It's good to know that DSM Latitude and Longitude is now fixed. :woohoo:

The code for Devo GPS Speed is same as August nightly. I have no idea. Is Devo GPS Altitude working?
The reason I ask is because only GPS Speed & Altitude use the function Float_to_Int().

Me trying to fix Devo issues without the ability to test a verify myself before uploading (I have no Devo models) means many attempted fixes achieve nothing and wastes other peoples time. Can you please fix GPS Speed?

Edit: I see the problem with, i will upload fix for GPS Speed soon. :woohoo:
Last edit: 25 Apr 2015 08:36 by Indigo.

Please Log in or Create an account to join the conversation.

More
25 Apr 2015 08:48 #31598 by Indigo
Replied by Indigo on topic DSM Telemetry support
Latest build a9e60ff has been recompiled and re-uploaded to Test Builds.

Fixes Devo GPS Speed (I hope).

Source

Please Log in or Create an account to join the conversation.

More
25 Apr 2015 08:56 - 25 Apr 2015 08:57 #31599 by vlad_vy
Replied by vlad_vy on topic DSM Telemetry support
It's not value problem, it's update problem. Devo GPS Speed value is not updated. If reboot Tx, Speed has new value, but invariable with red background.
Last edit: 25 Apr 2015 08:57 by vlad_vy.

Please Log in or Create an account to join the conversation.

Time to create page: 0.180 seconds
Powered by Kunena Forum