Welcome

This blog details my finding in building and setting up a small web connected humanoid robot.
The first objective of this project is to fully control and monitor the robot from internet.
This will be done by adding a single board computer running a full Linux system connected to the Robovie Nano robot by the serial port and connected to the web by wifi.
Beside web remote control, I will take advantage of the complete Linux system to add some higher functions to this robot (environment analysis, navigation, speech & video recognition,...).

There are several constraints in this project.

At first a limited weight and space . The Nano is a very small robot and the available space is quite narrow (6 x 3 x 2 cm in the back) .
The added weight load must be under 100 gms (Linux board + battery + wlan+ audio + webcam + sensors ) if we want to keep fluid motions and good autonomy.
Due to theses constraints I have to work with a minimal processing power. I am using a Bifferboard from Bifferos running a full Debian Distro at 150Mhz.

The tasks and progress are:

Build Debian kernel & rootf : (done) Debian Squeeze with headers. Linux 2.6.32.2
Wlan (done)
Remote motions control (done)
Remote master slave control : (done)
Video streaming - 2 ways : (done)
Vision/Blob recognitions (not started)
Sound streaming - 2 ways (wip) - can play stream, can record sound
Speech Synthesis (done) - flite working well, espeak is choppy but still usable
Speech Recognition (wip)
Remote Sensors monitoring (done) Battery level, accelerometer, distance, temperature
Lcd usb display (done) - hacked 1.5" key chain
Oled i2c display (wip)
Auto charging (not started)

Saturday, February 26, 2011

SPEECH & MUSIC

A USB sound adapter with the chipset CM119 give much better result than the cheap one I firstly used (with chipset 6911).
I can now play sound (small .mp3, .wav or text to speech with Flite) simultaneously with the webcam streaming and doesn’t experience anymore sound quality issues.

It  can also play web streaming radio with the command:
wget -O - http:/ip address :port number | madplay - -m -o wave:- | aplay



The "Music Fairy" pictured has the smallest pcb. I added 2 x 0.25 W speakers in the Nano hands.

WLAN

I am using a very small wlan USB adapter with the module rtl8192CU compiled from  rtl8192CU_linux_v2.0.939.20100726 (you need to have the Linux header to compile it).
This module was posting quite a lot of messages to the console (issue nulldata to keep alive and issue_nulldata:0) , it can be annoying, I commented out these 2 lines to remove them:



In core folder / rtl871x_mlme_ext.c I commented ligne 2790:
DBG_871X("issue nulldata to keep alive\n");
and line 1507:
DBG_871X("%s:%d\n", __FUNCTION__, power_mode);


Here is my network configuration ( /etc/network/interfaces)


# The loopback network interface - always needed here
auto lo
iface lo inet loopback

# this one for dhcp
#auto eth0
#iface eth0 inet dhcp

# this one for  WIFI
allow-hotplug wlan2
iface wlan2 inet static
pre-up ifconfig wlan2 up
pre-up iwconfig wlan2 mode Managed
pre-up iwconfig wlan2 essid "linksys-G-MIX"

# The primary network interface - use this for cable if WIFI above not used
# in that case disable the WIFI above with # before each line
#allow-hotplug eth0
#iface eth0 inet static

# set these for the LAN address
address 192.168.11.16
netmask 255.255.255.0
network 192.168.11.0
broadcast 192.168.11.255

# set this for the Internet modem gateway to the LAN
gateway 192.168.11.1
# dns-* options are implemented by the resolvconf package, if installed

# my gateway acts as a local dns-nameserver
dns-nameservers 192.168.11.230
dns-search example.org

Pictures & Videos






Monday, February 14, 2011

BIFFERBOARD

This is a fantastic little board, affordable (35 pounds) , very light and compact. it has only 150Mhz processor but it is the price to pay for a minimum  power consumption size and cheap price.

Here are the specifications.

