Page 1 of 1

HK-T6Av2 protocol dissected

Posted: Tue Jun 24, 2014 10:06 am
by BirdShredder
This is not strictly MW related but I suspect of interest.

I was quite surprised that although there is at least one 3th party application to configure the HK-T6Av2 remote I could not found a protocol description on the net. Also I want to be able to use it in Linux without installing Mono. Therefore I spend last night sniffing and dissecting the protocol. There are a few loose ends which I intend to fix/test as soon as I have the time. Corrections welcome!

You can find it at github: https://github.com/yschaeff/HK-T6Av2

Re: HK-T6Av2 protocol dissected

Posted: Thu Jun 26, 2014 1:31 pm
by BirdShredder
I spend some extra time implementing a small tool to use this protocol. In the same github repository. I tested it on Linux. I expect the backup/restore functionality to work in Windows as well. When started without -u or -d switches it will enter the (still very limited) interactive GUI mode (which does probably not work on Windows). This is its usage:

Code: Select all

$ python hkctrl.py -h
usage: hkctrl.py [-h] [-t TTY] [-b BAUDRATE] [-u FILE | -d FILE]

HK-T6A V2 configuration tool

optional arguments:
  -h, --help            show this help message and exit
  -t TTY, --tty TTY     Serial port. Default /dev/ttyUSB0
  -b BAUDRATE, --baud BAUDRATE
                        Transmitter baudrate. Default 115200
  -u FILE, --upload FILE
                        Load config in to transmitter and exit. Make sure
                        transmitter is switched on prior to running program.
  -d FILE, --download FILE
                        Dump config from transmitter and exit. Make sure
                        transmitter is switched on prior to running program.


Obligatory screenshot of terminal
Image

Re: HK-T6Av2 protocol dissected

Posted: Sun Jun 29, 2014 11:09 pm
by BirdShredder
There you have it. You can now natively program your Hobby King remote control from Linux. Plus it is fully open sourced. "Buy it, use it, break it, fix it, Trash it, change it, mail - upgrade it"

Features: Auto trim, save/restore, context help

Re: HK-T6Av2 protocol dissected

Posted: Sun Jun 29, 2014 11:31 pm
by copterrichie
Thank you, very valuable. I have a similar T6 transmitter sitting, will give this a test.

Re: HK-T6Av2 protocol dissected

Posted: Mon Jun 30, 2014 7:26 pm
by BirdShredder
copterrichie wrote:Thank you, very valuable. I have a similar T6 transmitter sitting, will give this a test.

Great! When you do, please let me know what you think.

Re: HK-T6Av2 protocol dissected

Posted: Mon Jun 30, 2014 8:59 pm
by copterrichie
Worked perfectly after installing the python-serial. :lol:

I need to clean the Trainer port connector because would get a checksum error but that has nothing to do with your work. Excellent job.

I have an EXCEED-RC

Exceed-RC.png

Re: HK-T6Av2 protocol dissected

Posted: Mon Jun 30, 2014 9:28 pm
by BirdShredder
Thanks! I will document the python-serial dependency. That the checksum error message actually showed up in the gui is not on purpose. Also it is perfectly possible to get some errors when the program starts as it might not be in sync with the radio yet. I just removed the checksum error message.

Also I notice in your screenshot values I have never seen. Do you know what their meaning is? Most notably:

SWA, SWB, VRA values
Mix3 uprate value (should this maybe be a negative value? -20 perhaps?)

or did you at one point write random data to your radio?

Re: HK-T6Av2 protocol dissected

Posted: Mon Jun 30, 2014 9:41 pm
by copterrichie
In all honesty, I have forgotten what the SWA, SWB, VRA values are for. I will seen if I can locate some documentation.

Oh, I remember now, I am using the Switches to activate ch5 and 6

Re: HK-T6Av2 protocol dissected

Posted: Mon Jun 30, 2014 9:51 pm
by BirdShredder
copterrichie wrote:In all honesty, I have forgotten what the SWA, SWB, VRA values are for. I will seen if I can locate some documentation.

Oh, I remember now, I am using the Switches to activate ch5 and 6


Yes I can see that in your table with mix settings. So it could be that the switch functions are just never set? And just in effect are random gibberish.

Re: HK-T6Av2 protocol dissected

Posted: Mon Jun 30, 2014 9:54 pm
by copterrichie
Is it possible to do a factory reset with your program? I am not doing anything with the transmitter right now and will test it fully.

Re: HK-T6Av2 protocol dissected

Posted: Mon Jun 30, 2014 10:03 pm
by BirdShredder
Implementing that would be trivial however I have no idea how the radio is configured when it leaves the factory... I could provide a "sane configuration for multirotors" file (which would very much look like your current settings) for one to upload.