2016-11-06 23:14:13 +01:00
|
|
|
nxt-python (python module to control Lego NXT)
|
|
|
|
|
|
|
|
nxt-python is a python 2.x driver/interface for the Lego Mindstorms
|
2019-11-22 07:37:19 +01:00
|
|
|
NXT robot. Development for this has stalled, so there is no
|
|
|
|
[complete] Python3 implementation.
|
2014-12-15 18:34:47 +01:00
|
|
|
|
|
|
|
Setup
|
|
|
|
------
|
|
|
|
|
2016-11-06 23:14:13 +01:00
|
|
|
In order to use nxt-python with an NXT kit, you should add a 'lego'
|
|
|
|
group to your system, and add yourself to that group:
|
2014-12-15 18:34:47 +01:00
|
|
|
|
2019-11-22 07:37:19 +01:00
|
|
|
# groupadd lego
|
|
|
|
# usermod -a -G lego YourUserName
|
2014-12-15 18:34:47 +01:00
|
|
|
|
2016-11-06 23:14:13 +01:00
|
|
|
You will also want to set up a udev rule to identify NXT hardware and
|
|
|
|
grant the 'lego' group permission to use it.
|
2014-12-15 18:34:47 +01:00
|
|
|
|
2016-11-06 23:14:13 +01:00
|
|
|
A sample rule is included for you in /usr/share/nxt-python, but you may
|
|
|
|
want to verify the vendor code of the NXT unit.
|
2014-12-15 18:34:47 +01:00
|
|
|
|
2016-11-06 23:14:13 +01:00
|
|
|
To verify the vendor code, connect the NXT hardware to your computer
|
|
|
|
and then run:
|
2014-12-15 18:34:47 +01:00
|
|
|
|
2019-11-22 07:37:19 +01:00
|
|
|
# lsusb
|
2014-12-15 18:34:47 +01:00
|
|
|
|
2016-11-06 23:14:13 +01:00
|
|
|
Look at the ID for the Lego device; it will probably be 0694, but if not,
|
|
|
|
then change the value in the sample udev rule to match.
|
2014-12-15 18:34:47 +01:00
|
|
|
|
|
|
|
Save the sample udev rule (70-lego.rules) to /etc/udev/rules.d/
|
|
|
|
|
2016-11-06 23:14:13 +01:00
|
|
|
Log out and log back in, and you should now have full control, via Python,
|
|
|
|
over your NXT hardware.
|
2014-12-15 18:34:47 +01:00
|
|
|
|
|
|
|
Requires at least one of these
|
|
|
|
-------------------------------
|
|
|
|
pyusb (for USB communication)
|
|
|
|
pybluez (for bluetooth communication)
|