Trying to connect NXT with USB, not responding

558 views
Skip to first unread message

Trizion

unread,
Aug 24, 2011, 9:01:40 PM8/24/11
to nxt-python
I have been trying to get my lego mindstorms nxt to run with python.

This is the error I'm getting when I run spin.py:

>>> Host: 00:16:53:07:CB:5F Name: Johnny 5 Strict: True
USB: True BT: True Fantom: True FUSB: False FBT: True
USB module unavailable, not searching there
Fantom module unavailable, not searching there
Traceback (most recent call last):
File "C:\Python26\Lib\SITE-P~1\PYTHON~2\pywin\framework
\scriptutils.py", line 322, in RunScript
debugger.run(codeObject, __main__.__dict__, start_stepping=0)
File "C:\Python26\Lib\SITE-P~1\PYTHON~2\pywin\debugger\__init__.py",
line 60, in run
_GetCurrentDebugger().run(cmd, globals,locals, start_stepping)
File "C:\Python26\Lib\SITE-P~1\PYTHON~2\pywin\debugger\debugger.py",
line 655, in run
exec cmd in globals, locals
File "C:\Users\trizion\Desktop\nxt-python-2.2.0\examples\spin.py",
line 12, in <module>
b = nxt.locator.find_one_brick(debug=True)
File "C:\Python26\lib\site-packages\nxt\locator.py", line 137, in
find_one_brick
raise BrickNotFoundError
BrickNotFoundError


my .nxt-python file is this:
[Brick]
strict = 0
host = 00:16:53:07:CB:5F
name = Johnny 5
method = usb=True, bluetooth=True, fantomusb=True

It is running on NXT 1.31 using NXT-python 2.2.0 and the most recent
pyUSB. My computer is running windows 7 and python 2.6, if that
changes anything.

Marcus Wanner

unread,
Aug 25, 2011, 7:41:20 PM8/25/11
to nxt-p...@googlegroups.com
On Wed, Aug 24, 2011 at 06:01:40PM -0700, Trizion wrote:
> I have been trying to get my lego mindstorms nxt to run with python.

Everything looks good except this:

> USB module unavailable, not searching there

And this:

> It is running on NXT 1.31 using NXT-python 2.2.0 and the most recent
> pyUSB. My computer is running windows 7 and python 2.6, if that
> changes anything.

If PyUSB is installed correctly, you should not get module unavailable
message. Open a python shell and run "import usb" to check this
manually. If you get errors, there is a problem with your PyUSB
installation.

--
Marcus Wanner

signature.asc

Ari

unread,
Aug 29, 2011, 11:54:13 PM8/29/11
to nxt-p...@googlegroups.com
Could it be that I'm not running pyUSB 1.0?
 

Marcus Wanner

unread,
Aug 30, 2011, 2:57:01 PM8/30/11
to nxt-p...@googlegroups.com
On Mon, Aug 29, 2011 at 08:54:13PM -0700, Ari wrote:
> I have been trying to get my lego mindstorms nxt to run with python.
>
>> USB module unavailable, not searching there
>
> Could it be that I'm not running pyUSB 1.0?

No, I believe that it's backwards-compatible. You could try with 0.4.2
or whatever the last 0.x series is and see how it goes though.

--
Marcus Wanner

signature.asc

Trizion

unread,
Sep 2, 2011, 1:31:09 AM9/2/11
to nxt-python
> If PyUSB is installed correctly, you should not get module unavailable
> message. Open a python shell and run "import usb" to check this
> manually. If you get errors, there is a problem with your PyUSB
> installation.

I ran "import usb" and it returned no errors. But when I went to run
spin.py I got much of the same error,

Host: 54:32:59:92:F9:39 Name: MyNXT Strict: True
USB: True BT: False Fantom: True FUSB: False FBT: True
Traceback (most recent call last):
File "C:\Python26\Lib\SITE-P~1\PYTHON~2\pywin\framework
\scriptutils.py", line 322, in RunScript
debugger.run(codeObject, __main__.__dict__, start_stepping=0)
File "C:\Python26\Lib\SITE-P~1\PYTHON~2\pywin\debugger\__init__.py",
line 60, in run
_GetCurrentDebugger().run(cmd, globals,locals, start_stepping)
File "C:\Python26\Lib\SITE-P~1\PYTHON~2\pywin\debugger\debugger.py",
line 655, in run
exec cmd in globals, locals
File "C:\Users\trizion\Desktop\nxt-python-2.2.0\examples\spin.py",
line 12, in <module>
b = nxt.locator.find_one_brick(debug=True)
File "C:\Python26\lib\site-packages\nxt\locator.py", line 112, in
find_one_brick
for s in find_bricks(host, name, silent, method):
File "C:\Python26\lib\site-packages\nxt\locator.py", line 43, in
find_bricks
for s in socks:
File "C:\Python26\lib\site-packages\nxt\usbsock.py", line 82, in
find_bricks
for bus in usb.busses():
File "C:\Users\trizion\AppData\Roaming\Python\Python26\site-packages
\usb\legacy.py", line 330, in busses
return (Bus(),)
File "C:\Users\trizion\AppData\Roaming\Python\Python26\site-packages
\usb\legacy.py", line 326, in __init__
self.devices = [Device(d) for d in core.find(find_all=True)]
File "C:\Users\trizion\AppData\Roaming\Python\Python26\site-packages
\usb\core.py", line 829, in find
raise ValueError('No backend available')
ValueError: No backend available

They differ starting with "File "C:\Python26\lib\site-packages\nxt
\locator.py", line 112, in find_one_brick'

Marcus Wanner

unread,
Sep 2, 2011, 11:50:22 AM9/2/11
to nxt-p...@googlegroups.com
On Thu, Sep 01, 2011 at 10:31:09PM -0700, Trizion wrote:
> I ran "import usb" and it returned no errors. But when I went to run
> spin.py I got much of the same error,
>
> Host: 54:32:59:92:F9:39 Name: MyNXT Strict: True
> USB: True BT: False Fantom: True FUSB: False FBT: True
> Traceback (most recent call last):
> File "C:\Python26\Lib\SITE-P~1\PYTHON~2\pywin\framework
> \scriptutils.py", line 322, in RunScript
> debugger.run(codeObject, __main__.__dict__, start_stepping=0)
<snip>

> File "C:\Users\trizion\AppData\Roaming\Python\Python26\site-packages
> \usb\legacy.py", line 326, in __init__
> self.devices = [Device(d) for d in core.find(find_all=True)]
> File "C:\Users\trizion\AppData\Roaming\Python\Python26\site-packages
> \usb\core.py", line 829, in find
> raise ValueError('No backend available')
> ValueError: No backend available
>
> They differ starting with "File "C:\Python26\lib\site-packages\nxt
> \locator.py", line 112, in find_one_brick'

This means you're making progress. Now, nxt-python is working fine but
pyusb is unable to find/use its backend (libusb). I would look for their
docs on the matter, google for the last few lines of the traceback, and
maybe ask the devs over there if you can't find anything.

--
Marcus Wanner

signature.asc
Reply all
Reply to author
Forward
0 new messages