Support for walkera telemetry.

More
26 Mar 2015 07:47 #30284 by vlad_vy
Replied by vlad_vy on topic Support for walkera telemetry.
Interfacing Cypress CYRF6936 to AVR microcontrollers

sites.google.com/site/mrdunk/interfacing...avr-microcontrollers

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

More
26 Mar 2015 10:59 - 26 Mar 2015 11:12 #30290 by Indigo
Replied by Indigo on topic Support for walkera telemetry.
After much experimenting the following code works the best:
//Read telemetry if needed and parse if good
u8 rx_state = CYRF_ReadRegister(CYRF_07_RX_IRQ_STATUS);
if ((rx_state & 0x21) == 0x20 && !(CYRF_ReadRegister(CYRF_05_RX_CTRL) & 0x80)) {
    //Receive buffer full with no receive errors and not currently receiving
    CYRF_ReadDataPacket16(pktTelem);
    if ((rx_state & 0x02) && !(CYRF_ReadRegister(CYRF_07_RX_IRQ_STATUS) & 0x01)) {
        //Receive complete and (2nd check) no receive error
        parse_telemetry_packet();
    }
    CYRF_WriteRegister(CYRF_05_RX_CTRL, 0x87); //Prepare to receive
}

The important new check is this:
&& !(CYRF_ReadRegister(CYRF_05_RX_CTRL) & 0x80)

This added check was found to improve range and shorten rebind time.

Why is it needed?
Even when receive buffer is full, it will be overwritten whenever next telemetry packet arrives. So first we check that data isn't currently arriving (so we don't interrupt it) before we lock receive buffer for reading by disabling overwrite:

void CYRF_ReadDataPacket(u8 dpbuffer[])
{
. . // need to set RXOW before data read.
. . CYRF_WriteRegister(CYRF_07_RX_IRQ_STATUS, 0x80);
. . ReadRegisterMulti(CYRF_21_RX_BUFFER, dpbuffer, 0x10);
}

If receive buffer is full and not currently receiving, but last receive is incomplete; we read it anyway to reset pointer to start of buffer. That is why:

(rx_state & 0x02) // Receive complete

is not checked until after reading the buffer.

If all good we parse the telemetry packet for processing.

Finally we remove our overwrite lock with:
CYRF_WriteRegister(CYRF_05_RX_CTRL, 0x87); //Prepare to receive


You can download test build 72057cf here:
bitbucket.org/Indigo1/deviation/downloads


Source code is here
Last edit: 26 Mar 2015 11:12 by Indigo.

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

More
26 Mar 2015 19:18 #30303 by linux-user
Replied by linux-user on topic Support for walkera telemetry.
Hi, just got loss of connection executing this Test :(
Version deviation-devo10-v4.0.1-72057cf.zip from Indigo

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

More
26 Mar 2015 20:36 #30308 by Indigo
Replied by Indigo on topic Support for walkera telemetry.
Ok, Devo loss of connection with Telemetry ON problem still exists. :S

If there is a known past version where this problem didn't exist, that would help.

My chances of fixing this without a Devo model to test with myself are slim. If someone could lend me a Devo model even a damaged one that still binds would do the job, it wouldn't need to have telemetry support.

Or, another developer that can test Devo is going to have to take on this task. Anyone?

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

More
26 Mar 2015 20:56 #30309 by PhracturedBlue
Replied by PhracturedBlue on topic Support for walkera telemetry.
I don't think there is any version that works reliably. But I wasn't able to duplicate this issue on my Devo hardware after 24 hours. I think it is likely to cost more to ship you one of my modules than it would cost to just buy one. Do you actually need one with Telemetry support (it has been a while, and I don't recall if the problem is only on models with Telemetry or if just turning it on is sufficient)? I don't think Walker sells an Rx with telemetry support, and their GPS module is quite expensive. If you don't need telemetry, I'd be happy to buy you a RX601 if your funds are tight. This problem has been around for a longtime and $20 to have someone figure it out is more than worth it.

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

More
27 Mar 2015 01:42 #30311 by djtrance
Replied by djtrance on topic Support for walkera telemetry.
PB, walkera has the RX705, this RX has telemetry port that can be use it into the x350 pro. I'm not sure, but I think that the rx has some similar protocol like mavlink.

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

More
27 Mar 2015 03:07 #30314 by cmpang
Replied by cmpang on topic Support for walkera telemetry.

Indigo wrote: Ok, Devo loss of connection with Telemetry ON problem still exists. :S

...


It is not the problem of dropping in level, it is the RF locked up..

My speculation would be under Telemetry, the RF module would be switching between Tx and Rx mode so as to collect remote data. However, once in a very very rare while, the switching has been locked up into receiving mode indefinitely causing NO power output for usual radio control..

Not sure if it is really the case but for the moment, turn Telemetry OFF for a safe flight ...

cmPang

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

More
27 Mar 2015 07:23 - 27 Mar 2015 12:24 #30318 by linux-user
Replied by linux-user on topic Support for walkera telemetry.

cmpang wrote: My speculation would be under Telemetry, the RF module would be switching between Tx and Rx mode so as to collect remote data. However, once in a very very rare while, the switching has been locked up into receiving mode indefinitely causing NO power output for usual radio control..

cmpang's speculation may be true.
A Spectrum-analyser (e.g. Wi-Spy, RF Explorer) would tell.

During testing I had at least one incident with GeniusCP-V1 (not telemetry capable), so it is likely sufficient to just turn telemetry on.

Problem: it may take many hours to show the issue.
Question: Why does DSMX not seem to be affected?

@PB did you try this test ?

Edit:
Would it be possible, to write some debugging code?
This code could try to capture the state of the CYRF6936 at the time the issue is present.
Maybe write all sorts of registers to a file when TX is powered off.
Last edit: 27 Mar 2015 12:24 by linux-user.

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

More
27 Mar 2015 14:00 #30327 by vlad_vy
Replied by vlad_vy on topic Support for walkera telemetry.

Indigo wrote: Finally we remove our overwrite lock with:
CYRF_WriteRegister(CYRF_05_RX_CTRL, 0x87); //Prepare to receive


Why we need this last step if then we immediately switch to TX Mode?

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

More
28 Mar 2015 04:24 #30344 by PhracturedBlue
Replied by PhracturedBlue on topic Support for walkera telemetry.
I'll run a test to see if I can replicate the failure with my Ladybird.

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

More
28 Mar 2015 06:03 #30345 by Indigo
Replied by Indigo on topic Support for walkera telemetry.

vlad_vy wrote:

Indigo wrote: Finally we remove our overwrite lock with:
CYRF_WriteRegister(CYRF_05_RX_CTRL, 0x87); //Prepare to receive


Why we need this last step if then we immediately switch to TX Mode?


I believe it prepares the receive buffer ready for next switch to RX mode.

I've tried removing each test and changing the order. What you see is the minimum required to make it work.

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

More
28 Mar 2015 06:13 - 28 Mar 2015 06:25 #30347 by vlad_vy
Replied by vlad_vy on topic Support for walkera telemetry.
At the start of RX mode we have the same code.

CYRF_SetTxRxMode(RX_EN); //Receive mode
CYRF_WriteRegister(CYRF_05_RX_CTRL, 0x80); //Prepare to receive (do not enable any IRQ)

Also, I don't think it is good practice to change TX or RX mode in time RXGO or TXGO bit is active.
Last edit: 28 Mar 2015 06:25 by vlad_vy.

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

More
28 Mar 2015 06:27 - 28 Mar 2015 06:37 #30348 by Indigo
Replied by Indigo on topic Support for walkera telemetry.
Ok, thanks. :)

I was doing my testing on DSMx where it was originally after READ_B, but where Devo has it looks better so I'll try changing it.

EDIT: I see, DSMx has it before READ_B as well as when switching to RX mode.
Last edit: 28 Mar 2015 06:37 by Indigo.

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

More
28 Mar 2015 14:35 #30369 by PhracturedBlue
Replied by PhracturedBlue on topic Support for walkera telemetry.
It's been 10hrs and I haven't seen the issue yet. @linux-user, do you run with your Tx hooked up to a bench power supply? I was wondering whether supply droop may have an impact since I've never been able to reproduce this (and have always used a bench supply). I'll let it sit, but I've gone several days in the past without any loss of connection.

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

More
28 Mar 2015 15:42 - 28 Mar 2015 15:44 #30373 by linux-user
Replied by linux-user on topic Support for walkera telemetry.

PhracturedBlue wrote: @linux-user, do you run with your Tx hooked up to a bench power supply?

Well, I am using a (cheap) 12V power supply which came with a USB-harddisk. This is plugged into the charge-port of my Devo10. TX itself is equipped with 8 AA eneloops.
The very same TX configuration does not show any connection losses with telemetry switched OFF or with DSMX.

Version deviation-devo10-v4.0.1-c810bb4.zip from Indigo has been runnnig flawlessly for 5h. Checked again after 8h and connection was lost :( executing this Test with MiniCP.
TX power was set to 3mW
Last edit: 28 Mar 2015 15:44 by linux-user.

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

More
28 Mar 2015 16:19 #30374 by PhracturedBlue
Replied by PhracturedBlue on topic Support for walkera telemetry.
Yep, well, I'm still stuck unable to reproduce. I like your idea to capture the CYRF state on power-down. I'll build a test-build for that.

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

More
28 Mar 2015 18:01 - 28 Mar 2015 18:02 #30377 by PhracturedBlue
Replied by PhracturedBlue on topic Support for walkera telemetry.
Well, let's see if this sheds any light.
Use this build: www.deviationtx.com/downloads-new/catego...edblue-cyrf-reg-dump

It is the same as Indigo's c810bb4 but with a hack to dump the CYRF reisters on powerdown.
after installing, go to usb mode and put at least 1 byte into errors.txt (it must NOT be 0 sized)
now when you power down (if using the Devo protocol) it will dump all registers into errors.txt.
Please verify it works before waiting for a disconnect

Also, don't use this for anything other than Devo testing.
Last edit: 28 Mar 2015 18:02 by PhracturedBlue.

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

More
28 Mar 2015 19:19 #30384 by linux-user
Replied by linux-user on topic Support for walkera telemetry.
Huh, got disconnect much sooner than expected.
I'll give it another try.
Attachments:

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

More
28 Mar 2015 20:59 #30385 by PhracturedBlue
Replied by PhracturedBlue on topic Support for walkera telemetry.
can you grab a reference copy when the model is bound so we can see what 'good' looks like on your Tx. Probably the same as mine, but it'd be useful to see.

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

More
29 Mar 2015 07:32 - 30 Mar 2015 10:10 #30392 by linux-user
Replied by linux-user on topic Support for walkera telemetry.

PhracturedBlue wrote: can you grab a reference copy when the model is bound

My second attempt ran flawlessly over night.
So here it is!

Q: In the case RX won't reconnect, would it make any difference if RX is powered on or powered off the time grabbing the error.txt?

I am asking, because I don't remember which was the case in the first attempt.
Attachments:
Last edit: 30 Mar 2015 10:10 by linux-user. Reason: added sample while connection lost

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

Time to create page: 0.097 seconds
Powered by Kunena Forum