- Posts: 3333
DSM Telemetry support
- vlad_vy
- Offline
Please Log in or Create an account to join the conversation.
- Indigo
- Offline
- Posts: 230
Should have been this:
static void swap_LSB_MSB(u16 *ptr)
{
for(int i = 1; i <= 7; i++) {
ptr[i] = ((ptr[i] >> 8) & 0xff) | (ptr[i] << 8);
}
}
I have recompiled and uploaded to Test Builds.
Please Log in or Create an account to join the conversation.
- wing927
- Offline
- Posts: 2
I am new to this forum and to Deviation, My question is, will my Devo-10 work with DSM Telemetry. I wanted to get a TM-1000 module and use it with a AR10000 10Ch Rx. I had hopes that I could use the STiā¢ app with the TR-1000 Made for my, iPhone. This would be a home run for me but, I do not want to spend the $ if the system will not support it. So if anybody knows the answer please give me a hand thanks. By the way this is a great thing, I love my Devo 10 but until I found out about the Deviation upgrade I thought that the system was outdated, Again thanks.
Please Log in or Create an account to join the conversation.
- mwm
- Offline
I don't get a reliable telemetry connection with a LemonRX Rx. I can get it to bind and display data, but it won't reconnect after power cycling everything, and I have to hit bind again. Even then, it won't stay connected, but will drop the connection in a minute or two.
I was getting similar behavior from an OrangeRx Rx, but it's been installed in the Orion, so I haven't tested it on the new versions.
Do not ask me questions via PM. Ask in the forums, where I'll answer if I can.
My remotely piloted vehicle ("drone") is a yacht.
Please Log in or Create an account to join the conversation.
- Indigo
- Offline
- Posts: 230
vlad_vy wrote: Nothing changed with GPS data, except speed is as km/h. Time run as mad, I think instead seconds it use 1/100 sec, whole time has not sense, e.g. 31:04:42. Altitude 88760.500m, speed 129.639km/h and so on.
I updated (about 40 hours ago) 84cc0db, Did you try downloading again and re-testing GPS data?
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
I suspect problem is hr & min are swapped, and sec & 1/100 sec are swapped.
I have updated (just now) 84cc0db, Could you please try downloading again and re-testing GPS data?
Also, can you make sense of altitude or speed? I think altitude out by a factor of 100.
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
I have uploaded a new version 9834633 to Test Builds.
Please Log in or Create an account to join the conversation.
- vlad_vy
- Offline
- Posts: 3333
static u32 pkt32_to_coord(u16 *ptr)
{
// (decimal, format DD MM.MMMM)
return bcd_to_int(ptr[1] >> 8) * 3600000
+ bcd_to_int(ptr[1] & 0x00ff) * 60000
+ bcd_to_int(ptr[0]) * 6;
}
if ((data_type >= 0x15 && data_type <= 0x18) || (data_type == 0x34)) {
swap_LSB_MSB(pktTelem);
}
Telemetry.gps.satcount = bcd_to_int(pktTelem[4] & 0x00ff);
altitude = bcd_to_int(pktTelem[4] >> 8) * 1000000; //In 1000 meters * 1000 (8Bit decimal, 1 unit is 1000m)
Please Log in or Create an account to join the conversation.
- vlad_vy
- Offline
- Posts: 3333
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)
Please Log in or Create an account to join the conversation.
- Indigo
- Offline
- Posts: 230
Please Log in or Create an account to join the conversation.
- vlad_vy
- Offline
- Posts: 3333
But, Latitude and Longitude have zero values. Something is wrong.
With first code correction it should work. I only changed bitwise "!" to "&".
Please Log in or Create an account to join the conversation.
- Indigo
- Offline
- Posts: 230
static u32 pkt32_to_coord(u16 *ptr)
{
// (decimal, format DD MM.MMMM)
return bcd_to_int(ptr[1] >> 8) * 3600000
+ bcd_to_int(ptr[1] & 0x00ff) * 60000
+ bcd_to_int(ptr[0]) * 6;
}
Could you please test these alternatives which reduce code size:
static u32 pkt32_to_coord(u16 *ptr)
{
// (decimal, format DD MM.MMMM)
return bcd_to_int(ptr[1] >> 8) * 3600000
+ bcd_to_int(((u32)(ptr[1] & 0x00ff) << 16) | ptr[0]) * 6;
}
static u32 pkt32_to_coord(u16 *ptr)
{
// (decimal, format DD MM.MMMM)
return bcd_to_int(((u32)ptr[1] << 16) | ptr[0]) * 6
- bcd_to_int(ptr[1] & 0xff00) * 24000;
}
Please Log in or Create an account to join the conversation.
- vlad_vy
- Offline
- Posts: 3333
I can test any you want, if I will have your source code. Where I can download your code?
Please Log in or Create an account to join the conversation.
- Indigo
- Offline
- Posts: 230
hg pull -r dsm-telemetry https://bitbucket.org/Indigo1/deviationtx [<destinationPath>]
bitbucket.org/Indigo1/deviationtx/src
Please Log in or Create an account to join the conversation.
- vlad_vy
- Offline
- Posts: 3333
static u32 pkt32_to_coord(u16 *ptr)
{
// (decimal, format DD MM.MMMM)
return bcd_to_int(ptr[1] >> 8) * 3600000
+ bcd_to_int(ptr[1] & 0x00ff) * 60000
+ bcd_to_int(ptr[0]) * 6;
}
But, it seems I've found next bug, control bits are in 16 byte:
Telemetry.gps.latitude = pkt32_to_coord(&pktTelem[2]) * (pktTelem[7] & 0x0100)? 1: -1; //1=N(+), 0=S(-)
Telemetry.gps.longitude = (pkt32_to_coord(&pktTelem[4]) + (pktTelem[7] & 0x0400)? 360000000: 0) //1=+100 degrees
* (pktTelem[7] & 0x0200)? 1: -1; //1=E(+), 0=W(-)
I'm not sure it will help. It can't change latitude value, sign only.
Please Log in or Create an account to join the conversation.
- Indigo
- Offline
- Posts: 230
Latitude value too small? Try adding another zero to 3600000.
Would the latitude value be correct if you divide value by 36 and multiply by 60?
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
vlad_vy wrote: First code correction surely should work. There is something else.
...
Yes, I think it should be this (byte order ptr[0], ptr[1] swapped):
static u32 pkt32_to_coord(u16 *ptr)
{
// (decimal, format DD MM.MMMM)
return bcd_to_int(ptr[0] >> 8) * 3600000
+ bcd_to_int(ptr[0] & 0x00ff) * 60000
+ bcd_to_int(ptr[1]) * 6;
}
I have made this change and replaced the test build with new version.
Please Log in or Create an account to join the conversation.
- Home
- Forum
- Development
- Protocol Development
- DSM Telemetry support