Crtp TOC-Access
Posted: Mon Feb 08, 2016 2:43 pm
Hi CrazyFliers,
After the last Weekend I'm now having a working communication between a FRDM-KL26z-Board and my beloved Crazyflie
. So I am able to fly without the use of my PC.
While it was easy to send the Copter all controlling values (like thrust, yaw, roll and pitch) my focus is now on the different parameters and the functions thereof.
The first thing i wanted to check is the Battery-Status. It turns out, that it's not as easy as the controlling. That why I'm writing this in the hope, that someone can help me.
From my understanding, to know exactly where the Battery-Voltage is stored I need to access the TOC. So first thing I need to do, is to read all Parameter-Elements as described here: https://wiki.bitcraze.io/doc:crazyflie:crtp:param
But already there a Problem emerges:
When I send the command
Instead of the first TOC-Element I'll receive no Data.
But sending the command
Will get me the following answer:
which is clearly not a TOC-Element but more like the Num. Of Parameters and the CRC32, which should be returned by command 2/0, 3.
Since this lead to nothing I tired to read me in some Code: Where I found: in
https://github.com/bitcraze/crazyflie-c ... e/param.py
This lead to more confusion since it is clearly stated, that the GetCRC32 should be command 3.
So at this point I started the CrazyFlie-Client and in it its Crtp-Sniffer. After that I Connected my Crazyflie and got all the nice data sets. Hoping to find the point where the parameters are accessed. There I had to find next mysterious thing.
In the connection-start there is a command and its Answer is:
Exactly the same as the one I get (so my Code is working the way it should). But after that the Client starts to refresh all parameters. This even indicates that the GETCRC32 is command 1. Which state that there are 64 Parameters and a 4 Byte CRC32 (Since the CRC32 is known by the Client it is not necessary to get the complete parameter-set again. So instead just update the data).
Now in order to get the Parameter-List with my uC, it would be great, if someone would explain how exactly I get the Parameter-List and in a further step the Parameter itself.
Thanks.
Greetings,
RomanG
After the last Weekend I'm now having a working communication between a FRDM-KL26z-Board and my beloved Crazyflie

While it was easy to send the Copter all controlling values (like thrust, yaw, roll and pitch) my focus is now on the different parameters and the functions thereof.
The first thing i wanted to check is the Battery-Status. It turns out, that it's not as easy as the controlling. That why I'm writing this in the hope, that someone can help me.
From my understanding, to know exactly where the Battery-Voltage is stored I need to access the TOC. So first thing I need to do, is to read all Parameter-Elements as described here: https://wiki.bitcraze.io/doc:crazyflie:crtp:param
But already there a Problem emerges:
When I send the command
Code: Select all
Port/Channel, Data
2/0, 0
But sending the command
Code: Select all
Port/Channel, Data
2/0, 1
Code: Select all
Port/Channel,Data
2/0, [1, 64, 106, 134, 208, 63]
Since this lead to nothing I tired to read me in some Code: Where I found:
Code: Select all
# TOC access command
TOC_RESET = 0
TOC_GETNEXT = 1
TOC_GETCRC32 = 2
https://github.com/bitcraze/crazyflie-c ... e/param.py
This lead to more confusion since it is clearly stated, that the GetCRC32 should be command 3.
So at this point I started the CrazyFlie-Client and in it its Crtp-Sniffer. After that I Connected my Crazyflie and got all the nice data sets. Hoping to find the point where the parameters are accessed. There I had to find next mysterious thing.
In the connection-start there is a command
Code: Select all
2/0, 1
Code: Select all
2/0, [1, 64, 106, 134, 208, 63]
Now in order to get the Parameter-List with my uC, it would be great, if someone would explain how exactly I get the Parameter-List and in a further step the Parameter itself.
Thanks.
Greetings,
RomanG