Introduction: Using the IRobot Create's Command Module With Linux
Since iRobot hasn't provided linux users with a way to use the command module, I had to figure it out myself.
Don't be intimidated, its not hard at all, really. All you need to do is run a couple of scripts.
Lets get started, shall we?
Step 1: Get the Goods
For this tutorial, I'm assuming you have an apt-based package manager. (i.e. you use a Debian derivative, or an Ubuntu derivative) Simply because apt = good.
If you don't, I assume that there are the same packages for yum, but I can't test that. (Fedora doesn't like me)
Now, you must run a long and complicated thingymabober:
And yes, removing that package is safe. (Tip from here) If it gives you an error saying its not installed, you're good, don't worry.
If you don't, I assume that there are the same packages for yum, but I can't test that. (Fedora doesn't like me)
Now, you must run a long and complicated thingymabober:
sudo apt-get install avrdude avr-libc gcc-avrsudo apt-get remove brltty
And yes, removing that package is safe. (Tip from here) If it gives you an error saying its not installed, you're good, don't worry.
Step 2: Write/Get a Program
Heres the part where you write your program. But to test it out, lets use a demo program.
The command module comes with a CD, and on it, there are 3 demo programs.To test, use the input program. Copy the folder "input" to somewhere on your computer, such as /home/user/avr/input.
Step 3: Edit Makefile
If you wrote your own program, get a makefile from the CD. If you just copied it over, then you already have it.
Open it up, and use find/replace to edit these two lines:
To...
That wasn't too hard, was it?
Open it up, and use find/replace to edit these two lines:
86: DEBUG = dwarf-2...204: AVRDUDE_PORT = com9 # programmer connected to serial device(Those numbers are line numbers, if you want to do it that way)
To...
86: DEBUG = stabs...204: AVRDUDE_PORT = /dev/ttyUSB0 # programmer connected to serial device
That wasn't too hard, was it?
Step 4: Compile/Download
It hasn't been that hard so far, and this step is no different:
First, plug in the command module, via USB, and make sure it is on. Hit the Reset button. Then go onto your computer and open a terminal. Navigate to the directory where your program/makefile are, and type:
Now, go onto your create, and remove the cable. Then press the reset button, and your program will start!
Congratulations!
First, plug in the command module, via USB, and make sure it is on. Hit the Reset button. Then go onto your computer and open a terminal. Navigate to the directory where your program/makefile are, and type:
make allmake program
Now, go onto your create, and remove the cable. Then press the reset button, and your program will start!
Congratulations!
22 Comments
14 years ago on Introduction
I haven't heard about this iRobot Create thing before, but it's good to know that there is Linux support. I may just go out and get one, since at least I know it'll be usable :-). You mentioned apt-based package managers, but why not just link the source (for those of us who prefer not to use package managers)?
Reply 14 years ago on Introduction
The source, patches, and build instructions for the packages you mentioned all appear to be available here: http://www.nongnu.org/avr-libc/
For anyone who doesn't want to bother with yum/apt/rpm/whatever, this is probably a good place to go. That said, the debian packages may be patched up or may just work differently due to version differences. I don't know.
I've gone through a full from-source avr-libc / avr-gcc / avrdude install before, and it's not too hard.
14 years ago on Introduction
Hi, has anyone managed to get the iRobot Create working on linux without a command module, ie hooked up directly to a laptop with a DB9-USB converter ? If so which exact model of DB9-USB cable turned out to be compatible with linux and the Create ? Also how did you interface with the robot on the linux side... can you just write C or C++ programs that make use of the Open Interface and send raw bytes to the robot for control ? feel free to pm me if you wish to do so. thanks in advance.
Reply 14 years ago on Introduction
I'm posting it here because everyone can benefit from the knowledge :-)
Yes, you can communicate directly with the create using the cable that comes with it that is pictured in the first picture in the "trunk" so to speak & not plugged in. Its a serial-to-proprietary connection; if you don't have the serial, you can use any serial-to-usb converter.
From there, you can use any linux equivalent to realterm, or the command line, to send OI commands. You could also write a program in a language w/ a serial library, too.
Beneith the command module is a DB25 connecter that breaks out a few connections, but I can't recall exactly what they are.
This instructable focused on the fact that iRobot doesn't support GNU/Linux officially, but there's plenty of FLOSS out there to handle it with minimal effort.
Reply 14 years ago on Introduction
Thanks for the reply :)
I've been searching and reading about this robot on the net for several days and went through all the manuals but couldn't find this info and iRobot email support didn't get back to me of course since i am an *unsupported* linux user... so thanks for clarifying.
One more thing though, regarding the serial-usb cable (more specifically a male DB9 to usb), apparently whether this cable works or not depends on the chipset that comes with it, which means it needs to be compatible with linux + compatible with the serial protocol of the Create ?
The following thread highlights this issue, the guy ended up getting (an expensive) PCMCIA-Serial card which isn't an option in my case:
http://createforums.irobot.com/irobotcreate/board/message?board.id=Create_Support&thread.id=1698&view=by_date_ascending&page=2
For anyone interested here is some useful info on various serial-usb chipsets under linux, i believe most cables are PL2303.
http://www.nslu2-linux.org/wiki/Peripherals/USB2Serial
Reply 14 years ago on Introduction
I tried a cheap USB-serial cable that did not work. Now I'm using a Keyspan 19HS which has worked well from several platforms (linux,mac,win).
Reply 14 years ago on Introduction
The iRobot cable is standard RS232, so any serial-usb cable should do. I'm lucky enough to have two serial ports, so I haven't looked into it much.
Reply 14 years ago on Introduction
forgot to post this, another person with serial-usb cable(Aten) trouble... though i'm not sure if that's related to C++ specifically or the actual cable/linux drivers:
http://irobotcreate.lithium.com/irobotcreate/board/message?board.id=Create_Support&thread.id=1836
15 years ago on Introduction
i'm husni, i'm a newbie...how to get example project with avr-gcc..used to i make line follower with linux
15 years ago on Step 1
You tips seem pretty good for getting started with Linux+iRobot. I had no idea where to start. Hopefully I'll be able to add my own instruction later on. I have Fedora installed and gcc-avr is avr-gcc.
16 years ago on Introduction
I've updated the required packages to JUST the ones you need.
16 years ago on Introduction
Update: Realterm works in Linux with WINE, however, I couldn't get it to work with the create. When I turn it on, I do get data from the create, so its close, but not quite.
16 years ago on Introduction
Cool. I'm using Fedora 7 and I found all of the files using my Package Manager except for avrp avr-prog and avra. Working on getting them now... do you know where I could find them online?
Reply 16 years ago on Introduction
Chances are, you probably don't need them :P avrdude is the most important one.
Reply 16 years ago on Introduction
Ok, just making sure. I've tried compiling and loading programs, and make all works, but make program works. It's writing to the USB device that's weird (there's no ttyUSB0 file in /dev). I think once I find the substitute for the USB file on Fedora, I'll be fine. Any advice finding the right one without testing a bunch that might be right? ;) Thanks.
Reply 16 years ago on Introduction
If theres no ttyUSB0 file in /dev, make sure you uninstall the other package. For me, I'd plug it in, the file would appear, and then it would vanish. I don't know if you're programming a create, or just an AVR, if its the latter, it could be on the parallel or serial port.
16 years ago on Introduction
No, don't worry, this is not my contest entry. I just wanted to let those who love linux. (I know you're out there!) Theres a Mac tool on their site, if you're wondering.
Reply 16 years ago on Introduction
Down with Billy G. and up with linux! Anything develpoed by a community and not a trillion dollar comany truely fits the instructable mindset. Great instructable.
Reply 16 years ago on Introduction
Thanks :D A note, you can use this to program any AVR uC. You'll need a different makefile, however.
16 years ago on Introduction
*Stares at create* *Sits patiently in front yard* Have you tried using the serial cable (the one that plugs directly into the iRobot) with linux?