title: Python code for Bluetooth throws error after I had to reset the adapter
body: <p>I was trying out bluetooth programming in python. It was working fine till yesterday. This morning, there was a power outage and for some reason, the bluetooth module got disabled and it could not be turned on. So, I did a <code>sudo hciconfig hci0 reset</code> and then turned it on. From that point onwards, the simplest of the programs are failing to execute. Take <a href="https://code.google.com/p/pybluez/issues/attachmentText?id=53&amp;aid=530000001&amp;name=RFCOMM+Server.py&amp;token=vnVPKroCQumF9hq0AwD6ea74DyE%3A1327666192157">this one</a> for example. It gets stuck at <code>advertise_service</code> in <code>bluetooth</code> module and throws the following error (FYI: virtualenv was not a problem here. The systemwide python also does the same thing). </p>
  
  <pre><code>Traceback (most recent call last):
    File "bt.py", line 17, in &lt;module&gt;
      advertise_service( server_sock, "SampleServer", service_id = uuid, service_classes = [ uuid, SERIAL_PORT_CLASS ], profiles = [ SERIAL_PORT_PROFILE ])
    File "/home/machinename/.virtualenvs/py27/local/lib/python2.7/site-packages/bluetooth/bluez.py", line 242, in advertise_service
      raise BluetoothError (str (e))
  bluetooth.btcommon.BluetoothError: (2, 'No such file or directory')
  </code></pre>
  
  <p>Sometimes I got a different error when I compiled and reinstalled <code>Bluez</code> driver:</p>
  
  <pre><code>Traceback (most recent call last):
    File "build/bdist.linux-x86_64/egg/bluetooth/bluez.py", line 268, in advertise_service
    bluetooth.btcommon.BluetoothError: error no advertisable device.
  </code></pre>
  
  <p>But all of these worked like a charm before in that machine; in fact all of the program works just fine with my other ubuntu (14.04LTS) machine as I write this. I inspected the source code, and traced to a <code>_bluetooth.so</code> file - which is a compiled code, hence I couldn't figure out what to do anymore. </p>
  
  <p>Any pointer will be highly appreciated.</p>