View Single Post
Posts: 1,101 | Thanked: 1,185 times | Joined on Aug 2008 @ Spain
#705
Originally Posted by auouymous View Post
Duh, I didn't think about mapping them to times. Orange should probably 7 instead of 6 as it one of the max usage times. But 4 and 10 look good for the other two, three hours between each color.
Somehow I like more 6.5
Probably because 7 h is the life I learned to expect because of old osso battery applet.
Originally Posted by auouymous View Post
Battery drops are random events and shouldn't be accounted for.
They aren't that random for me, always seem to happen after a long constant drain, for example listening to music for some hours with the screen off, then when I stop music and leave the device for a couple of minutes the drop happens.
They could be linked to battery brand, since mine is not a Nokia original but a Mugen one. My Nokia one died of old age, so I'm unable to check with one.

Originally Posted by auouymous View Post
Any idea what would cause BME socket reading to block indefinitely?

My C script worked fine but the applet blocks on the fifth request read, sixth read if it you include the BMentity reply. I even placed a select call before the reads but it always shows the socket to be ready. To get around this, the applet you have opens, reads and closes the socket every time it requests a value. The charging signal calls the BME update function to change the icon and was requesting a new value every time the charger was unplugged. It seems that requesting a new value too soon after the last can cause the read to block. I've now changed the code so only the 15 second timer requests new values but it might still be possible for some random event to cause read to block and lock up the statusbar. Finding a way to prevent this would not only prevent random lock ups but also use less cpu if it didn't have to open the socket for each request.
I learned with the python script that BME socket behavior is quite random, sometimes it allows just one reading, other quite a few in a row, then blocks.
Just do like the python script, write the request to the socket, and try to read the result but using a 0.5 or 1 s timeout. If the reading timeouts, then close and open the socket and repeat.