BITalino & Python: no module named bluetooth

Python, Java, Android OS, etc.
R0bs
Posts: 6
Joined: Wed Dec 09, 2015 4:30 pm

BITalino & Python: no module named bluetooth

Postby R0bs » Thu Dec 10, 2015 11:00 am

Hi!

I'm quite new in programming and BITalino tools.
I'm conducting an experiment using Psychopy 1.83.01 and I would like to connect BITalino to my setup to get EDA and ECG.
I'm using the Python API found on BITalino website to try to interface BITalino and Python.
When I run bitalino.py I get this error:

Traceback (most recent call last):
File "C:\Users\RGS Vall d'Hebron\Desktop\bitalino.py", line 507, in <module>
device = BITalino(macAddress)
File "C:\Users\RGS Vall d'Hebron\Desktop\bitalino.py", line 76, in __init__
import bluetooth
ImportError: No module named bluetooth

Does anyone have suggestions to solve it?

Thanks in advance!
R0bs.

PS: Meanwhile I tried to run the script directly from the cmd.
I got this output:

None
BITalino_v3.3a_18032014
[[ 0. 1. 1. 1. 1. 0. 0.]
[ 1. 1. 1. 1. 1. 0. 0.]
[ 2. 1. 1. 1. 1. 0. 0.]
[ 3. 1. 1. 1. 1. 0. 0.]
[ 4. 1. 1. 1. 1. 0. 0.]
[ 5. 1. 1. 1. 1. 0. 0.]
[ 6. 1. 1. 1. 1. 0. 0.]
[ 7. 1. 1. 1. 1. 0. 0.]
[ 8. 1. 1. 1. 1. 0. 0.]
[ 9. 1. 1. 1. 1. 0. 0.]
[ 10. 1. 1. 1. 1. 0. 0.]
[ 11. 1. 1. 1. 1. 0. 0.]
[ 12. 1. 1. 1. 1. 0. 0.]
[ 13. 1. 1. 1. 1. 0. 0.]
[ 14. 1. 1. 1. 1. 0. 0.]]

BITalino
Site Admin
Posts: 567
Joined: Tue Aug 27, 2013 3:47 pm

Re: BITalino & Python: no module named bluetooth

Postby BITalino » Thu Dec 10, 2015 11:49 am

Hi there,

Looks like when you're running the script with each of the methods a different Python installation is used.

In particular, the Python API requires PyBluez (https://github.com/karulis/pybluez).

The error you're getting appears to be associated with the lack of the PyBluez module.

Hope you found this information useful. If you have any further questions, don't hesitate to contact us.

Best regards,
The BITalino Team

R0bs
Posts: 6
Joined: Wed Dec 09, 2015 4:30 pm

Re: BITalino & Python: no module named bluetooth

Postby R0bs » Thu Dec 10, 2015 1:16 pm

Hi!

thank you for the quick reply!
I've already installed pyBluez so I don't think that it is the problem.
Now I'm trying to connect bitalino by serial port.
Reading some Psychopy topic they suggest to use a serial port instead of bluetooth.
Is it possible with BITalino?

Thanks!
R0bs.

BITalino
Site Admin
Posts: 567
Joined: Tue Aug 27, 2013 3:47 pm

Re: BITalino & Python: no module named bluetooth

Postby BITalino » Thu Dec 10, 2015 2:18 pm

From the information you've shared its really looking like your system is dealing with multiple installations of Python, one of which has the PyBluez module installed (the one accessible from the command line) and the other one without.

This is actually fairly common issue with pre-installed Python on the system and user installed distributions.

As for the serial port, perhaps what you've read is referring to something different than what you're interpreting as the BITalino connection by serial port. The BITalino serial port is actually a Virtual Serial Port as described here:
http://windows.microsoft.com/en-us/windows/choose-com-port-bluetooth#1TC=windows-7

That is, even though the system perceives it as a serial port, its actually using the Bluetooth connection.

The standard serial port connection that you've probably seen referenced in psychophysiology topics refers to an actual cabled (rather than Bluetooth wireless) connection to the device. This can also be achieved with BITalino; please refer to the following thread on our forum:
http://forum.bitalino.com/viewtopic.php?t=143

Best regards,
The BITalino Team


Return to “Programming APIs”




cron