UDI R/C U816 / U818 Protocol

More
09 Apr 2015 19:03 #30947 by kr0sh1
Replied by kr0sh1 on topic UDI R/C U816 / U818 Protocol
Just quickly posting my raw sniff captures, debating changing drone but I'm not entirely sure how much work this is going to be.

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.
Attachments:

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

More
09 Apr 2015 19:07 - 09 Apr 2015 19:09 #30948 by kr0sh1
Replied by kr0sh1 on topic UDI R/C U816 / U818 Protocol
Hey victzh, thanks for the two-cents,

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....
Attachments:
Last edit: 09 Apr 2015 19:09 by kr0sh1.

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

More
09 Apr 2015 19:16 #30949 by kr0sh1
Replied by kr0sh1 on topic UDI R/C U816 / U818 Protocol
Would've gotten more (traces?) of the SPI exchange but I noticed something very odd - the logic sniffer was actually halting the MISO<->MOSI flow of commands and preventing the drone from pairing. Bizarre. Anyone else had that problem?

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.

More
09 Apr 2015 19:24 #30951 by PhracturedBlue
Replied by PhracturedBlue on topic UDI R/C U816 / U818 Protocol
Most folks here use the Saleae (or one of the Chinese copies). I've never had that specific issue with mine (I did find that attaching it allows my multi-module to work more reliably, making it hard to capture issues). Note that you will need to provide timing information. the raw traces can be useful for looking at the binding sequemce, and packet analysis, but for a proper protocol, timing is also important.

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

More
09 Apr 2015 20:17 #30956 by kr0sh1
Replied by kr0sh1 on topic UDI R/C U816 / U818 Protocol
I will switch to OLS LogicSniffer in a second then - that will give full timing annotations.

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.

More
09 Apr 2015 20:22 - 09 Apr 2015 20:24 #30957 by kr0sh1
Replied by kr0sh1 on topic UDI R/C U816 / U818 Protocol
Attachments, heavily compressed...
Attachments:
Last edit: 09 Apr 2015 20:24 by kr0sh1.

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

More
09 Apr 2015 21:04 - 09 Apr 2015 21:07 #30960 by PhracturedBlue
Replied by PhracturedBlue on topic UDI R/C U816 / U818 Protocol
I think maximum file size is 1MB. The forum software does not exit gracefully if you violate that.

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
Last edit: 09 Apr 2015 21:07 by PhracturedBlue.

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

More
09 Apr 2015 21:36 #30962 by victzh
Replied by victzh on topic UDI R/C U816 / U818 Protocol
I see. Unfortunately, your assumption about the protocol was wrong - it's a very popular chip and there are probably dozens of various protocols (if you count small, but sometimes incompatible variations).

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.

More
09 Apr 2015 22:43 #30963 by kr0sh1
Replied by kr0sh1 on topic UDI R/C U816 / U818 Protocol
The square brackets in my trace text file dump denote the triggering on the SCN pin, just managed to crash my machine capturing via OLS so it's taken a little while but I've got them,

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.
Attachments:

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

More
10 Apr 2015 01:25 #30965 by PhracturedBlue
Replied by PhracturedBlue on topic UDI R/C U816 / U818 Protocol
I tried to convert the ols files to a useful format, which would work fine, but your captures do not seem to have a valid csn signal. There is nothing in your log that looks like CSN. CSN should go low before clock starts, and up after clock is done. There are also just a few samples in each capture. I normally look at hundreds or thousands of samples at a time so I can see things like the hopping sequence repeat.

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

More
10 Apr 2015 08:18 #30979 by kr0sh1
Replied by kr0sh1 on topic UDI R/C U816 / U818 Protocol
I've ordered a 'proper' logic analyser, which will arrive on the 14th - I did some digging on the Bus Pirate and it has only 4k of sampling depth, making it useless for doing thousands of captures - the new one has 1GB. I'll be using Saleae for the next sniff also.

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.

More
10 Apr 2015 13:29 #30983 by PhracturedBlue
Replied by PhracturedBlue on topic UDI R/C U816 / U818 Protocol
have you considered just hacking into the Tx board and using a DAC to send data to it rather than the sticks, then forget the whole protocol analysis thing? It doesn't seem like your project has anything to do with the protocol stuff, so why not just bodge something together that'll let you focus on the machine vision side?

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

More
10 Apr 2015 14:34 #30988 by kr0sh1
Replied by kr0sh1 on topic UDI R/C U816 / U818 Protocol
That's a good question, and that's something I've done already in the past using a PWM signal and an RC filter with a Hubsan X4, but the device I'm building is a portable, drone-mounted, payload. There's quite a few occasions, at my lab, where they've hacked together base-stations using your suggestion, but I'm going for a self-contained product rather than a system as such.

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.

More
10 Apr 2015 14:45 #30989 by victzh
Replied by victzh on topic UDI R/C U816 / U818 Protocol
What drone depends on payload. The platform you chose is a bit limited in several ways - the motors are weak, they're collector type motors so the lifetime is not very good, it has gear box - potential weak point as well. It can be airborne for a very limited time - 5-7 minutes. Also, UDI changed their protocol many times - they don't bother at all and consider it not as a line of models, but just as separate plastic cheap toys.

Good for a prototype, not so good for a product.

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

More
10 Apr 2015 14:58 #30991 by kr0sh1
Replied by kr0sh1 on topic UDI R/C U816 / U818 Protocol
I've created this thread to discuss this further .

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.

More
11 Apr 2015 21:58 #31060 by kr0sh1
Replied by kr0sh1 on topic UDI R/C U816 / U818 Protocol
I've got a capture of two states of the UDI U818A TX, is that enough to keep things moving?

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 :)
Attachments:

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

More
11 Apr 2015 23:40 #31064 by PhracturedBlue
Replied by PhracturedBlue on topic UDI R/C U816 / U818 Protocol
Much better. I don't understand this though:
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
why are there multiple bytes sent per packet? I know the NRF supports setting multiplebyte registers, but I don't think most of these registers are multi byte? I am not really familiar with the NRF command set, but this just looks weird.

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

More
11 Apr 2015 23:56 #31066 by kr0sh1
Replied by kr0sh1 on topic UDI R/C U816 / U818 Protocol
Is it possible I haven't exported them correctly, or have used the wrong sample rate or SPI 'clock rate'?

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.

More
12 Apr 2015 00:08 #31067 by PhracturedBlue
Replied by PhracturedBlue on topic UDI R/C U816 / U818 Protocol
the data looks fine, it just doens't make much sense to me (again, I'm not really an expert with the NRF). you might want to capture the CE pin as well. The Saleae files are easier to deal with since you can save the spi data directly among other things.

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

More
12 Apr 2015 08:06 #31079 by victzh
Replied by victzh on topic UDI R/C U816 / U818 Protocol
I took a look at the traces and compared with SeBy's U839 and concluded that UDI U818A and U839 use the same protocol.
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.

Time to create page: 0.076 seconds
Powered by Kunena Forum