- Posts: 2631
Flysky AFHDS 2A, protocol as used i10, i6, iT4,
- goebish
- Offline
- I Void Warranties
Please Log in or Create an account to join the conversation.
- dc59
- Offline
- Posts: 799
Thanks for rapid reply,I got it.
Please Log in or Create an account to join the conversation.
- dc59
- Offline
- Posts: 799
Here is my captures from FS-I6 (receiver is FS-IA6B) ,I upgraded a hacked FW to 10 channels; All captured data should have RX voltage telemetry data from 5.02v to 4.96v.
please take a look at these data.
www.mediafire.com/download/gaug8fiu6w2sc6s/FS-I6-SPI-01-03.zip
www.mediafire.com/download/8n5oqlgw6886exh/FS-I6-SPI-04-06.zip
I need some time to study telemetry data capture.
Thanks!
Please Log in or Create an account to join the conversation.
- goebish
- Offline
- I Void Warranties
- Posts: 2631
Please retry with higher sample rate and/or shorter wires.
Please Log in or Create an account to join the conversation.
- stinkydiver73
- Offline
- Posts: 15
Please Log in or Create an account to join the conversation.
- dc59
- Offline
- Posts: 799
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
en.wikipedia.org/wiki/Nyquist%E2%80%93Shannon_sampling_theorem
Please Log in or Create an account to join the conversation.
- dc59
- Offline
- Posts: 799
Thanks!
@Goebish
OK, I'll try 24MHz the max sample rate of my analyzer later.
Please Log in or Create an account to join the conversation.
- dc59
- Offline
- Posts: 799
New capture @ 24MHz
www.mediafire.com/download/d278999grddtcf3/FS-I6-SPI-01-03.zip
www.mediafire.com/download/m8b3k595f9x7136/FS-I6-SPI-04-06.zip
Please Log in or Create an account to join the conversation.
- goebish
- Offline
- I Void Warranties
- Posts: 2631
As I said I do not have much time to look at that for now, but that will help, for sure
Please Log in or Create an account to join the conversation.
- dc59
- Offline
- Posts: 799
Thanks !
Please Log in or Create an account to join the conversation.
- goebish
- Offline
- I Void Warranties
- Posts: 2631
gist.github.com/goebish/e6a486a87fba5a233c56
It doesn't look very complex, I think the hardest part will be to figure out the channel hopping sequence for arbitrary txid/rxid (as usual ).
edit: I think I figured it already, channels list is sent with bind packets, seems it has nothing to do with txid/rxid (well, hopefully, or I don't see the point to send them along, also I've looked at a ROM / EEPROM dump and I can see the channel list is stored there, next to txid, so there's a good chance it is semi random, not computed from txid, but I need to make tests with an actual RX to confirm that... but perhaps I'm wrong and it relies on a tx_channels table as older AFHDS , oh well, worst case I'll have to fire up the jtag probe, openocd and IDA and trace the sequence generation, this is a good opportunity to learn new tricks ...).
this is a bind packet:
150 W_REGISTER(05_FIFO_DATA) BB 44 2A 37 77 FF FF FF FF 01 00 2B 62 1D 50 0F 41 3C 92 71 6C 32 79 58 7F 86 8B FF FF FF FF FF FF FF FF FF FF 00
and channels hopping sequence for data packets is:
2B 62 1D 50 0F 41 3C 92 71 6C 32 79 58 7F 86 8B
TXID is 44 2A 37 77, the 4 following FF are RXID, which is received from the RX later.
(from the 3 differents captures I've seen, txid 3rd byte is 36 or 37, and 4th byte is always 77)
Looks like data packets don't have a checksum or CRC, just
packet type ? (0x58) | txid | rxid | channels data (1000-2000, 16 bit, little endian) | 00
Telemetry packets should be easy to figure out as well:
5223 R_REGISTER(05_FIFO_DATA) AA 44 2A 37 77 25 31 91 41 00 00 F3 01 FE 00 00 00 FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF
0x01F3 = 499, seems this is your RX voltage (4.99V)
Please Log in or Create an account to join the conversation.
- SeByDocKy
- Offline
- Posts: 1016
Please Log in or Create an account to join the conversation.
- midelic
- Offline
- Posts: 174
I published long time ago Flysky protocol sources for TX and RX.
From what I see it is not much change except telemetry added.I6 and I10 bind with normal Flysky Rx.So it should rely on the same channels table.I think it will be easy to add to main Flysky protocol in deviation.
If you are interested see here for your info.
www.rcgroups.com/forums/showthread.php?t=1921870
Please Log in or Create an account to join the conversation.
- goebish
- Offline
- I Void Warranties
- Posts: 2631
Also, bind is bi-directional, RX sends its ID.
Please Log in or Create an account to join the conversation.
- midelic
- Offline
- Posts: 174
If old RX uses table you can use the same.
The algo was
//random id
chanrow=id%16;
chanoffset=(id & 0xff) / 16;
channel=tx_channels[chanrow][chancol]-chanoffset;//It was minus chanoffset,..... not plus
chancol = (chancol + 1) % 16;
The rx listen on channel-1
Please Log in or Create an account to join the conversation.
- goebish
- Offline
- I Void Warranties
- Posts: 2631
5a 89 36 77 1d 33 16 0f 64 24 7a 84 59 92 68 45 6e 29 60 51
44 2a 37 77 2b 62 1d 50 0f 41 3c 92 71 6c 32 79 58 7f 86 8b
73 60 36 77 26 1d 78 83 6e 5d 48 4e 74 3f 22 68 8d 7f 96 59 (not sure 26 is really the start of the sequence for this one).
Take the first one:
0x5a893677 % 16 = 7 (8th line of the table)
0x77 / 16 = 7
first value of line 8th line in the table is 0x64
0x64 - 7 != 0x1d
Also, last byte of txid seems to always be 0x77, so channel offset would always be 7, which is unlikely.
Note that I only had a quick look, maybe I got something wrong
Please Log in or Create an account to join the conversation.
- stinkydiver73
- Offline
- Posts: 15
Please Log in or Create an account to join the conversation.
- midelic
- Offline
- Posts: 174
id=0x7736895A
Please Log in or Create an account to join the conversation.
- Home
- Forum
- Development
- Protocol Development
- Flysky AFHDS 2A, protocol as used i10, i6, iT4,