- Posts: 24
UDI R/C U816 / U818 Protocol
- kr0sh1
- Offline
My key reason for mapping the protocol is I'm building a collective robotics platform that utilises machine vision as part of a 'payload', almost like an automated swarm of sensors. I'm trying to prove that drones can band together and intercommunicate to save power and navigate more efficiently.
I've already invested in three UDI U818As as part of my project, and it was my grave assumption that they had a similar/symmetrical protocol to this example , as it's based on the BK2421 and I started out connecting the TXs transmitter directly to my microcontroller via the SPI pins to eliminate possible hardware incompatibilities.
I'll post up my analysis of the sniff when I have something that differentiates from (toschi's?) work.
Please Log in or Create an account to join the conversation.
- kr0sh1
- Offline
- Posts: 24
I'm using an Arduino Pro Mini, although purely for compatibility's sake - I'd normally use a Teensy ARM M4 - with the original BK2421 transceiver wired to the SPI pins,
I do have several nRF24L01 lying around however, and I did try one out earlier with a test sketch that printed a "BAD PREAMBLE" to the serial console, although it did say it detected a carrier, think I have a picture somewhere....
Please Log in or Create an account to join the conversation.
- kr0sh1
- Offline
- Posts: 24
Because of that, I wasn't able to capture the exact moment the drone binds, only the moment before and after. I'll check Dangerous Prototypes for a workaround.
Please Log in or Create an account to join the conversation.
- PhracturedBlue
- Offline
- Posts: 4402
Please Log in or Create an account to join the conversation.
- kr0sh1
- Offline
- Posts: 24
I've annotated my initial findings of the TX in it's paired state and found two specifics:
1.) The TX transmits an ID packet, every 12th cycle, with a different header/start value
2.) Every 14th cycle the ID packet has another unique packet beforehand with different values enclosed
Were either of these things previously noted? I can't see any real pattern to the rest of the data packets however, their start packets almost seem to be randomly rotating between beginning with 0xE1, 0x25 and 0x27.
I'm not sure which of these things are significant, and which don't help but I'll keep running with it until I notice something big.
I've tried posting this three times and it's failed each time when I try to attach anything, is there an attachment limit on the forum? I keep getting booted back to the main page.
Please Log in or Create an account to join the conversation.
- kr0sh1
- Offline
- Posts: 24
Please Log in or Create an account to join the conversation.
- PhracturedBlue
- Offline
- Posts: 4402
Have you actually separated the packets based on the SCN pin? It is very useful to group packets based on the scn pin to see what is part of what. Otherwise it is hard to tell cmd from data.
Looking at your data, I don't see anything complex going on during transmission:
check and reset status register (Reg07)
Clear the Tx register and reload it with new data CmdE1, CmdA0
change the rf channel every 3 packets Reg05
Please Log in or Create an account to join the conversation.
- victzh
- Offline
- Posts: 1386
Beken connected to Arduino will do. I have a TX implemented like this, you probably need to replace the code reading the stick positions with communication with PC.
I never dealt with OLS traces though I have one. I prefer Saleae. Some people here already traced this heli before, I'll try to look at their traces and compare with yours.
Please Log in or Create an account to join the conversation.
- kr0sh1
- Offline
- Posts: 24
Thanks victzh, I've got some code from the earlier parts of this post I might try and adapt but it's a little complex for me - my background is mainly in C and not C++ with classes etc,
I'm going to give all this until the middle of tomorrow and if I can't turn it around I'll need to ask you guys for advice on an already supported, solid, drone model possibly on a different thread.
Now I've got the traces and all the data, but it's mainly in .ols format. I know it's a big ask, but if you guys could download Logic Sniffer OLS , it would allow you to see the entire trace, zoom in and out, and run SPI analysis with full control, and otherwise do what you couldn't with a text file. It's a Java app so completely self-contained and very small and safe. Once you've opened one of the ols files, just go to Tools > SPI Analyser and the application will do the rest for you.
Please Log in or Create an account to join the conversation.
- PhracturedBlue
- Offline
- Posts: 4402
Please Log in or Create an account to join the conversation.
- kr0sh1
- Offline
- Posts: 24
So I'll continue with my hardware design, and leave the TX as an empty slot, then check back in when I have some proper data for you.
Please Log in or Create an account to join the conversation.
- PhracturedBlue
- Offline
- Posts: 4402
Please Log in or Create an account to join the conversation.
- kr0sh1
- Offline
- Posts: 24
I'll start another thread or PM you about which drone you'd suggest for the project in terms of existing support. I'm still going to post my findings next week, however.
Please Log in or Create an account to join the conversation.
- victzh
- Offline
- Posts: 1386
Good for a prototype, not so good for a product.
Please Log in or Create an account to join the conversation.
- kr0sh1
- Offline
- Posts: 24
General UDI support in Deviation looks to be quite weak, I'm guessing the lack of a unified protocol is the cause.
Hubsan seem to be a solid make, but I'll leave those thoughts for the other thread.
Please Log in or Create an account to join the conversation.
- kr0sh1
- Offline
- Posts: 24
Saleae is a much better program! I can see why people use it - twinned with a better logic analyser I've got traces for days
Please Log in or Create an account to join the conversation.
- PhracturedBlue
- Offline
- Posts: 4402
0.004146 > CONFIG 20 40 4b 01 e2 => 00
0.004743 > EN_AA 21 c0 4b 00 00 => 00
0.005327 > EN_RXADDR 22 d0 fc 8c 02 => 00
0.005924 > SETUP_AW 23 99 00 39 21 => 00
0.006521 > SETUP_RETR 24 f9 96 82 1b => 00
0.007104 > RF_CH 25 24 06 7f a6 => 00
0.007701 > RX_ADDR_P2 2c 00 12 73 00 => 00
0.008285 > RX_ADDR_P3 2d 46 b4 80 00 => 00
0.008882 > RX_ADDR_P4 2e 41 10 04 82 20 08 08 f2 7d ef ff => 00
0.010291 > SETUP_RETR 24 ff 96 82 1b => 00
0.010888 > SETUP_RETR 24 f9 96 82 1b => 00
Please Log in or Create an account to join the conversation.
- kr0sh1
- Offline
- Posts: 24
Also, for future reference, which is more helpful; the CSV file exports or the data and settings saves for Saleae? Or something else?
Please Log in or Create an account to join the conversation.
- PhracturedBlue
- Offline
- Posts: 4402
Please Log in or Create an account to join the conversation.
- victzh
- Offline
- Posts: 1386
May be I am missing something, but if you could upload some code into your Arduino connected to nRF24L01 or Beken we can check U818a binding.
Can you connect it as follows:
CE - Arduino pin 9
CSN - pin 10
MOSI - pin 11
MISO - pin 12
SCK - pin 13
I'll finish up Arduino code tomorrow, it's 4am here and I'm a bit sleepy
Please Log in or Create an account to join the conversation.
- Home
- Forum
- Development
- Protocol Development
- UDI R/C U816 / U818 Protocol