I am writing an app to control my MPD (Music Player Daemon) with my Nokia E51 by wifi.
There is a generic python client library which uses socket module.
I am using pys60 1.9.7.
Everything is working very well, but I wanted to add powersaving to my app.
Here is code I wrote:
if e32.inactivity() > 120:
if connected == 0:
client = connect()
client = mpd.MPDClient() # create client object
client.connect(ip_serwera, 6600) # connect to ip:6600
connected = 1
I import the library using code:
client.close() # send the close command
client.disconnect() # disconnect from the server
connected = 0
In the library function close sends "goodbye" to server and disconnect does:
But even after I do disconnect WiFi stays ON and uses battery.
What can I do?
WiFi connections is closed only after I close Python interpreter.