Support for walkera telemetry.

More
03 May 2015 08:01 - 03 May 2015 14:59 #32003 by linux-user
Replied by linux-user on topic Support for walkera telemetry.
indigo-deviation-devo10-v4.0.1-ee1b869 is now running for ~66h without any problems this test
- 2x 'Rst CYRF' message until now.
Given that I previously got LOC usually within ~8h this a remarkable low rate of 'Rst CYRF'
Edit:
ee1b869 has been running for ~73h
- 4x 'Rst CYRF' message

Side note:
While telemetry values are updated instantly, it takes ~8s for telemetry values to become inverted when RX is powered off.
Last edit: 03 May 2015 14:59 by linux-user.

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

More
03 May 2015 11:02 - 03 May 2015 11:03 #32004 by Indigo
Replied by Indigo on topic Support for walkera telemetry.

vlad_vy wrote: If you use it with "force" option, you can read buffer while receive is not completed, but error rise. I have bad experience with such reading.


It is okay to read while receiving, the chip is designed to do just that.

But with force it should read the buffer every time no matter what, even if no data. This will give the "force" option (used by DSMx) a consistent run time. I think you will find this results in a more reliable DSMx connection.

I've updated the code to do just that, and changed it to return packet length when data is good.

cyrf6936.c
int CYRF_ReadDataPacket(int force, u8 dpbuffer[]) // "force" if not set RXOW EN in RX_CFG
{
    int ok = 0;
    u8 rx_state = CYRF_ReadRegister(CYRF_07_RX_IRQ_STATUS);
    if (rx_state & 0x01)    // RXE=1 bad data
        ok = -1;
    else if (rx_state & 0x02)    // receive complete
        // RXC=1, RXE=0 then 2nd check is required (debouncing)
        ok = (CYRF_ReadRegister(CYRF_07_RX_IRQ_STATUS) & 0x01) ? -1 : 1;

    if (ok == 1 || force) {
        CYRF_WriteRegister(CYRF_07_RX_IRQ_STATUS, 0x80);    // set RXOW before data read
        u8 length = CYRF_ReadRegister(CYRF_09_RX_COUNT);
        ReadRegisterMulti(CYRF_21_RX_BUFFER, dpbuffer, length);
        return (ok == 1) ? length : ok ;
    }
    return ok;
}

A new test version a912b12 using the above is available in Test Builds

Please try it and see if gives a more reliable DSMx connection.
Last edit: 03 May 2015 11:03 by Indigo.

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

More
03 May 2015 18:20 - 03 May 2015 18:26 #32013 by vlad_vy
Replied by vlad_vy on topic Support for walkera telemetry.
I realized my fault. First I need lock buffer, then read number of bytes in the buffer, but not in reverse order. Tested incomplete receiving with this order and now all OK.

I don't understand how consistent run time can help with reliable DSMx connection? Protocol timing is fixed.
Last edit: 03 May 2015 18:26 by vlad_vy.

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

More
03 May 2015 20:18 - 03 May 2015 21:16 #32015 by Indigo
Replied by Indigo on topic Support for walkera telemetry.
I have made another code change . I find this one reduces frame losses and increases range.

A new test version 0098f45 with this change has been uploaded to Test Builds .

It should improve connection for both Telemetry ON and OFF, and also both Devo and DSMx.

Edit: I don't believe it. I left my DSMx model sitting 12m away and after 30 mins I have F:210 and H:2. Normally 'F' frame losses would be in the tens of thousands by now. The 2 holds was probably just me walking between tx and rx.

Edit2: (after 1 hr): F=304 H=2
I think 90% of the frame losses was caused by me getting close enough to read the screen.
First 20min was with Telemetry OFF. When I switched Telemetry On it was F=183, H=2.
Last edit: 03 May 2015 21:16 by Indigo.

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

More
03 May 2015 21:25 #32018 by Gyrfalcon
Replied by Gyrfalcon on topic Support for walkera telemetry.
I just tried test version 0098f45, unfortunately the Devo "Auto" bind function does not work. Was that to be expected?

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

More
04 May 2015 04:33 #32041 by vlad_vy
Replied by vlad_vy on topic Support for walkera telemetry.
Indigo, what power setting do you use for testing? 100uW?

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

More
04 May 2015 05:44 #32045 by Indigo
Replied by Indigo on topic Support for walkera telemetry.

Gyrfalcon wrote: I just tried test version 0098f45, unfortunately the Devo "Auto" bind function does not work. Was that to be expected?

