Logging does not retrieve variable's value

Firmware/software/electronics/mechanics
Post Reply
jesslarkan
Beginner
Posts: 13
Joined: Sun Jul 22, 2018 8:08 am

Logging does not retrieve variable's value

Post by jesslarkan »

Hi there,

I am trying to log a variable but am experiencing issues with what the Crazyflie returns to me.

I first start by deleting all log blocks previously saved in the system (port 5, channel 1, ID 5) then creating a log block (port 5, channel 1, ID 0, choosing block ID 9, followed by variable 57 - 39 in hex). I then start the logging (port 5, channel 1, ID 3, block ID 9 as before, and 64 hex for 100ms periods).

When I do this, I receive the log packet at the correct intervals, telling me it is log block 9, but the contents are empty. It does not contain variables of zero, it is simply 09 and then the packet ends.

Am I overlooking something? The variable I am trying to log for testing is temperature, but I would like to log battery level and position (x, y, z) in future. It doesn't seem to matter what variable I ask for, I always receive an empty packet.

Thanks so much for your help as always guys. Really appreciate it.

Cheers,
Jess
arnaud
Bitcraze
Posts: 2538
Joined: Tue Feb 06, 2007 12:36 pm

Re: Logging does not retrieve variable's value

Post by arnaud »

- What error code do you get back when creating the log block?

The code in the firmware is using 'errno.h' codes to indicate problems. My guess would be that you are trying to add a variable that does not exists. This could be because you use the API V2 and only send one byte as variable ID.

One thing that could help is that you can look at the CRTP sniffer in the client to see what the client is communicating. It can be displayed with view/toolboxes/crtp sniffer:
crtp_sniffer.png
This way you can see how the client is handling the setup sequence. In the tab LogBlock you can see the ID and variables of the block that are breing setup. One tip about this toolbox: disable sniffing just after connection in order to not slow down the full interface.
jesslarkan
Beginner
Posts: 13
Joined: Sun Jul 22, 2018 8:08 am

Re: Logging does not retrieve variable's value

Post by jesslarkan »

Hi Arnaud,

I am not using the PC client, but rather trying to replicate the logging within my Labview program. So I do not receive an error. Within the PC client I have no issue with logging. A simpler variable I would like to retrieve would be something such as battery level, since I know this exists.

I am using Wireshark to monitor the packets and this shows me that the response is empty (port 5, channel 2, block ID 9, timestamp 3 bytes, nothing following). In this case the ID I used was 113 (71 hex) for battery level.

https://imgur.com/4AlQTlH

I have downloaded the TOC and have the name and group of variables 1-255 - is it possible that even though some variables are in this TOC, I still cannot retrieve them? I thought if I could see them in the TOC and so had their ID, I could be sure they existed.

Thanks.

Cheers,
Jess
arnaud
Bitcraze
Posts: 2538
Joined: Tue Feb 06, 2007 12:36 pm

Re: Logging does not retrieve variable's value

Post by arnaud »

Hi Jess,

I know that you are not using the client, but using a working client to observe a working behavior can only help :).

It is correct that if a variable is in the TOC, it is for sure accessible via the log subsystem.

Do you get any error code from the Crazyflie as an answer of the command creating the log bock?

There is a windows build for the Crazyflie client, you could use it and sniff with wireshark do see if your sequence to start a log block is any different to the clients sequence.
jesslarkan
Beginner
Posts: 13
Joined: Sun Jul 22, 2018 8:08 am

Re: Logging does not retrieve variable's value

Post by jesslarkan »

Hi Arnaud,

Sorry I misunderstood what you meant. I have monitored the normal client's behavior and my recreated Labview client, and the messages sent/received are the same.

Capture of my Labview client's creation, then start of block 09. Red is response to red, blue to blue.
https://imgur.com/a/kNA5qwR

Capture of the PC client's creation of a block.
https://imgur.com/a/jxzeh37

Both respond with the "00" for create block, then the ID, then a "00".
Are these in fact error codes?

Cheers,
Jess
Post Reply