Python, Linux and Scribbler (from scribbler forums)
Getting Scribbler to work with Myro "My Robotics" from the Institute for
Personal Robots in Education.· I'm posting this in the parallax robotics
forums since the forums for the scribbler are being moved over here.·
This is an informational posting.
--JWT
DISCLAIMERS
1. I do NOT work for Parallax, or any of their subsidaries, NOR am I a
staff/faculty/student of· Georgia Institute of Technology or Bryn Mawr
College.
2. If your scribbler blows up, I'm NOT responsible for it.· I did test
these on my scribbler, and it survived, and, in fact, is quite happy [noparse]:)[/noparse]
3. I assume you have a working knowledge of linux, if not, find your
nearest *NIX guru, and offer them free {food,beer} in exchange for help [noparse]:)[/noparse]
PREREQs:
1. Python 2.4 or 2.5
2. A serial port (the Serial2USB port provided/sold by parallax seems
·· to work the best.)
3. A Scribbler (or Boe-Bot, provided that it is setup to "emulate" a
·· Scribbler )
4. Tk, python-tk, pySerial
I am using a Debian based distro, so where ever it says to install
something using 'apt-get', you may have to replace that command with
one using the package manager your distro uses (e.g. yum (rpm))
FORMATING OF DOCUMENTATION
If I am refering to a command line command, you will see it formated:
DO NOT TYPE IN "yourprompt$ " !!!!
If I am refering to output from the command line, it will be prefixed
INSTRUCTIONS
First, create a directory to for all the programs involved.
Get the files:
Now to setup up Python for myro, you will need to make sure that python-tk is installed:
When asked to install addition packages, say yes, since you will probably need
Tcl/Tk installed as well.
Then unzip MYRO and pyserial the files
Your directory should look something like this
Now let's set up the Scribbler...
I am assumming you are using a recent linux distro, with kernel 2.6.17-10,
since has support for the FTDI serial to usb device that comes with the
Scribbler/serial2USB package.· (If you are using another type of serial
to usb device, you're on your own).
To check for it being recognised by linux type the following command:
You should many lines, with one being something like this:
The serial to usb adapter will be /dev/ttyUSB0. (or some variant of that)
To use the scribbler IPRE server through linux utilising WINE do the following:
1. Install the latest version of wine (I'm using Ubuntu 6.10, so I used the
·· built in package manager to download the latest verison of WINE)
··
2. Run winecfg if this is the first time you have used wine,
·· this should initialise your WINE installation.
··
3. Now from you home directory, go:
·· This creates a link between the serial2USB adapter and a virtual
·· com1 that WINE will use.· (For more info go to
·· http://www.winehq.com/site/docs/wineusr-guide/misc-things-to-configure)
4. Now you can execute the scribbler program. provided by the IPRE,
·· using the following command line:
··
·· You will get some output like this, and a window will pop up
·· showing the transfer.
·
5. That's it, the scribbler server program should be uploaded.
Setting up pyserial:
1. Setup up the serial port by creating a com5, by executing the following command:
··
2. Now change into the directory that has pyserial setup file in it
·· (i.e. ~/myrobot/pyserial-2.2 )
3. Then execute:
··
Setting up MYRO
1. Go to the directory that has "Start Python.pyw"
·· (i.e. ~/myrobot)
2. Make Start Python.pyw executable:
3. Start the program:
4. Now to test our scribby (with in the ILDE window)
Your robot should beep, and now you're ready to go!
JWT/jwt 28.1.2007 15:40 CST
ADDITIONAL INFORMATION
Myro is copyrighted by·the Institute for Personal Robots in Education.
I am NOT associated with the Myro project, I am just an end user,
so if you have·Myro specific questions you should probably check out:
http://wiki.roboteducation.org/wiki/index.php/Main_Page
Also (probably mentioned somewhere in these forums, just don't have time
to look right now) you can use the MicrosoftTM Robotics Studio
to control your scribbler.
http://www.roboteducation.org/scribbler_msrs_readme.html
I haven't tried it myself, but if you have, please share your experience.
JWT/jwt 29.1.2007 00:27 CST
Post Edited (zubernerd) : 1/29/2007 6:32:00 AM GMT
Personal Robots in Education.· I'm posting this in the parallax robotics
forums since the forums for the scribbler are being moved over here.·
This is an informational posting.
--JWT
DISCLAIMERS
1. I do NOT work for Parallax, or any of their subsidaries, NOR am I a
staff/faculty/student of· Georgia Institute of Technology or Bryn Mawr
College.
2. If your scribbler blows up, I'm NOT responsible for it.· I did test
these on my scribbler, and it survived, and, in fact, is quite happy [noparse]:)[/noparse]
3. I assume you have a working knowledge of linux, if not, find your
nearest *NIX guru, and offer them free {food,beer} in exchange for help [noparse]:)[/noparse]
PREREQs:
1. Python 2.4 or 2.5
2. A serial port (the Serial2USB port provided/sold by parallax seems
·· to work the best.)
3. A Scribbler (or Boe-Bot, provided that it is setup to "emulate" a
·· Scribbler )
4. Tk, python-tk, pySerial
I am using a Debian based distro, so where ever it says to install
something using 'apt-get', you may have to replace that command with
one using the package manager your distro uses (e.g. yum (rpm))
FORMATING OF DOCUMENTATION
If I am refering to a command line command, you will see it formated:
yourprompt$ this_command option1 option2
DO NOT TYPE IN "yourprompt$ " !!!!
If I am refering to output from the command line, it will be prefixed
>output from this_command
INSTRUCTIONS
First, create a directory to for all the programs involved.
yourprompt$ mkdir myrobot yourprompt$ cd myrobot
Get the files:
- MYRO - http://myro.roboteducation.org/download/packages/myro-all-101.zip
- PySerial - http://sourceforge.net/project/showfiles.php?group_id=46487&package_id=39324
- MYRO Scribbler PBASIC control program (the program that needs to be
uploaded to scribbler) - http://myro.roboteducation.org/download/scribbler.exe
Now to setup up Python for myro, you will need to make sure that python-tk is installed:
yourprompt$ sudo apt-get install python-tk
When asked to install addition packages, say yes, since you will probably need
Tcl/Tk installed as well.
Then unzip MYRO and pyserial the files
yourprompt$ unzip myro-1.0.0.zip yourprompt$ unzip pyserial-2.2.zip
Your directory should look something like this
yourprompt$ ls -l >-rw-rw-r-- 1 username usergroup 46 2007-01-13 14:37 install.bat >drwxrwxr-x 2 username usergroup 4096 2007-01-13 11:49 misc >drwxrwxr-x 6 username usergroup 4096 2007-01-13 14:37 myro >-rw-r--r-- 1 username usergroup 78192 2007-01-28 15:21 myro-1.0.0.zip >drwxr-xr-x 4 username usergroup 4096 2007-01-28 15:23 pyserial-2.2 >-rw-r--r-- 1 username usergroup 45470 2007-01-28 15:22 pyserial-2.2.zip >-rw-r--r-- 1 username usergroup 553413 2007-01-28 15:26 scribbler.exe >-rw-rw-r-- 1 username usergroup 1900 2007-01-11 08:48 setup.py >-rw-rw-r-- 1 username usergroup 977 2007-01-06 22:03 Start Python.pyw
Now let's set up the Scribbler...
I am assumming you are using a recent linux distro, with kernel 2.6.17-10,
since has support for the FTDI serial to usb device that comes with the
Scribbler/serial2USB package.· (If you are using another type of serial
to usb device, you're on your own).
To check for it being recognised by linux type the following command:
youprompt$ lsusb
You should many lines, with one being something like this:
>Bus 001 Device 004: ID 0403:6001 Future Technology Devices International, Ltd 8-bit FIFO
The serial to usb adapter will be /dev/ttyUSB0. (or some variant of that)
To use the scribbler IPRE server through linux utilising WINE do the following:
1. Install the latest version of wine (I'm using Ubuntu 6.10, so I used the
·· built in package manager to download the latest verison of WINE)
··
yourprompt$ sudo apt-get install wine
2. Run winecfg if this is the first time you have used wine,
·· this should initialise your WINE installation.
··
yourprompt$ winecfg
3. Now from you home directory, go:
yourprompt$ cd .wine/dosdevices yourprompt$ ln -s /dev/ttyUSB0 com1
·· This creates a link between the serial2USB adapter and a virtual
·· com1 that WINE will use.· (For more info go to
·· http://www.winehq.com/site/docs/wineusr-guide/misc-things-to-configure)
4. Now you can execute the scribbler program. provided by the IPRE,
·· using the following command line:
··
yourprompt$ wine scribbler.exe /com1
·· You will get some output like this, and a window will pop up
·· showing the transfer.
·
>fixme:setupapi:SetupDiClassGuidsFromNameExA >fixme:setupapi:SetupDiGetClassDevsW : returning empty list >fixme:setupapi:SetupDiEnumDeviceInfo 0x190238 0 0x33fe38 >EVT:101-User selected download from information dialog. >INF:111-PORT=COM1 DEVICE=Scribbler Server LOOPBACK=Yes ECHO=Yes >EVT:104-Downloading to COM1. >EVT:044-Download successful!
5. That's it, the scribbler server program should be uploaded.
Setting up pyserial:
1. Setup up the serial port by creating a com5, by executing the following command:
··
yourprompt$ sudo ln -s /dev/ttyUSB0 /dev/ttyS4
2. Now change into the directory that has pyserial setup file in it
·· (i.e. ~/myrobot/pyserial-2.2 )
3. Then execute:
··
yourprompt$ sudo python setup.py install
Setting up MYRO
1. Go to the directory that has "Start Python.pyw"
·· (i.e. ~/myrobot)
2. Make Start Python.pyw executable:
yourprompt$ chmod +x Start\ Python.pyw
3. Start the program:
yourprompt$ ./Start\ Python.pyw &
4. Now to test our scribby (with in the ILDE window)
IDLE 1.1.4c1 >>> from myro import * Myro, (c) 2006 Institute for Personal Robots in Education [noparse][[/noparse]See http://www.roboteducation.org/ for more information] Version 1.0.0, Revision 1.89, ready! >>> robot = Scribbler("/dev/ttyS4") Waking robot from sleep... Hello, I'm Scribby! >>> robot.beep(1, 800) >>>
Your robot should beep, and now you're ready to go!
JWT/jwt 28.1.2007 15:40 CST
ADDITIONAL INFORMATION
Myro is copyrighted by·the Institute for Personal Robots in Education.
I am NOT associated with the Myro project, I am just an end user,
so if you have·Myro specific questions you should probably check out:
http://wiki.roboteducation.org/wiki/index.php/Main_Page
Also (probably mentioned somewhere in these forums, just don't have time
to look right now) you can use the MicrosoftTM Robotics Studio
to control your scribbler.
http://www.roboteducation.org/scribbler_msrs_readme.html
I haven't tried it myself, but if you have, please share your experience.
JWT/jwt 29.1.2007 00:27 CST
Post Edited (zubernerd) : 1/29/2007 6:32:00 AM GMT
Comments
Is there a way to get the Scribbler to put out +5V on one of the unused serial pins? I would like to use it to power a bluetooth serial adaptor.
-Phil
Update: Corrected error in pin number.
Post Edited (Phil Pilgrim (PhiPi)) : 2/1/2007 8:34:13 PM GMT
-Phil
Post Edited (Phil Pilgrim (PhiPi)) : 2/1/2007 8:35:10 PM GMT
Note to Phil. I'm not measuring any real voltage between pins 8 and 5 on the robot, should I be?
And where did Alan get the 20mA figure?
Yes. Pin 8 is supplied directly with battery voltage through a diode, a PTC resettable fuse, and the on/off switch. This is the only pin from which you should attempt to draw power. See the schematic here.
-Phil