Help with PyBluez

367 views
Skip to first unread message

Piecat

unread,
Jan 30, 2011, 5:19:13 PM1/30/11
to nxt-python

I installed it to the site-packages folder and installed NXT python
too.


When I run the example programs it claims I didn't install PyBluez. My
NXT is hooked up to windows and it says its working.


What the Idle says when I try to run them:
"
USB module unavailable, not searching there
Bluetooth module unavailable, not searching there
Traceback (most recent call last):
File "C:\Python\2.6\Lib\site-packages\nxt-python\examples\mary.py",
line 15, in <module>
b = nxt.locator.find_one_brick()
File "C:\Python\2.6\Lib\site-packages\nxt\locator.py", line 55, in
find_one_brick
for s in find_bricks(host, name, silent):
File "C:\Python\2.6\Lib\site-packages\nxt\locator.py", line 47, in
find_bricks
raise NoBackendError("Neither USB nor Bluetooth could be used! Did
you install PyUSB or PyBluez?")
NoBackendError: Neither USB nor Bluetooth could be used! Did you
install PyUSB or PyBluez?
"


Any idea what it could be?

Marcus Wanner

unread,
Jan 30, 2011, 6:35:42 PM1/30/11
to nxt-p...@googlegroups.com
On Sun, 2011-01-30 at 14:19 -0800, Piecat wrote:
> I installed it to the site-packages folder and installed NXT python
> too.

Good.

> NoBackendError: Neither USB nor Bluetooth could be used! Did you
> install PyUSB or PyBluez?

Open a python shell and "import bluetooth". What output? What OS? What
version of nxt-python? Sorry you're having trouble.

Marcus wanner


Andrew Krill

unread,
Jan 30, 2011, 8:45:28 PM1/30/11
to nxt-p...@googlegroups.com
I am using Windows 7, The version of python is 2.6 and the NXT-python version is 2.01.


The output I get from "import bluetooth" is:


"
Traceback (most recent call last):
  File "<pyshell#0>", line 1, in <module>
    import bluetooth
  File "C:\Python\2.6\lib\site-packages\bluetooth\__init__.py", line 31, in <module>
    from msbt import *
  File "C:\Python\2.6\lib\site-packages\bluetooth\msbt.py", line 2, in <module>
    import _msbt as bt
ImportError: DLL load failed: %1 is not a valid Win32 application.
"


And its okay, I have plenty of time and I know this contributes and helps so the problem doesn't happen to anyone else.


Also, I don't know if this matters but my NXT is the 1st version.





--
You received this message because you are subscribed to the Google Groups "nxt-python" group.
To post to this group, send email to nxt-p...@googlegroups.com.
To unsubscribe from this group, send email to nxt-python+...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/nxt-python?hl=en.


Marcus Wanner

unread,
Jan 30, 2011, 10:27:44 PM1/30/11
to nxt-p...@googlegroups.com
(it would be nice if you didn't top-post to the list...)

On Sun, 2011-01-30 at 19:45 -0600, Andrew Krill wrote:
> I am using Windows 7, The version of python is 2.6 and the NXT-python
> version is 2.01.
>
> The output I get from "import bluetooth" is:
>
> "
> Traceback (most recent call last):
> File "<pyshell#0>", line 1, in <module>
> import bluetooth
> File "C:\Python\2.6\lib\site-packages\bluetooth\__init__.py", line
> 31, in <module>
> from msbt import *
> File "C:\Python\2.6\lib\site-packages\bluetooth\msbt.py", line 2, in
> <module>
> import _msbt as bt
> ImportError: DLL load failed: %1 is not a valid Win32 application.
> "

This looks bad...regular DLL hell if you ask me. I would guess that you
are using either an incompatible bluetooth stack (broadcom or bluesoleil
may not work with PyBluez; check their website) or the wrong
architecture (32 vs. 64 bit) of PyBluez. This isn't really a nxt-python
problem really...if neither of these things are the problem you'd be
best asking the PyBluez guys for help. Sorry...

> And its okay, I have plenty of time and I know this contributes and
> helps so the problem doesn't happen to anyone else.

Yes it does.

> Also, I don't know if this matters but my NXT is the 1st version.

I don't think this would make a difference since we can't actually
connect to it yet.

Marcus Wanner


Andrew Krill

unread,
Jan 31, 2011, 5:56:55 PM1/31/11
to nxt-p...@googlegroups.com
I just realized that I am using the built in windows blue tooth which might be the problem. If it is ill just get one.

Also, I went to the Pybluez website and it has an error message, so I just got it from your guy's page.





--

Andrew Krill

unread,
Jan 31, 2011, 6:14:00 PM1/31/11
to nxt-p...@googlegroups.com
wait, I have no idea which page I went to because there is a Google page for PyBluez...

It looks like it might only be for windows XP, ill email them.

Ill contact you again if I have anymore problems with NXT-Python.

Marcus Wanner

unread,
Jan 31, 2011, 6:10:41 PM1/31/11
to nxt-p...@googlegroups.com
(again, please put your text below that which is quoted...it really
helps readability)

On Mon, 2011-01-31 at 16:56 -0600, Andrew Krill wrote:
> I just realized that I am using the built in windows blue tooth which
> might be the problem. If it is ill just get one.

No, that should work fine. At least, it did in WinXP. Make sure the
PyBluez guys support 7.

> Also, I went to the Pybluez website and it has an error message, so I
> just got it from your guy's page.

What?

Marcus Wanner


Reply all
Reply to author
Forward
0 new messages