Posts

Sunspot: Deep Sleep

Problem: Some spots is unable to deepsleep Cause: some spot properties prevent from deep sleep Solution: spot.mesh.enable = false

Sunspot: Power controller

https://www.sunspotworld.com/forums/viewtopic.php?p=8064&sid=b80a20f95ee74e2e3826834f25d542a6 https://www.sunspotworld.com/forums/viewtopic.php?t=306&highlight=energy http://www.sunspotworld.com/docs/Orange/javadoc/com/sun/spot/peripheral/IPowerController.html#getVbatt()

Java: concurrency construct

Java Concurrency Constructs What is the difference between sleep(), wait() and suspend()? wait(), sleep(int) and InterruptedException The notifyAll and wait Methods Using the notifyAll and wait Methods 

Thread in java: notifyAll()

Problem: I got

SunSpot: How to debug deepsleep

SunSpot: MovementDetection

Problem: Method "thresholdExceeded" always works even though we didn't move the spot or move the spot when it is in deepsleep. Cause: I suppose that the events occurred when we do move and wait for sending the messages when the receiver is available. Solution: Disable ThresholdEvent before starting in deepsleep mode -- accel.enableThresholdEvents(IAccelerometer3D.ALL_AXES, false);

SunSpot: UnableToDeepSleep

Problem: When we use sleepMgr.ensureDeepSleep(...), it goes to UnableToDeepSleepException even we don't have any thread running. The error says that "another thread is runnable within x", Cause: Because of many system threads which run from time to time, sunspot won't let us do ensuredeepsleep. Solution: We just call the command to block every thread running which is Thread.sleep(...) or Utils.sleep(...). Then, the spot will go to deepsleep. Note: In my experiment, OTA doesn't affect with deepsleep mode. References: https://www.sunspotworld.com/forums/viewtopic.php?p=7755