ImportError: cannot import name Bluetooth **SOLVED**



  • I am trying to run some of the Bluetooth examples given in the documentation but am getting the error message: ImportError: cannot import name Bluetooth. I have updated to the latest WiPy 2.0 firmware and can run other code including a web server example, so I am reasonably confident the WiPy is working. I have also tried importing the Bluetooth class using the REPL but get the same result:

    >>> from network import Bluetooth                                                                                       
    Traceback (most recent call last):                                                                                      
      File "<stdin>", line 1, in <module>                                                                                   
    ImportError: cannot import name Bluetooth   
    

    Any help would be greatly appreciated.



  • @tenspot No problem! :) It was likely that you had a very old version of the firmware tool installed!



  • @bucknall Hi, I have re-installed the firmware update program and run this to update the firmware to the latest version and I can now import the Bluetooth class.

    Thanks for your help.



  • @bucknall Hi, I have updated the firmware again but nothing has changed it is still showing as release='0.9.7.b1'. the update process seems to complete o.k. However, the firmware update program welcome screen say "This wizard will help you upgrade your Pycom board firmware to version 0.9.7.b1." so am I using an old version of this program?



  • @tenspot Looks like your firmware update wasn't successful! This likely explains the Bluetooth issues!

    Could you try to update the firmware again please? :)

    You're looking to see release='1.6.3.b1',

    Thanks!



  • Hi,

    The response is:

    (sysname='WiPy', nodename='WiPy', release='0.9.7.b1', version='v1.8.6-234-g765f2bc on 2016-12 02', machine='WiPy with ESP32')



  • Hi @tenspot,

    Could you please go to the REPL and run:

    import os
    os.uname()
    

    I know you have already updated, but this will just double check that the firmware is on the latest version!



Pycom on Twitter