1) The most common reason for this is that people forget to turn for the mesh routing.
This does not allow the spots to go to deep sleep.(you can also set its policy in the code)
2) All running threads needs to be sleeping. If you have a thread listening for a radio connection this thread does not matter since it is a blocking I/O. As long as this thread wont receive messages from others spots, you are good to go.
3) If you have OTA server running then you need to set its policy. You can do this by creating a dummy connection. RadiogramConnection conn = (RadiogramConnection) Connector.open("radiogram://:42");
conn.setRadioPolicy(RadioPolicy.OFF);
4) To create different threads for each separate action might be a good programming practice, but it make things difficult. Trying to put the threads to sleep separately becomes a big problem.
So instead have one thread for everything.
Also if you are reading a radiogram than you need to disable blocking on radiogram's read() methods.
5) Also you can turn of the AODV by AODVManager.getInstance().stop();
6)After hours of debugging I finally understand that while there is an active radio connection the spots wont go to sleep. So right before you have to go to deep sleep you have to close() the connections and reopen it as the threads sleep() ends.
0 comments:
Post a Comment