Overo Extension
From GCtronic Wiki
This is a mini how-to of the e-puck extension board for the Gumstix Overo COM.
Contents |
Introduction
This introductory section explains the minimal procedures needed to work with the Gumstix Overo computer-on-module (COM) mounted on the e-puck extension board and gives a general overview of the available demos and scripts shipped with the micro sd. The extension is mostly an interface between the e-puck robot and the Gumstix Overo COM.
Gumstix Overo COM: product information and programming information,
General procedure
The e-puck extension board for the Gumstix Overo COM comes with a pre-configured system ready to run without any additional configuration. The whole system is installed on a micro sd and is composed of:
- U-Boot (bootloader customized for the hardware)
- OMAP35x Linux TI-PSP http://arago-project.org/git/people/?p=sriram/ti-psp-omap.git;a=summary (linux kernel)
- some demos and useful scripts in the /home/root directory
It's important to note that the flash isn't reprogrammed, so it will contain the factory system.
In order to access the system from a PC (console mode), the following steps must be performed:
- connect the USB cable: mini-USB to the extension module and the other side to the PC
- execute a terminal program (e.g. minicom) and configure the connection with 115200-8N1. The serial device path should be typically something like "/dev/ttyUSB0". Make sure that the flow control parameter of minicom called "Hardware" is set to "No".
- switch on the robot; now the terminal should display the Gumstix Overo booting information (booting time 25-30 seconds)
- login with user=root, password=root
Wireless setup
Wireless configuration using a script
The script setupWifi placed under /home/root/scripts is used to configure easily the wireless network (managed mode) and need to be adapted to your specific situation. The script is shown below:
#!/bin/bash ifconfig wlan0 up iwconfig wlan0 essid SSID key HEX_KEY iwconfig wlan0 ap MAC_ADDRESS iwconfig wlan0 rate 54M ifconfig wlan0 LOCAL_IP netmask SUBNET_MASK route add default gw GATEWAY_IP
To know the available wifi networks and related information such as mac address of the access point, you can issue the command iwlist scanning wlan0.
If you're using dhcp, you can instead adapt the script setupWifiDhcp found under /home/root/scripts:
#!/bin/bash ifconfig wlan0 up iwconfig wlan0 essid SSID key HEX_KEY iwconfig wlan0 ap MAC_ADDRESS iwconfig wlan0 rate 54M dhclient wlan0
The parameters that must be customized are shown in capitals; after that you can execute the script typing ./setupWifi (or ./setupWifiDhcp) and after a while a message should be displayed indicating that the wireless is ready. You can test the network configuration using ping.
Usually, when the Wifi dongle is connected to the AP, a message is written in the message buffer of the kernel. The following bash code snippet can be used to make sure that the connection is well established when the program returns:
#!/bin/bash
echo Wait until the Wifi is connected to the AP
while true
do
#the text "link becomes ready" can vary according the Wifi dongle
a=$(dmesg | grep wlan0 | grep "link becomes ready")
if [ -n "$a" ]
then
echo Wifi enabled!
exit
fi
sleep 1
done
Wireless configuration using a wpa_supplicant
Alternativerly, the Wifi connection can be set up by using both wpa_supplicant and the native wifi setup. This has the advantage to be more robust against failure. In order to do that, the Wifi interface can be added to /etc/network/interface, this way:
auto wlan0 iface wlan0 inet static address 192.168.1.2 netmask 255.255.255.0 wpa-conf /path/to/wifi.conf #this should be replaced by the absolute location of wifi.conf
And the related wifi.conf
ctrl_interface=/var/run/wpa_supplicant
ctrl_interface_group=0
ap_scan=1
network={
ssid="myssid" #this should be replaced by your ssid
scan_ssid=1
key_mgmt=NONE
wep_key0=1234567890 #this should be replaced by your WEP key
wep_tx_keyidx=0
}
In this example, static IPs and WEP encryption have been used. DHCP and other encryption can be obviously used by following the documentation both of the linux native network setup and of wpa_supplicant.
Network performance
To test the network performance you could use the iperf tool installed on the system. In the server side you must issue the following command (either for TCP or UDP testing), after which the server machine is listening for incoming data:
iperf -s [TCP] iperf -s -u [UDP]
In the client side you must type:
iperf -c SERVER-IP [TCP] iperf -c SERBER-IP -u -b 50000000 [UDP]
Where SERVER-IP must be changed accordingly to the network configuration.
Package manager
If you have an internet connection up and running you can update and install easily new packages with opkg. Some of the useful operations you could do are:
- update installed packages:
opkg update opkg upgrade
- list of software currently installed on the machine:
opkg list_installed
- install a new package (perl in the example):
opkg update opkg install perl
- remove a pacakge (perl in the example):
opkg remove perl
- list of all packages available to be installed:
opkg update opkg list
USB ports
The e-puck extension board for the Gumstix Overo COM comes with two USB interfaces called USB host and USB otg. If you try inserting devices that require more energy than the one permitted on the otg, the device will not be enabled automatically. In these cases you can use the three scripts usbup, usbdown and usbenable to respectively power up, power down and enable the USB device; they're placed under /home/root/scripts. These scripts are intended for primary use with the USB otg port, even if they're suitable for both ports (otg and host).
- ./usbup otg (or ./usbup host): power on the usb device
- ./usbdown otg (or ./usbdown host): power off the usb device
- ./usbenable otg (or ./usbenable host): activate the usb device (now is in the usb device list)
Demos
A specific firmware must be charged on the e-puck to run the Gumstix Overo linked demos (MPLAB project, hex). Essentially in this firmware a new version of the advanced sercom is included (selector position 10) in which the bluetooth communication is replaced by the serial line communication, running at 230400 between robot and gumstix. Moreover the I2C is disabled temporary from the dsPIC side (the dsPIC cannot communicate through I2C) in order to avoid conflicts. As a last note, the body led and front led aren't anymore usable with the extension due to the two extra long range proximity sensors and for power saving purposes the motors are configured to the minimum energy consumption during movement.
Serial test on the Gumstix Overo COM
This small program read and write from a serial port (non-canonical mode). For more information on the usage refers to sertest. It's placed under /home/root/demos, and it's called sertest.
Advanced sercom
Once the new firmware is running on the e-puck, the selector must be set in position 10 to run the advanced sercom for the Gumstix Overo.
Now you can type (after being in /home/root/demos) ./sertest -p /dev/ttyS0 -b 230400 (or simply ./ser+ENTER)to enter the e-puck menu in console mode. After stopping the sertest program (CTRL+C), the display may not respond correctly; to reset the display run the script r by simply typing ./r+ENTER. Now the display should behave normally.
Images grabbing (camera driver)
A small application called v4l2grab (v4l2grab.c) based on http://github.com/twam/v4l2grab was used for grabbing JPEGs from V4L2 devices. In order to get an image from the e-puck camera you need to run the program typing (after being in /home/root/demos) ./v4l2grab -o image.jpg. For more information on the options available refer to ./v4l2grab -h.
Images transfer (camera driver)
This demo is divided in two parts: one running on the e-puck extension board for the Gumstix Overo COM that continuously request images to the e-puck camera and transfers them over UDP, and the other running on a PC that acts as a server and is listening for the images visualizing them as soon as they are available. A network link must be established between the two in order to run this demo; for more information on how to configure the network refer to the section Wireless configuration.
First of all you need to start the server (Receiver QT project). The application is a Qt project, so the compilation may be handled easily with Qt Creator; alternatively qmake can be used. The usage is very simple: the server listening port and the protocol (only UDP available at the moment) must be selected first, then click on the button Connect; at this moment the application is waiting images.
On the e-puck extension board side, you need to run the program typing (after being in /home/root/demos) ./v4l2grab-send -o image.jpg -i SERVER_IP -p SERVER_PORT -f 0 -t 0. SERVER_IP is the address of the PC and SERVER_PORT should be the same as configured when the receiver was started. The f option indicates the format (in this case RGB) and t indicates the transfer mode (0=UDP, 1=TCP but still not available).
For more information on the options available refer to ./v4l2grab-send -h.
The sources for the sender, that is an extension of the v4l2grab application, could be found in the following link v4l2grab-send.zip; in order to compile the application the Makefile must be modified specifying the path to the cross-compiler (for more information on cross-compilation for the OMAP3530 processor refers to http://focus.ti.com/docs/prod/folders/print/omap3503.html).
Music player
This isn't really a demo, it's only one of the possible way on how to listen something from the extension module. The system comes with a tool called mplayer that supports many multimedia formats. You can use it to play for example an mp3 file in this way:
mplayer file.mp3
You can then adjust the volume with the alsamixer tool (DAC2).
File transfer
ssh
The e-puck extension board for the Gumstix Overo COM supports ssh connections through dropbear (small SSH 2 server and client) that is installed on the system.
To exchange file between the module and the PC, the scp tool (secure copy) will be used; the general command is the following:
scp user@ip:path-to-file file-name
As an example of transfer a file from the PC to the extension, let the PC user be stefano and its IP be 192.168.1.10, then the command will be:
scp stefano@192.168.1.10:/home/stefano/file-to-send prova
The file file-to-send will be renamed in prova and placed in the current directory.
zmodem
The following instructions to exchange data between the extension and the computer refer to minicom as the terminal.
If you want to receive a file, that is transfer a file from the PC to the e-puck extension board for the Gumstix Overo COM, you need to follow these steps:
- open a terminal window with minicom; now you access the linux system in console mode
- type lrz
- press CTRL+A and then S
- select zmodem and navigate to find the file you want to tranfer
- select the file with the SPACEBAR and then press ENTER to start the transfer
- when transfer is complete press ENTER once more to come back to the command line
For more information type lrz -h.
If you want to send a file, that is transfer a file from the e-puck extension board to the PC, you need to follow these steps:
- open a terminal window with minicom; now you access the linux system in console mode
- type lsz file-name, where file-name is the file you want to transfer
- when transfer is complete press ENTER to return to the command line
The file will be placed in the directory where minicom is started. For more information type lsz -h.
Extension LEDs
The e-puck extension board for the Gumstix Overo COM comprises 8 new small leds that can be turned on/off easily from the file system in this way:
echo 1 > /sys/class/gpio/gpio7x/value [turn on] echo 0 > /sys/class/gpio/gpio7x/value [turn off]
where x ranges from 0 to 7. For more information on gpio refer to the section GPIO - pins mode.
File system image
You can download the entire system running on the micro sd shipped with the e-puck extension board from the following links: file system, FAT.
In order to prepare the micro sd you can use a script (prepareMicroSD.sh), in which you need only to specify where to find the two previously downloaded files and run it (./prepareMicroSD.sh /path/to/dev) to have your micro sd ready to be used.
Daemon
It can be useful to start a daemon at the end of the boot process in order to run your own program at the start up of the e-puck (the console mode won't be accessible). This can be done by extracting this file into /etc/init.d and then:
cp /path/to/your/executable /usr/sbin/mainProgram cd /etc/init.d update-rc.d mainProgram defaults 99
The daemon can be removed by removing these files:
rm /etc/rc*/*mainProgram*
Hardware
The following figure shows the main components offered by the e-puck extension for the Gumstix Overo COM and their interconnection with the e-puck robot and the Gumstix Overo COM.
In particular there are:
- a Gumstix Overo COMs: compatible models are the Gumstix Overo Earth COM and the Gumstix Overo Water COM. The communication between the Gumstix Overo COM (OMAP 35xx) and the e-puck (dsPIC) is handled with a serial line at 230400 baud
- a mini-usb connector (console) used to enter the linux system through a terminal
- one usb otg and one usb host: these two connectors are really useful to connect whatever peripheral you need, like a WiFi dongle or simply a pen drive to extend the memory
- a speaker (speaker specification): with Linux running on the Gumstix Overo COM, it's really easy play any audio format you need or implement a speech synthesizer. If the user prefer to have the speaker on the extension linked to the e-puck processor, it can simply be done changing two small resistors
- 8 LEDs: have you ever seen a board without leds?! Anyway they are completely controllable through gpio lines (gpio70-gpio77), for detailed information refer to "Configuration" chapter afterward
- an I2C connector (5 V)
- a rotary selector: you can choose what program is running on the e-puck based on the selector position
- 2 long range proximity sensors (long range specification)
- the PixelPlus PO6030 camera remains mounted on the robot, but you could receive image from it by using the OMAP ISP (Camera Interface Subsystem); this way we can receive up to 18 frames per second (VGA color images)
The following figure illustrates where the components are physically placed on the e-puck extension board for the Gumstix Overo COM.
Electrical schema
The circuit diagram of the e-puck extension for Gumstix Overo COM is available to the community on the following link electrical schema.
Long range proximity sensors
The following chart illustrates the long range proximity sensors response towards a white surface. These results should be considered indicative.
A zoom in the bigger distances shows that the values returned from the sensors are still usable to react to obstacles.
WiFi dongle
The WiFi dongle shipped with the extension board for the Gumstix Overo COM is a ZyXEL NWD271N USB adapter, 802.11n compatible. It's based on an Atheros chipset, for more infromation about the linux driver visit the following site http://linuxwireless.org/en/users/Drivers/ar9170.
The measured throughput with the e-puck extension and provided wifi dongle is 20 Mb/s.
The consumption of the wifi dongle is 100 mA in standby and 300 mA when active.
Consumption
The consumption of the robot and extension is 300 mA; with the Zyxel wifi dongle inserted (standby) the consumption goes up to 400 mA; when the wifi dongle becomes active, the consumption reaches 700 mA.
Two different tests were performed to provide an estimation of the duration of the battery:
- e-puck and gumstix active (gumstix sends commands via serial to robot; movement every 3s lasting 1s at 30% of maximum speed): 3h e 30 minutes
- e-puck, gumstix and wifi active (same as above, moreover wifi active all the time with continuous ping): 1h e 25 minutes
External power
In the package you'll find also an external power adapter that will be useful during development of your applications. As power supply you could use the one of the e-puck battery charger. The following figure shows the power supply cable, the external power cable and the extension.
You need to simply attach the power supply in one side, and the other side of the external power cable on top of the extension (near the USB plug). Once the cable is connected a green led should turn on indicating that the extension is running.
The external power cable could also be plugged in when the extension is mounted on the e-puck, but pay attention to not turn on the robot when the external cable supplies the energy, otherwise there could be serious damages of the devices.
Software
System images
Refer to http://www.gctronic.com/doc/index.php/Overo_Extension#File_system_image for information about the file system released with the e-puck extension for Gumstix Overo COM.
The complete kernel sources (comprising the camera driver) can be downloaded from the following link gctronic-ti-psp-omap-2.6.32.zip.
Moreover if you need you can find pre-built images for the Gumstix Overo in the following link: http://www.gumstix.net/overo-gm-images/v0.92.
OpenCV
The Open Computer Vision Library has more than 500 algorithms, documentation and sample code for real time computer vision; you can download it from http://sourceforge.net/projects/opencvlibrary/, and find information about it from the official wiki http://opencv.willowgarage.com/wiki/.
Opencv-linux 1.1pre1 version
OpenCV can be easily installed on the Gumstix Overo COM, following these steps:
- 1. Donwload OpenCV.
- 2. Extract the content (tar -xzvf opencv-1.1pre1.tar.gz) of the file in a directory, let it be in "opencv".
- 3. Open a terminal, and access the directory (cd path/to/opencv).
- 4. Configure the environment in order to use the cross-compilation tools (if you installed OpenEmbedded, you can find these tools in /tmp/cross/bin/ within the OE main directory):
export CC=/path_to_OE_home_dir/tmp/cross/bin/arm-angstrom-linux-gnueabi-gcc export CXX=/path_to_OE_home_dir/tmp/cross/bin/arm-angstrom-linux-gnueabi-g++
- 5. Now configure OpenCV with the following command; in this configuration several packages are disabled (e.g. gtk) because useless when using console mode to work with the gumstix. Another important option is prefix, which tell where the OpenCV library will be installed. For more information on the configuration refers to the help (--help).
./configure --host=arm-linux --build=i686-linux --prefix=/install_dir_path/ --without-gthread --without-gtk --without-python --disable-apps
- 6. Type make and then make install; the directory specified with the prefix options will contain the compiled library.
- 7. Copy the content of this directory to the gumstix, for example in an external SD card.
- 8. Before trying to execute an OpenCV based application, you must specify to the system where to find the OpenCV library; you can do this by typing the following command; alternatively it's possible to install directly the library in the /usr/lib directory in the system.
export LD_LIBRARY_PATH=/path_to_OpenCV/lib
A detailed tutorial on the OpenCV setup for Gumstix can be found in the following link Compiling OpenCV for Gumstix.
Later versions (> 1.1)
Later versions of OpenCV (current is 2.0.0) rely on CMake, the cross-platform, open-source build system.You can install it in Ubuntu by typing sudo apt-get install cmake; you can also install a nice front-end for CMake by typing sudo apt-get install cmake-gui; in this way the configuration process of OpenCV becomes easier.
Follow the steps afterwards to get the newer version of OpenCV compiled for the gumstix:
- 1. Donwload OpenCV.
- 2. Extract the content (tar -xzvf opencv-2.0.0.tar.gz) of the file in a directory, let it be in "opencv".
- 3. Start the CMake interface, by typing in a terminal cmake-gui.
Configuration
Graphic mode
The resolution of the monitor can be modified in the u-boot command line, that can be entered at booting. In the u-boot command line type:
setenv dvimode "1280x720MR-16@60" saveenv boot
Now the configuration is saved in the flash; if your monitor doesn't support the current resolution, repeat the procedure with a different configuration (change the resolution numbers).
Note that the DVI Controller (TFP410) mounted on Summit and Tobi supports resolutions from VGA (640x480) to UXGA (1600x1200).
Useful files to look at:
- linux_source_home/drivers/video/modedb.c: explains what's the mean of the dvimode names
- linux_source_home/Documentation/fb/viafb.modes: list of available modes usable with the fbset tool
GPIO - pins mode
There are three different ways to read GPIO lines:
- 1. Kernel space: GPIO lines handled through an API
- 2. User space:
- 2.1. standard filesystem commands like cat and echo (static configuration)
- 2.2 direct physical memory access using devmem2 or with a C application (dynamic configuration)
Afterward will be explained how to handle the GPIO lines on the Gumstix Overo COM in all different methods; information about this topic were found from various sites, but especially from the gumstix-users mailing list. Moreover for a general howto on GPIO refers to the linux documentation "KernelSrc/Documentation/gpio.txt".
Kernel space
User space
Static configuration
Each of the microprocessor IO pins can be configured to work in different ways for different purposes; in case we desire a certain pin to be configured as a gpio line, we must modify the function assigned to that pin (mux configuration) in the U-Boot board configuration file, that for the Gumstix Overo COM is located at "U-BootSrc/board/overo/overo.h"; you can have a look at it here.
To know which modes are available for the pins consult the chapter 7-System Control Module (more specifically 7.4.4-Pad Functional Multiplexing and Configuration) in the OMAP35x TRM.
Assume we want to have the possibility to switch on and off a led attached to the line gpio70; in order to accomplish this task, we need to follow these steps:
- 1. Modify the board configuration file "overo.h" specifying that the pin has to behave as a gpio line:
MUX_VAL(CP(DSS_DATA0), (IDIS | PTU | DIS | M4)) /*DSS_DATA0 => GPIO70*/\
- IDIS = input disable, namely output pin
- PTU = pull type up, but could be also PTD (pull type down) because of the third parameter
- DIS = disable pull type up/down
- M4 = mode 4 (gpio)
- This give us a GPIO pin that is output and not pulled up or down.
- 2. Build U-Boot and place the generated u-boot.bin image in the flash (Writing images to onboard nand) or in a micro sd card (Creating a bootable microSD card)
- 3. After login, we can see all the GPIO pins that have been exported by the kernel to userspace in the /sys/class/gpio/ directory. In order to access the gpio70 line, we should export it first, by typing:
echo "70" > /sys/class/gpio/export
- Now the following line is active /sys/class/gpio/gpio70.
- 4. At this point we must configure the direction of the exported line and set a logical value (1 or 0) to that line, we can do that by typing:
echo "high" > /sys/class/gpio/gpio70/direction
- This command set the pin in output and give it a value of 1.
- 5. Finally we can switch on or off the led, by setting the value of the gpio line:
echo "value" > /sys/class/gpio/gpio70/value
- Where value=1 means switch on, and value=0 means switch off.
In order to automate the process of creating a gpio line accessible through "/sys/class/gpio/", we must modify the board configuration file in the kernel source; this file can be found in "KernelSrc/arch/arm/mach-omap2/board-overo.c" (and related definitions in "KernelSrc/arch/arm/plat-omap/include/mach/board-overo.h"). These files must contain instructions to initialize the gpio line that we want to export in user space and set their direction and initial value.
Consider the previous example in which we would like to control a led with the gpio70 pin; for this purpose the following instructions must be added in the board configuration file board.overo.c within the overo_init function:
if ((gpio_request(70, "OVERO_GPIO_DD00") == 0) && (gpio_direction_output(70, 1) == 0)) {
gpio_export(70, 0);
gpio_set_value(70, 1); //not really needed, the initial output value is set with gpio_direction_output
} else {
printk(KERN_ERR "could not obtain gpio for OVERO_GPIO_DD00\n");
}
After this modification we need to build the kernel and copy it to the flash or micro sd card, and after login we will have the /sys/class/gpio/gpio70 line automatically active.
For more information on the previous snippet code refers to "KernelSrc/Documentation/gpio.txt".
Dynamic configuration
If you aren't familiar with modifying and building U-Boot and kernel, you would probably choose to modify the pin configuration at runtime, without the need to touch any board configuration file. The only way to change the configuration of the pins is to access directly the physical memory of the microprocessor, in particular its configuration registers.
The utility devmem2 allows for easy reading and writing of the memory; after building and installing this utility on the Gumstix Overo COM, you are ready to change the ports functionality. Consider the previous example of the led on gpio70, to change the pin mode to gpio you must issue the following command:
devmem2 0x480020DC b 0x14
0x480020DC is the address of the register we want to write to and can be found observing the table 7-4 on chapter 7.4.4.3 of the OMAP35x TRM; b means we want to write a byte to that register and finally 0x14 is the value we want to write. The pin mode depends on the last three bits, in this case the mode is set to 4, namely the pin is a gpio. From now on we can follow steps from 3 to 5 of the previous chapter to switch on and off the led.
An example on modifying the pins configuration through the C programming language can be found in the following link gpregs.c.
Useful links/resources
For more information on GPIO usage, have a look at the following links:
- "KernelSrc/Documentation/gpio.txt"
- gumstix-users mailing list
- http://www.gumstix.net/wiki/index.php?title=GPIO
- http://www.avrfreaks.net/wiki/index.php/Documentation:Linux/GPIO
- http://www.hy-research.com/omap3_pinmux.html
- http://focus.ti.com/docs/prod/folders/print/omap3530.html
- http://pixhawk.ethz.ch/omap/start
- http://docs.blackfin.uclinux.org/doku.php?id=gpio
FAQ
1. Why the serial communication between Gumstix Overo COM and the robot doesn't work?
There could be three possible reasons for the communication problem:
- selector position incorrect: you need to be sure that the robot selector is in position 10 in order to start the right software on the robot side
- wrong device: the serial device is identified as /dev/ttyS0 in the linux machine, be sure to use it when you're using for example the sertest demo ("./sertest -p /dev/ttyS0 -b 230400")
- battery discharged: somebody could be deceived from the fact that the linux console is still usable, but if the orange led on the robot indicating the low battery level is turned on, then the robot will not be able anymore to respond, even if you are working on the linux console; either change or charge your battery and try again.
2. I am able to communicate with the robot through the serial line, but seems that I receive only garbage, why?
Probably the baudrate isn't correct; with the robot selector in position 10 you need to configure the baudrate at 230400 (e.g "./sertest -p /dev/ttyS0 -b 230400").
3. Can I use bluetooth to connect to the robot? Can I use the monitor?
Yes, you can connect to the robot with bluetooth and play with the monitor interface placing the selector in position 3. You'll experience some errors on the values displayed on the monitor due to the additional two long IR sensors that aren't considered when the interface was developed; moreover you will not be able to receive images from the robot.
Videos
Comments: We have sent an e-puck on a mission to find our office plant. It's actually a standard e-puck with a wifi connection to the laptop and the Gumstix's overo extention with Linux OS, all runned by a powerful 0.6 Ghz processor.
Comments: This e-puck is on an exploration, his camera sends continuous image to the computer with a wifi connection.
Useful links
http://www.gumstix.net/
viagra en ligne
http://gumstix.net/wiki/index.php?title=Main_Page
essay
http://docwiki.gumstix.org/index.php/Gumstix_Buildroot_Support_Wiki
http://docwiki.gumstix.org/U-boot
http://wiki.openembedded.net/index.php/Main_Page
http://www.e-puck.org/
Mutuelle santé pour être bien protéger mutuelle

