Open ghost opened 4 years ago
Hello. I haven't played with this for ages!
I don't have much insight into what the sensortag library https://github.com/sandeepmistry/node-sensortag does. But I did notice this bit of code in my package :
sensorTag.setAccelerometerPeriod(100, function(error) {
// console.log("Starting Accelerometer");
sensorTag.notifyAccelerometer();
});
I'm guessing this causes the SensorTag to send Accelerometer readings every 100ms. That might be too often, causing it to constantly transmit and hence run out of battery.
Try to see if increasing that period helps.
I had considered doing this, but would changing this mean that it only would send readings if it was moving on the interval? For example, if I set it to 5 seconds and it moved and stoped moving before the 5 seconds was up, do you think that it would report it?
I appreciate the help!
That's my guess. But I would try it out before assuming.
I'm not sure if this is the correct place to ask this, but I figured I'd start here. I should begin by saying that I am very new to this, so excuse any dumb mistakes.
I am experiencing very fast battery drain (new battery to dead overnight) using a SensorTag CC2650. I have everything working, but this issue is stopping me from progressing further.
The only thing I have changed is the sensitivity in index.js to 0.2. After experiencing this issue, I did add the "Disabling unnecessary sensors" section in an attempt to disable the unneeded sensors. It doesn't seem to have helped.
If it helps, here is my code:
My goal is to have the SensorTag alert the Raspberry Pi Zero when it notices a shake, and the raspberry pi decides if it is the first shake that day. If so, it should print to the console "SensorTag shook for the first time today." Eventually, I plan to have the sensortag attached to a mailbox so that the pi notifies me when the mail is delivered.
If you have any ideas on what may be causing this battery drain and/or any ideas on solutions, I would really appreciate any help. Thanks!