find_one_brick crashes python

49 views
Skip to first unread message

Afshan Khan

unread,
Mar 18, 2014, 12:44:46 AM3/18/14
to nxt-p...@googlegroups.com
Hi,

I am testing mary.py and nxt_test scripts that come with nxt-python. It seems like it crashes right after calling find_one_brick(). I put a print statement after it, and it never prints. Here's an example

sock = nxt.locator.find_one_brick(debug=True)
print 'my string'

This is the script's output:

Host: 00:16:53:04:2A:60 Name: Lizard Strict: True
USB: True BT: False Fantom: False FUSB: False FBT: False

As you can see, "my string" is never printed. The host information comes from /root/.nxt-python and everything is properly set in there. I want to use USB connection because I'm running it on Rasberry PI. NXT is using the default firmware. If I turn it off and run the script then it says no Brick found which makes sense.

What could be the issue here? I am using PyUSB. Using the command "lsusb" shows that LEGO NXT is connected.

Thanks.


Afshan Khan

unread,
Mar 18, 2014, 6:29:32 PM3/18/14
to nxt-p...@googlegroups.com
Found the problem.
I had to initialize the configuration in usbsock.py as mentioned in https://groups.google.com/forum/#!topic/nxt-python/IOVkfhCvHp0

"
I think I have found a solution though which works for me. 
In /usr/local/lib/python2.6/dist-packages/nxt/usbsock.py add: 

self.handle.setConfiguration(1) 

after self.handle.reset() (on line 46). 
Reply all
Reply to author
Forward
0 new messages