M9912 protocol

More
25 Jul 2015 15:49 #35964 by stawel
M9912 protocol was created by stawel
Hi,

I wrote a protocol for the M9912 micro quadcopter
it would be nice if you could including it into your project.

repo: github.com/stawel/opentx

essential file:
github.com/stawel/opentx/blob/m9912/radi...col/m9912_nrf24l01.c

also a important change in deviation/protocol/spi/nrf24l01.c
(I'm not sure why I had to do this change, maybe it has something to do with the "unknown" registers in the xn297 chip):
github.com/stawel/opentx/commit/8765169e...45d23301bec25843172e

I have tested this protocol only on a Turnigy 9x (don't own a devo),
but I'm pretty sure it works also on other transmitters.

Best Regards,
Paweł

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

More
25 Jul 2015 23:52 - 26 Jul 2015 00:46 #35996 by goebish
Replied by goebish on topic M9912 protocol
I think this is the same protocol than the H7 (MT9911):
www.deviationtx.com/forum/protocol-devel.../4517-eachine-gin-h7

Note that I cracked hopping sequence (rf_channel_shift) and checksum offset so we can use multiple tx id ;)
Last edit: 26 Jul 2015 00:46 by goebish.

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

More
25 Jul 2015 23:56 #35997 by goebish
Replied by goebish on topic M9912 protocol

stawel wrote: also a important change in deviation/protocol/spi/nrf24l01.c
(I'm not sure why I had to do this change, maybe it has something to do with the "unknown" registers in the xn297 chip):
github.com/stawel/opentx/commit/8765169e...45d23301bec25843172e


This has nothing to do with xn297 unknown registers, I made a typo :blush:
bitbucket.org/goebish/deviationtx/commit...cdce401bc?at=default

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

More
26 Jul 2015 11:33 #36028 by stawel
Replied by stawel on topic M9912 protocol

goebish wrote: I think this is the same protocol than the H7 (MT9911):
www.deviationtx.com/forum/protocol-devel.../4517-eachine-gin-h7


Oh man, I even had read your post, but didn't realized it's the same copter :D
nice work!

goebish wrote: Note that I cracked hopping sequence (rf_channel_shift) and checksum offset so we can use multiple tx id ;)


I would never came up how to calculate "channel_offset", I'm impressed :)

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

More
26 Jul 2015 12:04 #36029 by goebish
Replied by goebish on topic M9912 protocol
stawel, do you remember what your stock TX packet[7] sequence is ?

At first I thought it was the same for every TX (HEX):
01 11 02 12 03 13 04 14 05 15 06 16 07 17 00 10 (that's from 2x MT9911 tx captures)

But now I'm working on the MT9916 protocol, which is almost the same protocol, but with a different sequence for packet[7]:
11 21 32 42 53 63 74 84 95 A5 B6 C6 D7 E7 F0 00

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

More
26 Jul 2015 12:07 - 26 Jul 2015 12:08 #36030 by goebish
Replied by goebish on topic M9912 protocol

stawel wrote: I would never came up how to calculate "channel_offset", I'm impressed :)


That's almost impossible if you've captures from 1 TX only, but it becomes easier with 2 or more ;)
Last edit: 26 Jul 2015 12:08 by goebish.

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

More
26 Jul 2015 16:50 #36063 by stawel
Replied by stawel on topic M9912 protocol

goebish wrote: At first I thought it was the same for every TX (HEX):
01 11 02 12 03 13 04 14 05 15 06 16 07 17 00 10 (that's from 2x MT9911 tx captures)


Yes, I have exactly the same sequence on my 2x stock M9912 transmitters,
(hm.. it looks like my implementation has a bug while generating packet[7] :/ )
my guess was that this is the next hopping channel somehow encoded.

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

More
26 Jul 2015 16:52 #36064 by goebish
Replied by goebish on topic M9912 protocol
Ok thanks, I was lazy and only used a table :P

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

More
28 Jul 2015 00:17 - 28 Jul 2015 05:28 #36198 by goebish
Replied by goebish on topic M9912 protocol
I just made some more testing, looks like packet[7] has no importance actually, you can throw any arbitrary values into it without any issue as long as it is used to compute checksum ...
( just tried with packet[7] = random() & 0xff )
Last edit: 28 Jul 2015 05:28 by goebish.

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

More
29 Jul 2015 13:43 #36306 by stawel
Replied by stawel on topic M9912 protocol
hm.. I would be careful with that,
I did a test where I just disabled hopping and it also worked (with some small lags),

from my understanding the copter needs to know where it is in the hooping frequency chain when it recovers from a signal lost.
for example if the hooping freq. are: 2, 72, 12, 62, 22, 52, 32, 42, 42, 32, 52, 22, 62, 12, 72, 2
and the copter receives something on channel 32, it needs to know if the next channel is 42 or 52,
packet[7] is the only place where this information can be encoded.

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

More
30 Jul 2015 21:22 #36373 by stawel
Replied by stawel on topic M9912 protocol
finally, I've connected a logic analyzer to my M9912 copter,
if you are interested: github.com/stawel/stuff/tree/master/m9912_copter/copter

my interpretation:
it looks like the copter jumps only through frequencies (freq. shift = 7):
0x09, 0x13, 0x1d, 0x27, 0x31, 0x3b, 0x45, 0x4f, (and back to 0x09)
packet[7]:
0x01, 0x02, 0x03, 0x04, 0x05, 0x07, 0x08, 0x00
(it is only looking for transmissions where packet[7] == {00, 01, 02, 03, 04, 05, 06, 07})
so it looks like packet[7] first 4bits are the next frequency channels.
if copter receives something like:
packet[7] == 1X
it also jumps to frequency X, looks like this package is only for synchronization/restoring transmission
because it's not very often received.
.

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

More
30 Jul 2015 21:39 #36378 by goebish
Replied by goebish on topic M9912 protocol
Thanks for that !

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

Time to create page: 0.047 seconds
Powered by Kunena Forum