Protocol Stacks

More
06 Aug 2012 17:25 #924 by PhracturedBlue
Replied by PhracturedBlue on topic Protocol Stacks

wuselfuzz wrote:

PhracturedBlue wrote: I'm not sure about an RNG (seems wasteful to include a prng just for this one function), but I thought the crc of the model file would make a good id when none is specified.


newlib should supply rand(). Needs a seed, though, or it's not random at all (see xkcd).

A good seed would be RSSI values from the CYRF. B)

yes, but why include rand() for just one call? if I'm going to provide a seed, why not just use it directly as the Random number. Randomness is only necessary between transmitters, not between startups.

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

More
06 Aug 2012 17:26 #925 by FDR
Replied by FDR on topic Protocol Stacks

wuselfuzz wrote: I got the rx binding without the fixed_id string.

Well, I have tryed with embty value, i.e: "fixed_id=", and without the whole fixed id row, and neither did work for me.
Furthermore last time I set it to 123456, and that combination didn't work either!
Reset to 680913, and that's fine...

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

More
06 Aug 2012 17:39 #928 by wuselfuzz
Replied by wuselfuzz on topic Protocol Stacks

FDR wrote: Well, I have tryed with embty value, i.e: "fixed_id=", and without the whole fixed id row, and neither did work for me.


Dang, I left my 2402 on. ><

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

More
06 Aug 2012 17:40 #930 by PhracturedBlue
Replied by PhracturedBlue on topic Protocol Stacks

FDR wrote:

wuselfuzz wrote: I got the rx binding without the fixed_id string.

Well, I have tryed with embty value, i.e: "fixed_id=", and without the whole fixed id row, and neither did work for me.
Furthermore last time I set it to 123456, and that combination didn't work either!
Reset to 680913, and that's fine...

ahh..that is very good to know. it explains why my 'random' id didn't work
Can you try these values?
1048575
524288
524287
262144
262143
131072
131071
That will tell me if it is dependent on the MSB being set in the MSB byte

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

More
06 Aug 2012 17:44 #931 by wuselfuzz
Replied by wuselfuzz on topic Protocol Stacks
Ok, figured this out, for the RX2435:

fast blinking: bind phase
steady LED: rx bound, but tx still sends bind packets
1hz blinking: rx bound and ready.

I still don't see any reaction of the servo, though. Goes to center position on ELE and AIL, no matter which stick(s) I move.

THR and RUD are special, due to the integrated gyro and low voltage cutoff (the "NOT USED" header is actually used, the lipo 2S voltage is fed in there through the signal pin on a UFLY).

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

More
06 Aug 2012 17:46 #932 by FDR
Replied by FDR on topic Protocol Stacks

wuselfuzz wrote: Dang, I left my 2402 on. ><

:lol:
I did the same yesterday...

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

More
06 Aug 2012 17:49 - 06 Aug 2012 17:56 #933 by wuselfuzz
Replied by wuselfuzz on topic Protocol Stacks
odd values bind, even values do not bind.

/edit: not that easy. 1048574 does bind, too.
Last edit: 06 Aug 2012 17:56 by wuselfuzz.

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

More
06 Aug 2012 17:58 - 06 Aug 2012 18:00 #934 by wuselfuzz
Replied by wuselfuzz on topic Protocol Stacks
Hmm.

Couldn't we use the devo8 as an rx to dump the transmitted packets of other transmitters?
Last edit: 06 Aug 2012 18:00 by wuselfuzz.

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

More
06 Aug 2012 18:03 #935 by PhracturedBlue
Replied by PhracturedBlue on topic Protocol Stacks

wuselfuzz wrote: Hmm.

Couldn't we use a devo8 as an rx to dump the transmitted packets of other transmitters?

sure, but I don't think the UART can keep up. Using my salea is easier :)
But basicaly, just run the relevant init code, put the module in receive mode, and run a loop waiting for 16 byte packets.

you should be able to hack up the existing protocol code in short order to do that.

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

More
06 Aug 2012 18:04 #936 by FDR
Replied by FDR on topic Protocol Stacks

PhracturedBlue wrote: ahh..that is very good to know. it explains why my 'random' id didn't work
Can you try these values?
1048575: OK
524288: doesn't bind
524287: OK
262144: doesn't bind
262143: OK
131072: doesn't bind
131071: OK
That will tell me if it is dependent on the MSB being set in the MSB byte

Yep, you were right...

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

More
06 Aug 2012 18:17 - 06 Aug 2012 18:18 #937 by PhracturedBlue
Replied by PhracturedBlue on topic Protocol Stacks

FDR wrote:

PhracturedBlue wrote: ahh..that is very good to know. it explains why my 'random' id didn't work
Can you try these values?
1048575: OK
524288: doesn't bind
524287: OK
262144: doesn't bind
262143: OK
131072: doesn't bind
131071: OK
That will tell me if it is dependent on the MSB being set in the MSB byte