Sorry, I'm unable to test Devo protocol, but I have recreated the build with changes to Devo protocol only which I hope will fix bind problem. Please download again and retry, thanks.

What I did was remove:
    CYRF_SetTxRxMode(TX_EN);
    CYRF_WriteRegister(CYRF_03_TX_CFG, 0x08 | Model.tx_power);

From this:
static void cyrf_set_bound_sop_code()
{
    /* crc == 0 isn't allowed, so use 1 if the math results in 0 */
    u8 crc = (cyrfmfg_id[0] + (cyrfmfg_id[1] >> 6) + cyrfmfg_id[2]);
    if(! crc)
        crc = 1;
    u8 sopidx = (0xff &((cyrfmfg_id[0] << 2) + cyrfmfg_id[1] + cyrfmfg_id[2])) % 10;
    CYRF_ConfigCRCSeed((crc << 8) + crc);
    CYRF_ConfigSOPCode(sopcodes[sopidx]);
}

vlad_vy wrote: Indigo, what power setting do you use for testing? 100uW?

Yes, 100uW.
I just tried repeating my test and I got more holds occurring this time, not just at long distance but some only 2 meters away. Frame losses were still much lower than I'd normally get. I guess there must be more RF interference now (3:30pm). My earlier test was 6-7am..

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

More
04 May 2015 06:53 #32049 by Gyrfalcon
Replied by Gyrfalcon on topic Support for walkera telemetry.
Good news, with the latest changes for test version 0098f45 - Devo12, the Devo "Auto" bind function is working again. I have only performed a small test so far, but it also rebinds after the receiver has been powered down and back up. I'll let this run over night and see how it looks tomorrow.

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

More
04 May 2015 07:31 - 04 May 2015 08:42 #32050 by linux-user
Replied by linux-user on topic Support for walkera telemetry.
Confirmed 0098f45-new auto bind working with V120d02s Devo10 (although V120d02s being not the best test platform for binding)
DSMX might be improved at 100uW - needs more testing (e.g. at full 100mW)
@Indigo
The same version-naming for different builds is confusing - at least to me :dry:
I would appreciate if you could comment your builds in some way:
e.g.
- What should we look for
- What is believed / hoped to be improved
- Where do you expect potential problems
- Which protocols are affected.
Last edit: 04 May 2015 08:42 by linux-user.

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

More
04 May 2015 08:02 - 04 May 2015 09:32 #32052 by vlad_vy
Replied by vlad_vy on topic Support for walkera telemetry.
With my latest test code I have for 100uW, 30 minutes, 9 meters (I have not more open air in my apartments) test:

AR8000+TM1000
FadesA: 128
FadesL: 140
Loss: 0
Holds: 0

Every 1-2 min someone walk between Tx and Rx. Last 10 minutes I had closed wood door between Tx and Rx.

One more 30 minutes DSMX test:

AR8000+TM1000
FadesA: 61
FadesL: 81
Loss: 1
Holds: 0
Last edit: 04 May 2015 09:32 by vlad_vy.

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

More
04 May 2015 08:25 - 07 May 2015 09:37 #32053 by vlad_vy
Replied by vlad_vy on topic Support for walkera telemetry.
The next test code. Changed DEVO and DSM protocols.

PB, can you build test version?


Changed files (printf(" Rst CYRF\n") commented out):
Last edit: 07 May 2015 09:37 by vlad_vy.

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

More
06 May 2015 16:11 - 07 May 2015 06:58 #32177 by vlad_vy
Replied by vlad_vy on topic Support for walkera telemetry.
Now I can upload to Test Builds section. Build for testing "Changes"

www.deviationtx.com/downloads-new/catego...lad-vy-devo-dsm-test

Build recently changed, but it has not any influence to result.
Last edit: 07 May 2015 06:58 by vlad_vy.

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

More
06 May 2015 16:49 #32180 by vlad_vy
Replied by vlad_vy on topic Support for walkera telemetry.
PB, can you say how long time takes telemetry parsing, at worst case? 50usec, 100usec, 200usec? Now I have only 240usec to test and parse telemetry packet, probably it can be less for other receivers. I tested all 5 my Devo receivers with telemetry and they all fit in timing 900+1260+240..

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

More
07 May 2015 06:37 #32199 by vlad_vy
Replied by vlad_vy on topic Support for walkera telemetry.
Main trunk, devo_cyrf6936.c:

static void parse_telemetry_packet()
and
parse_telemetry_packet(packet);

look different BUT it works!

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

