-
Notifications
You must be signed in to change notification settings - Fork 24
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Only getting data in "Orientation Quaternion" mode, no other modes #11
Comments
This may actually be an issue with how I am processing the buffers my script receives. Will report back tomorrow if I still need assistance. |
Update: confirmed that I am only getting 20-byte notifications, regardless of what my script does with that data. |
@aero-man |
When Python informs the application of each received notification packet, then it is to be expected that the data-size is 20-bytes as that is the size of the user data in a notification packet. It would be strange however since the stack should stitch the larger notifications together as one data-block. |
Thanks @fancycww and @freddijkstra for the tips. I will investigate again how Python and Bluepy are breaking up the data. |
Here are ten lines of sensor data that I am getting from a single sensor. Though I set the sensor to "Extended (Quaternion)" mode, which should be 40 bytes, I am only getting 20 bytes. It does not appear that the script is dividing the DOT notification into two separate 20-byte notifications, since each line has a legitimate timestamp in the expected order. If every other line was actually the second 20-byte chunk of the overall notification, I'd expect the timestamp to be some accelerometer or gyro value that got accidentally interpreted as a timestamp and thus be something very different from
Thanks again. |
I'm still trying to debug this issue. Still only getting 20 bytes of data. Looking at the underlying code in Bluepy. Do you guys know what the Bluetooth packet looks like when it leaves the sensor. Is there any documentation available on this? I'm having Bluepy print out what it gets from the sensors, and each packet looks like this: Thanks. |
@FrederikPetri I am using Numpy.
This code lives in the callback function |
Hello,
I have a Python script that is successfully getting data from a single sensor. However, no matter which setting I write to the Control Characteristic, I appear to only be getting data in "Orientation Quaternion" mode. No matter which mode I specify at the end of my byte string (for example,
b'\x01\x01\x02'
for "Extended (Quaternion)" mode), the data I get in the notifications is not 36 bytes as expected, but only 20 bytes. After converting the 20 bytes that I do get to numbers, it looks like I get a timestamp (uint32) and 4 chunks of quaternion data (each a 32-bit float for quaternion W, X, Y, and Z). When I write my enable messageb'\x01\x01\x02'
to the Control Characteristic, I also read it back to ensure that it was written properly, and it does readb'\x01\x01\x02'
like I expect.Another source of confusion is that when I get a notification with some sensor data, the notification says it was sent from handle 39 (the handle for the medium payload length characteristic), and yet the data I am getting is supposed to be sent from the short payload length characteristic, which should have a handle of 43.
Is there another step to enabling these sensors and setting the measurement mode that I am missing? My current understanding is outlined in Issue #7 and is copied below:
Thanks for your help.
The text was updated successfully, but these errors were encountered: