- Posts: 3333
DSM Telemetry support
- vlad_vy
- Offline
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)
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;
Please Log in or Create an account to join the conversation.
- PhracturedBlue
- Topic Author
- Offline
- Posts: 4402
Please Log in or Create an account to join the conversation.
- PhracturedBlue
- Topic Author
- Offline
- Posts: 4402
//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.
- vlad_vy
- Offline
- Posts: 3333
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
Please Log in or Create an account to join the conversation.
- PhracturedBlue
- Topic Author
- Offline
- Posts: 4402
Please Log in or Create an account to join the conversation.
- vlad_vy
- Offline
- Posts: 3333
Please Log in or Create an account to join the conversation.
- Indigo
- Offline
- Posts: 230
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.
- Indigo
- Offline
- Posts: 230
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.
- Indigo
- Offline
- Posts: 230
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.
- vlad_vy
- Offline
- Posts: 3333
Please Log in or Create an account to join the conversation.
- PhracturedBlue
- Topic Author
- Offline
- Posts: 4402
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.
- vlad_vy
- Offline
- Posts: 3333
Is GPS telemetry display code common for Devo and DSM?
Please Log in or Create an account to join the conversation.
- PhracturedBlue
- Topic Author
- Offline
- Posts: 4402
Please Log in or Create an account to join the conversation.
- vlad_vy
- Offline
- Posts: 3333
Please Log in or Create an account to join the conversation.
- vlad_vy
- Offline
- Posts: 3333
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(-)
Please Log in or Create an account to join the conversation.
- Indigo
- Offline
- Posts: 230
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.
- vlad_vy
- Offline
- Posts: 3333
Please Log in or Create an account to join the conversation.
- Indigo
- Offline
- Posts: 230
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.
Edit: I see the problem with, i will upload fix for GPS Speed soon.
Please Log in or Create an account to join the conversation.
- Indigo
- Offline
- Posts: 230
Fixes Devo GPS Speed (I hope).
Source
Please Log in or Create an account to join the conversation.
- vlad_vy
- Offline
- Posts: 3333
Please Log in or Create an account to join the conversation.
- Home
- Forum
- Development
- Protocol Development
- DSM Telemetry support