More
07 May 2015 09:43 #32201 by linux-user
Replied by linux-user on topic Support for walkera telemetry.
Vlad's devo10_v401b46-temp16 "Changes" is now running for ~48h without any problems this test
-6x 'Rst CYRF" on my Devo10

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

More
07 May 2015 09:53 - 07 May 2015 09:54 #32202 by vlad_vy
Replied by vlad_vy on topic Support for walkera telemetry.
At any case you have higher "Rst CYRF" rate, than with Indigo build. On average every 8 hours you have one "Rst CYRF".
Last edit: 07 May 2015 09:54 by vlad_vy.

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

More
07 May 2015 10:42 - 07 May 2015 11:12 #32203 by linux-user
Replied by linux-user on topic Support for walkera telemetry.

vlad_vy wrote: At any case you have higher "Rst CYRF" rate, than with Indigo build. On average every 8 hours you have one "Rst CYRF".

Well,
indigo-deviation-devo10-v4.0.1-ee1b869 ...~73h, 4x 'Rst CYRF' =~1Rst / 18h
Vlad-devo10_v401b46-temp16 "Changes" ~48h, 6x 'Rst CYRF" =~1Rst / 8h
indigo-deviation-devo10-v4.0.1-0098f45 ....~16h, 3x 'Rst CYRF" =~1Rst / 5h (test time probably to short for statistic)
What about DSMX?
Edit:
As long as we don't understand why 'Rst CYRF' is happening and we can't avoid it completely,
I don't care if (on a few TX e.g. my Devo10) we have 1Rst / 4h or 1Rst / 18h as log as connection is maintained.
Last edit: 07 May 2015 11:12 by linux-user.

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

More
07 May 2015 14:02 - 07 May 2015 14:34 #32209 by vlad_vy
Replied by vlad_vy on topic Support for walkera telemetry.

vlad_vy wrote: With my latest test code I have for 100uW, 30 minutes, 9 meters (I have not more open air in my apartments) test:

AR8000+TM1000
FadesA: 128
FadesL: 140
Loss: 0
Holds: 0

Every 1-2 min someone walk between Tx and Rx. Last 10 minutes I had closed wood door between Tx and Rx.

One more 30 minutes DSMX test:

AR8000+TM1000
FadesA: 61
FadesL: 81
Loss: 1
Holds: 0


6 channels Rx 30 minutes DSMX test:

AR6210+TM1000
FadesA: 20
FadesL: 93
Loss:9
Holds:0

One more 30 minutes DSMX test:

AR6210+TM1000
FadesA: 18
FadesL: 50
Loss:12
Holds:0
Last edit: 07 May 2015 14:34 by vlad_vy.

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

More
08 May 2015 13:43 - 08 May 2015 13:44 #32247 by PhracturedBlue
Replied by PhracturedBlue on topic Support for walkera telemetry.
I was asked how lokng it takes to process telemetry packets in the Tx. I thought I'd post my answer here for posterity . This can be used for any micro-second accurate measurement:

1st:
#include <libopencm3/stm32/timer.h>
volatile u32 tmax = 0;
then at the top of the telemetry parser add:
u32 t1 = TIM4_CNT;

at the end add:
u32 t2 = TIM4_CNT;
u32 tdiff = t2 < t1 ? 65536 + t2 - t1 : t2 - t1;
if (tdiff > tmax)
    tmax = tdiff;

now you just need to print tmax every once in a while.
I would do it in main.c EvenetLoop():
at the top of main.c (after the includes):
extern volatile u32 tmax;

In EventLoop:
   if (priority_ready & (1 << LOW_PRIORITY)) {
        priority_ready  &= ~(1 << LOW_PRIORITY);
static int loop = 0;
if (loop++ >= 50) { //5 seconds
    printf("tmax: %d\n", tmax);
    loop = 0;
}
        PAGE_Event();

Make sure to compile with 'TYPE=dev' to enable the log screen
Last edit: 08 May 2015 13:44 by PhracturedBlue.

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

More
08 May 2015 14:19 - 08 May 2015 14:55 #32248 by vlad_vy
Replied by vlad_vy on topic Support for walkera telemetry.
parse_telemetry_packet()
Without GPS, time=12usec
With GPS, time=17usec.

Total time (for my version of code), from starting check CYRF_07_RX_IRQ_STATUS register to exit from cb() ("return delay") = 155usec.
Last edit: 08 May 2015 14:55 by vlad_vy.

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

Time to create page: 0.102 seconds
Powered by Kunena Forum