- Posts: 5
M9912 protocol
- stawel
- Topic Author
- Offline
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.
- goebish
- Offline
- I Void Warranties
- Posts: 2631
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
Please Log in or Create an account to join the conversation.
- goebish
- Offline
- I Void Warranties
- Posts: 2631
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
bitbucket.org/goebish/deviationtx/commit...cdce401bc?at=default
Please Log in or Create an account to join the conversation.
- stawel
- Topic Author
- Offline
- Posts: 5
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
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.
- goebish
- Offline
- I Void Warranties
- Posts: 2631
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.
- goebish
- Offline
- I Void Warranties
- Posts: 2631
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
Please Log in or Create an account to join the conversation.
- stawel
- Topic Author
- Offline
- Posts: 5
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.
- goebish
- Offline
- I Void Warranties
- Posts: 2631
Please Log in or Create an account to join the conversation.
- goebish
- Offline
- I Void Warranties
- Posts: 2631
( just tried with packet[7] = random() & 0xff )
Please Log in or Create an account to join the conversation.
- stawel
- Topic Author
- Offline
- Posts: 5
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.
- stawel
- Topic Author
- Offline
- Posts: 5
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.
- goebish
- Offline
- I Void Warranties
- Posts: 2631
Please Log in or Create an account to join the conversation.
- Home
- Forum
- Development
- Protocol Development
- M9912 protocol