Published on May 23, 2012
I created GUI for bluetooth remote. This is a small demo for it. Nothing too fancy at the moment, just a GUI to connect to bluetooth device and notifications.
I'm gonna add more stuff to GUI when i have ideas for them. Checkbox for enabling/disabling notifications would be nice.
GUI is made using pygtk and uses threading for background process and GUI.
Also modified arduino code a little to allow start playing selected song (or start playing, you don't need to even open mediaplayer anymore!)
also ordered 1.2Ah battery pack with usb and solar panel that im going to use as power source. whole thing uses ~60mA when its running so 1200Ah battery will give 20h of working time!
Was having hard time to get threading, closing bluetooth and reopening bluetooth again to work so here are tips:
Quit another thread that you have created:
in target thread:
def stop(self) self._stopevent.set()
and to access that function you need to use same way that you used to start thread.
like if you started thread with MainLoop(var).start() you need to use code: MainLoop(var).stop() to stop that thread.
and you cannot use one bluetooth socket multiple times, if you create bluetooth_socket and connect it and then disconnect it you cannot connect it again.
create array for sockets and use bluetooth_socket.append(BluetoothSocket(
Be sure to watch previous videos:
Python script without GUI 44 lines of code
Python script with GUI about 200 lines of joy!
Standard YouTube License