I have a MetaTracker which I connect to via an Android application (using version 3.4.0 of the SDK). The Android application has been used previously to collect data (accelerometer, temperature, light, battery) from a MetaMotion over a. long period of time, without any issues.
The app is configured to collect data with the following settings:
- Accelerometer: 25hz, range: 4g
- Light: LTR329_RATE_1000MS, LTR329_TIME_100MS & LTR329_1X
- Temperature: 1Hz (1 read per second)
- Battery: 1 read per minute
In this new application, i'm also interested in humidity data, so I want to add:
- Humidity: 1Hz (1 read per second)
But i'm bumping into a few issues with this MetaTracker:
1) With the MetaTracker, at a certain moment I stopped receiving accelerometer & light data (AsyncDataProducer). I believe it was when I added code to read humidity data. Reconnecting or reverting to the old code didn't solve the issue. Removing the battery from the sensor did. The sensor seemed to be in a bad state? I don't know what the cause was of this or how to avoid it. Because after removing the battery, my code for humidity seems to work as expected.
2) After the above issue was solved , the forced data producers stop returning any data after ~ 5 minutes. I tried to solve this in several ways:
- removing the accelerometer stream (not needed in this project). At a certain moment i stop receiving data
- only read from a ForcedDataProducer when a previous read has returned a value. Now it seems to keep on going, but at a certain moment I stop receiving data for temperature. Light & humidity keep going.
3) I've tried installing the MetaBase app to see if any firmware updates were available, but on 1 phone it crashes (when i skip the step to connect to sensor). On 2 other phones it never finds the device after clicking +Device. When doing this i make sure my own app is not connected to it.
1). Sounds like you are 100% right. The sensor was in a corrupted state and reseting it by removing the battery was the way to go. As far as what did it, it is hard to tell without additional information.
2) Can you make sure that the memory is not full?
3) We are already working on this, there are reports of issues with the new MetaBase Android App. We should have a fix for this in 1-2 weeks.
Thanks for your reply. Do you mean the physical memory on the MetaTracker? How do I clear the memory?
You have to either use our Apps to reset the device or use the API calls to reset the device (there is a section on this in our tutorials).
I've tried several things and none of them seem to work:
I'm now thinking of reconnecting after X seconds when i notice no data is coming in. But ofcourse that's not really a good solution, especially if this happens every minute, we'll loose a lot of data!
Are you logging or streaming data?
If you are streaming, you can only do up to 100Hz of data or else packets will get dropped by Bluetooth.
If you are logging, you may run out of memory really quickly.
It is hard to comment on your case. Why not start small a simply and just do one sensor and tell me what happens.
I'm happy to tell you the problem has been resolved. I was sending a read() command for both temperature & humidity at the same time (within 5 ms) from different threads. It looks like these commands are not thread save so by making sure it happens sequentially... the issue seems to be fixed.
I'm only interested in streaming, not logging. I assume that the device doesn't save any records when I stream?
I read from the forced data producers every second.
Thanks for your time!
Thanks for the update @whuyghe_imec
If you are streaming, the device doesn't save any records.