Yep, you were right...

Actually, that isn't the answer I wanted to see. Now we need to do even more testing :(
Last edit: 06 Aug 2012 18:18 by PhracturedBlue.

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

More
06 Aug 2012 19:51 #943 by FDR
Replied by FDR on topic Protocol Stacks
Neither my Genius CP nor my Ladybird binds with the appropriate fixed id set by the original fw... (680913, 680914)

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

More
06 Aug 2012 20:06 #944 by PhracturedBlue
Replied by PhracturedBlue on topic Protocol Stacks

FDR wrote: Neither my Genius CP nor my Ladybird binds with the appropriate fixed id set by the original fw... (680913, 680914)

That isn't surprising. the fixed-id stuff is not fully implemented for Devo. I currently have a hard-coded ID in devo.c

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

More
07 Aug 2012 21:19 #959 by wuselfuzz
Replied by wuselfuzz on topic Protocol Stacks
With 2801, servos only go from 1500us to ~1900us while the tx shows -100% to 100%.

Hooking up the rx 2435 to the logic analyzer now.

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

More
07 Aug 2012 22:13 #960 by PhracturedBlue
Replied by PhracturedBlue on topic Protocol Stacks

wuselfuzz wrote: With 2801, servos only go from 1500us to ~1900us while the tx shows -100% to 100%.

Hooking up the rx 2435 to the logic analyzer now.

what is a 'us' in this context? is that the pwm period sent to the servo? I don't normally think of servo movement in terms of time.

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

More
07 Aug 2012 22:15 - 07 Aug 2012 22:23 #961 by wuselfuzz
Replied by wuselfuzz on topic Protocol Stacks
Microseconds, pwm duty cycle.

1500us is center position.

/edit: It might be a good idea to plug some of your logic probe inputs to the servo outputs of the rx to get an actual number instead of "well, the servo moved to about 90% deflection from center".

1 degree servo deflection is about 100us PWM difference.

I once implemented a 24 channel servo controller on this guy:


;)
Last edit: 07 Aug 2012 22:23 by wuselfuzz.

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

More
07 Aug 2012 23:26 #962 by wuselfuzz
Replied by wuselfuzz on topic Protocol Stacks
Got my OLS up and running now, with RLE, I can snap 50ms of SPI communications. The OLS Protocol Analyzer is neat.

However, need sleep now.

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

More
08 Aug 2012 04:37 #964 by FDR
Replied by FDR on topic Protocol Stacks

wuselfuzz wrote: It might be a good idea to plug some of your logic probe inputs to the servo outputs of the rx to get an actual number instead of "well, the servo moved to about 90% deflection from center".

Yeah, but even better would be to analize what is the maximum value the protocol sends, then we could simply scale our output zo do the same...

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

More
09 Aug 2012 07:45 - 09 Aug 2012 20:52 #999 by wuselfuzz
Replied by wuselfuzz on topic Protocol Stacks
Here's a bunch of bind packets from a tx2402 to an rx2435:
... removed to avoid confusion: MSB first/LSB first mixup...

Looking further into it. Just created my dump parser and all.

Each line is an individual packet, retrieved by SPI Command 132. Didn't strip the 0xFF on MISO that's received when transmitting the command byte.

/edit: removed the zeroes, empty MISO string from the dump was interpreted as a zero by perl.

Those four packets were repeated over and over.

In comparision to wk2x01.txt, Bytes 10 and 11 seem to be constant during a single bind and change after rebinding. The txt says, byte 12 has a counter in the lower nibble and TxID3 in the upper nibble.

I only observed 0x4 in the lower nibble and the sequence 0x0, 0x8, 0x4, 0xc, 0x2, 0xa, 0x6, 0xe, 0x1, 0x9, 0x5, 0xd in the upper nibble.

/edit again:

Data packet, throttle at zero. I'm not sure if this corresponds to "Bind 1", did some quick dumping right before work today. ;)
...

Same bind, throttle at max:
...

/edit: I checked my raw logs again. All four packets, a channel switch is issued to the CYRF. Byte 13 in the received packet always corresponds to the channel the packet is received on.
Last edit: 09 Aug 2012 20:52 by wuselfuzz.

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

More
09 Aug 2012 12:35 #1001 by PhracturedBlue
Replied by PhracturedBlue on topic Protocol Stacks

wuselfuzz wrote: Here's a bunch of bind packets from a tx2402 to an rx2435:

Interesting, but I think I'd rather emulate the 2401 protocol from a 2801 (in 2401 mode), which is what I currently have. It looks different from the logs renatopub gave me, and more closely matches the 2601 and 2801 which makes it easier to share code.

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

Time to create page: 0.086 seconds
Powered by Kunena Forum