Important Requirements
You will need a JTAG cable like the Olimex ARM-USB-TINY
and a IIB2400
debug board in order to be able to flash the imote2. This is
necessary, as flashing via USB is not yet supported in UNIX (this also
applies to Windows and OS X users, since they are going to use a Linux
image) .
Installing TinyOS 2.1.0
There are two methods available to install TinyOS in your machine,
depending on the Operating system you are using. If you have an UNIX
system, you can compile and install the needed
software and drivers, or you can use a VMWare image
packed with all the software required. If you are using Microsoft
Windows or Mac OS X, you will need the VMWare image.
Instead of installing the software and drivers, you can use an
(X)Ubuntu Virtual Machine Image in VMware Player, which contains
tinyos-2.x-contrib with all the tools and drivers required to use the
imote2 sensor board
- Ubuntu 9.10 VM Image (tinyos-2.x-contrib included): Download
here
- XubuntuOs 2.1 VM (You must install Openocd which is not included
in this VM): Download
here
Follow the instructions in this page where you
can find the scripts to install Tinyos 2.1, openocd and
the drivers for Olimex ARM-USB-TINY. Important: if you prefer
to install the deb packages (instead of compiling it) for the Cross
Compile GCC for XScale, you can download the script here.
Cross Compile GCC for XScale on Ubuntu
This script installs gcc for cross compilation for the Xscale
processors, used by the IntelMote2. You must have root privileges
to execute this script.
Download here
Installing Openocd (if you choosed the XubuntuOs 2.1 VM)
Follow the intructions on this page.
Compiling, Installing and Using the CameraJpegTestSerial application
by Marcin Szczodrak (Feb 12, 2010)
How to use simple camera application.
- $ cd
~/intelmote2 or cd /opt/tinyos-2.x-contrib/intelmote2
- $ cd
apps/cameraTestJpegSerial
- attach the imote2 and camera board to the debuggin board
- connect the JTAG cable to the debuggin board
- connect the mini-USB cable to the debuggin board
- $ make
intelmote2 install openocd
- you should see:
Programming imote2 with binary: build/intelmote2/main.bin.out
Starting
OpenOCD...
Connecting to OpenOCD...
Halting
device...
Erasing
flash...
Writing
image...
Resuming
device...
Doing
cleanup...
if openocd
hangs at "Starting
OpenOCD..." unplug the mini-USB and plug back and
run again
$ make intelmote2 install openocd
- open another shell window and run serial forwarder
java
net.tinyos.sf.SerialForwarder -comm serial@/dev/ttyUSBx:115200 -port 9002
where x is the usb port number where the mini-USB cable is
plugged
- go back to the previous shell window where you have compiled the
code
- cd java
- make
- ./run
When compiling the cameraTestJpegSerial
application, you may have the following errors:
No such file or directory: ov7670.h
To correct this problem you have to edit the /opt/tinyos-2.x-contrib/intelmote2/apps/cameraTestJpegSerial/cameraJpegTestM.nc
file, and change line 43 from #include "ov7670.h"
to #include
"OV7670.h".
No such file or directory: XbowCam.h
To correct this problem you have to edit the /opt/tinyos-2.x-contrib/intelmote2/tos/sensorboards/xbow_cb/XbowCamM.nc
file, and change line 58 from #include
"XbowCam.h" to #include
"xbowCam.h".
Return to step 6
Compiling, Installing and Using the modified CameraJpegTestSerial
application
This is a modified version of the CameraTestJpeg Java GUI that is
found in the "imote2/apps/" directory of the tinyos-2.x-contrib branch.
This version lets you visualize in real time -although with the serial
connexion limitation- what is captured from the camera.
- Download the archive here.
- Extract the archive in the imote2/apps
directory from the tinyos-2.x-contrib
directory. This is to avoid compilation errors about missing headers
files (or you could just modify the included Makefile for your own
purposes).
- With a terminal console, enters the extracted directory and the
java directory inside, and type make.
- Start the GUI with: "./run X", where X is the identifier of the
USB port wich the camera is connected, i.e., if you use /dev/ttyUSB1,
type "./run 1". This will automatically start the Java Serial forwarder.
- The "ONE SHOT MODE" lets you capture one picture for viewing or
for saving. Juste press the "CAPTURE" button to get a picture from the
camera. A window will apear where you can see the picture appearing
progressively on it. When the picture is completely received, you can
save it to a directory of your choice by pressing the "SAVE" button.
- The "NON-STOP MODE" will display continuously the pictures
captured by the device. A new shot is automaticaly taken when the
previous is entirely received. Two windows will apear, one showing you
the current picture that is being received, the other showing you the
last taken picture. Just press on the "PLAY >>" button to start
the capture. You can stop the capture at any time by pressing the
"STOP" button.
NOTE: the program should succesfully display color pictures
(it has been coded -and tested- with color support in mind), but you
cannot get color pictures from the camera at the time of writing these
instructions, so selecting the "RGB" option will only gives you a
grayscale picture -but not the same picture has if you would have
chosen the "Grayscale" mode.
NOTE: JPEG option has been totally removed from the GUI
interface, since the JPEG compression DOES NOT WORK.
Here is a snapshot of the application that could serve as a video
surveillance system.