150MHz CPU, Intel 486SX instruction set, MMU.
1 watt power consumption (200mA @5v)
68mm x 28mm x 21mm (weight 28g)
32MB SDRAM/8MB Flash
OHCI/EHCI USB 2.0
10/100 ethernet
Serial console 115200 baud (can be used as 2 GPIO)
4-pin JTAG (can be used as GPIO)
2 permanent GPIO (1 LED, 1 button)

To buy it: http://bifferos.bizhat.com/
Wiki: http://sites.google.com/site/bifferboard/
Group: http://groups.google.com/group/bifferboard



It tooks me a lot of time to build the Debian Distro with the header and all the features and tuning I wanted.
I am now running Debian Squeeze on a Linux 2.6.32.2 kernel.
Basically all the modules are enabled and a wide range of USB devices are  recognised and will work out of the box (bluetooth dongle, Serial ftdi, several Webcams, wifi adapters, USB audio,....).
I used Stuart Hopkins' Debian kernel/rootfs build and installation scripts :

http://www.linux-depot.com/?p=projects&s=bifferboard


(note 1: the .debs links are broken in the rootfs scripts, so you need to compile your own .debs and update the script links)
(note 2: for the 2.6.32.2 kernel build you need to add the relevant config files and patches, you can download them from the Bifferboard repository)

I also collected many good infos from Graham blog below:

http://www.sunspot.co.uk/Projects/Bifferboard/biff_index.html


You can download my Kernel image and Debian rootfs with the header from the links below:

https://docs.google.com/leaf?id=0B6rYc4n12uHTMGViYTcyOGItMDkyZi00YTdiLTljNTEtMjBjMWU3YTNhZDAy&hl=en_US


To install :


Untar the files (all the files are compressed in one folder)

1- flash the kernel.
python bb_upload8.py /dev/ttyUSB0  image_name


2- format your usb disk
mkfs.ext3 /dev/sdx1 (change x with the letter of your usb disk)
tune2fs -c 0 -i 0  /dev/sdx1


3-copy the rootfs folder content to the usb disk


Login = root, Password = root

Notes:

STARTUP SCRIPT:

I added a startup script (clovis_startup.sh) in /etc/init.d (to start the gpio, I2c, wlan,..)
If you modifiy it then type the following at a console line:
update-rc.d -f  clovis_startup.sh remove
update-rc.d -f clovis_startup.sh defaults



BOOT TIME:
between 40s and 1min 20 (depending if you leave or note Lighttpd, i2c, gpio, alsa...)


BUTTON GPIO  to reset WLAN (2 s) or Poweroff (5 s)
Script to add in /etc/rc.local as:    /home/gpio/button2.sh &
(start it with ./rc.local once)
#!/bin/sh
#button2.sh
#Script to add in /etc/rc.local as:    /home/gpio/button2.sh &
#(start it with ./rc.local once)
echo 15 > /sys/class/gpio/unexport #flikker the red led 2 times
echo 15 > /sys/class/gpio/export
echo 16 > /sys/class/gpio/unexport
echo 16 > /sys/class/gpio/export
echo out > /sys/class/gpio/gpio16/direction
echo 1 > /sys/class/gpio/gpio16/value
while : ; do
BUTTON1=`cat /sys/class/gpio/gpio15/value`
if [ "$BUTTON1" = "0" ]; then
   sleep 3
BUTTON2=`cat /sys/class/gpio/gpio15/value`
   if [ "$BUTTON2" = "1" ]; then
echo !!WLAN REBOOT!! > /tmp/lcd4linux.fifo #print !!WLAN REBOOT!! on the lcd screen
echo 0 > /sys/class/gpio/gpio16/value
sleep 1
echo 1 > /sys/class/gpio/gpio16/value

/sbin/ifdown wlan2
/sbin/ifup wlan2

echo wlan rebooted > /tmp/lcd4linux.fifo #print "wlan rebooted" on the lcd screen

   else
echo !!POWEROFF!! > /tmp/lcd4linux.fifo
echo 1 > /sys/class/gpio/gpio16/value
/sbin/poweroff
   fi
fi
sleep 1
done
exit 0