pepijndevos wrote:How do you run python-nxt with pyfantom on Mac? I'm running Python in 32-bit mode, and still experience frequent errors. I emailed Nicolas about it, and he said it was you who did most of the work. Interesting
What bothers me about Linux is that it requires root access to use USB.
Well, Nicolas is the Python guru, so the class design is his. I just filled in the blanks.
Hmm. Which Mac OSX version? I've tested it on Snow Leopard (10.6).
Also, are you using the default Apple python, or from MacPorts? Both should work, though from macports you would need to compile it as universal to get the 32-bit version.
pyfantom will complain unless you invoke python with
$arch -i386 $PYTHON
For the Apple supplied version, you need to provide the full python executable name, python2.6, for e.g., otherwise the python wrapper does not invoke the actual python interpreter correctly for 32-bit operation.
Code: Select all
iMac-TCWan:pyfantom tcmac$ python pyfantom.py
Traceback (most recent call last):
File "pyfantom.py", line 17, in <module>
raise RuntimeError("fantom drivers not available in 64 bit mode.\n"
RuntimeError: fantom drivers not available in 64 bit mode.
You can run python in 32 bit mode using:
arch -i386 python2.6
iMac-TCWan:pyfantom tcmac$ arch -i386 python2.6 pyfantom.py
[...]
I presume that yo're talking about nxt-python. You should use version 2.2.1 or later. In adition, you should have a .nxt-python config file in your home directory.
$ cat ~/.nxt-python
Code: Select all
[Brick]
name =
host =
strict = 0
method = usb=False, bluetooth=False, fantomusb=True, fantombt=False
Note that FantomBT does not work for raw protocol messages (i.e. bypassing send direct command), I haven't managed to figure out why.