- Posts: 4402
Protocol Stacks
- PhracturedBlue
- Offline
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.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.
Please Log in or Create an account to join the conversation.
- FDR
- Offline
Well, I have tryed with embty value, i.e: "fixed_id=", and without the whole fixed id row, and neither did work for me.wuselfuzz wrote: I got the rx binding without the fixed_id string.
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.
- wuselfuzz
- Offline
- Posts: 83
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.
- PhracturedBlue
- Offline
- Posts: 4402
ahh..that is very good to know. it explains why my 'random' id didn't workFDR 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.wuselfuzz wrote: I got the rx binding without the fixed_id string.
Furthermore last time I set it to 123456, and that combination didn't work either!
Reset to 680913, and that's fine...
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.
- wuselfuzz
- Offline
- Posts: 83
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.
- FDR
- Offline
wuselfuzz wrote: Dang, I left my 2402 on. ><
I did the same yesterday...
Please Log in or Create an account to join the conversation.
- wuselfuzz
- Offline
- Posts: 83
/edit: not that easy. 1048574 does bind, too.
Please Log in or Create an account to join the conversation.
- wuselfuzz
- Offline
- Posts: 83
Couldn't we use the devo8 as an rx to dump the transmitted packets of other transmitters?
Please Log in or Create an account to join the conversation.
- PhracturedBlue
- Offline
- Posts: 4402
sure, but I don't think the UART can keep up. Using my salea is easierwuselfuzz wrote: Hmm.
Couldn't we use a devo8 as an rx to dump the transmitted packets of other transmitters?
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.
- FDR
- Offline
Yep, you were right...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
Please Log in or Create an account to join the conversation.
- PhracturedBlue
- Offline
- Posts: 4402
Actually, that isn't the answer I wanted to see. Now we need to do even more testingFDR wrote:
Yep, you were right...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
Please Log in or Create an account to join the conversation.
- FDR
- Offline
Please Log in or Create an account to join the conversation.
- PhracturedBlue
- Offline
- Posts: 4402
That isn't surprising. the fixed-id stuff is not fully implemented for Devo. I currently have a hard-coded ID in devo.cFDR wrote: 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.
- wuselfuzz
- Offline
- Posts: 83
Hooking up the rx 2435 to the logic analyzer now.
Please Log in or Create an account to join the conversation.
- PhracturedBlue
- Offline
- Posts: 4402
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.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.
Please Log in or Create an account to join the conversation.
- wuselfuzz
- Offline
- Posts: 83
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:
Please Log in or Create an account to join the conversation.
- wuselfuzz
- Offline
- Posts: 83
However, need sleep now.
Please Log in or Create an account to join the conversation.
- FDR
- Offline
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...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".
Please Log in or Create an account to join the conversation.
- wuselfuzz
- Offline
- Posts: 83
... 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.
Please Log in or Create an account to join the conversation.
- PhracturedBlue
- Offline
- Posts: 4402
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.wuselfuzz wrote: Here's a bunch of bind packets from a tx2402 to an rx2435:
Please Log in or Create an account to join the conversation.
- Home
- Forum
- Development
- Development
- Protocol Stacks