Setup the gumstix
From Skybotix
Contents |
First Connection
The Coax electronic board has a mini-usb port. This port is linked to FTDI chip that will be seen as a serial-to-usb adapter by the host computer. Use any USB-A to mini-USB cable to connect to this port (most digital camera are delivered with it). Under windows, the serial-to-usb adapter should be recognised and installed automatically. Use the device manager to find its name (e.g. COM5 or COM23...). You can then use hyperterminal to open this serial port (115000 baud, 8bits, 1 stop bit, no parity, no hardware flow control).
Under recent linux (ubuntu, debian, suse...), the adapter will also be recognised automatically, and a device /dev/ttyUSB0 will be created (unless you have other serial-to-usb adapter plugged in). You can then use your favorite serial port terminal to access the device (minicom, kermit, ...). I use gtkterm for its graphical interface and ease of use:
gtkterm -p /dev/ttyUSB0 -s 115200
If you're connected while the gumstix is booting you will see all the boot message, finishing by the login prompt. If you're connecting at the end of the boot, just type enter to get the login prompt.
From coax serial number 30, the gumstix is installed with a stripped-down version of ubuntu 9.04, for the ARM chip. The default login is coax, with password coax, The root password is gumstix.
For previous systems where the open-embedded root file system was used, The default login was root, with no password.
The first thing to do to test your coax, is to go into the coax/gumstix/bin directory (was build-gumstix/example before coax 30), and run
./monitor /dev/ttyS0
That should connect to the coax firmware and give a constant stream of information about the coax state.
This will only work once the firmware has booted completely (after the 3 beeps). This means you must have a remote control switched on while doing this test
If everything worked until here, your setup is working properly
Configure networking
There is a three stage procedure to configure networking on the gumstix:
- first, ensure that the wireless card has been detected properly. It should be listed when running lsusb, and a wlan0 or ath0 should be present when typing iwconfig or ifconfig.
- second, prepare a wireless router or access point with a known SSID, and no encryption (to start with). Let's assume that the ssid is coaxnet
- on the gumstix:
- edit the file /etc/wpa_supplicant/wireless.conf and replace the ssid in there with coaxnet
- edit the file /etc/network/interfaces to set a fixed IP or configure DHCP
- edit the file /etc/init.d/wpa_supplicant to uncomment the relevant part in the test and start section
- run /etc/init.d/wpa_supplicant test to check that your connection is coming online
Once you are confident that the wireless setup is working, edit /etc/init.d/wpa_supplicant to comment out or remove the "exit 0" line. Once the line is commented, the system should be able to find the network by itself at its next reboot.
If you need to have a more complex setup, please look at the manual for wpa_supplicant
Also note that the wireless-n driver is currently a bit unstable. In particular, starting and stopping the wpa_supplicant daemon several time can crash this driver. In transmission mode, we had no particular problem with the driver, even when transmitting video frames at 25 fps.
Configure video transmission (for the Targus webcam)
For convenience and ease of testing, we've pre-installed a webcam server on the coax. It is called mjpeg_streamer and the sources are available in the root's home directory on the coax.
Before running this tool, run lsusb and check that the camera is detected correctly. There may be some error messages about usb errors. They are not critical and do not prevent from using the camera.
To test the camera, run:
/etc/init.d/mjpg_streamer test
If the camera is detected properly, the tool shows a summary of the setting that are used, and in particular which TCP port is used for communication. It should be port 80 (HTTP) or 8090.
Check that your wireless networking is setup correctly.
Assuming the coax IP is 192.168.0.5 and the port is 8090, use a browser (firefox preferred, but also works with internet explorer) to access [1]. This should provide a test interface for the web-cam server from which you can access streaming data.
Streaming parameters can be modified by editing the /etc/init.d/mjpg_streamer file.
If you want the streaming to start at boot time, edit the /etc/init.d/mjpg_streamer file and remove the "exit 0" line.
Please note that this type of streaming is prone to congestion, and loss of quality due to jpeg encoding and to the unreliability of the video link. In order to do vision-based control we recommend either running the control software on the gumstix (opencv can be compiled for the gumstix) or using a home made UDP transmission of the image. Please contact us if you need more information on this process.
The transmission quality can vary incredibly depending on the environment, the number of networks active and other unknown parameters. This is inherent to the wifi transmission and should be taken into account when designing a control system.
If using the Firefly camera, you can access it with any libdc1394 program. We only provide an example program using the ROS (www.ros.org) middleware. First run
roscore &
Go to the ~/ros/bin, and run
./dcam1394
to test it. You will then have to use the image_view program from ROS to visualise the image. Check the ROS wiki for more details.
Configure coax telemetry
The coax firmware is only communicating through its bluetooth serial port and its normal serial port to the gumstix. In order to receive commands from the wifi and send data through the wifi, a small program called repeater has been developed. It is installed in /root/build-gumstix/repeater/repeater and a startup script has been prepared to start it during the boot process.
If you need this functionality, edit the /etc/init.d/repeater script, and remove (or comment) the "exit 0" line.
If you just want to test this functionality, run
/etc/init.d/repeater test
Stop it using Ctrl-C
While the repeater is running, no other program on the gumstix can access the coax firmware (in particular monitor will not work).
Please be aware that running a controller over a wireless link is risky due to the inherent unreliability and undeterminism of the wifi connection. There will be delays and losses of packet. Please design your controller in consequence, or modify the repeater program (CD: api/repeater/repeater.cpp) to account for that
Prepare a new SD card
Use the following link to prepare a new SD card for the gumstix: Create a bootable microSD card
Then, the flash/overo-boot-FAT.tar.gz can be untar'ed in the FAT partition:
cd /media/FAT; tar zxvf <path-to>/overo-boot-FAT.tar.gz
And the flash/overo-linux-e2fs.tar.gz can be untar'ed in the linux partition:
cd /media/disk; tar zxvf <path-to>/overo-linux-e2fs.tar.gz
