Application CameraTestJepgSerial for Intelmote2
It is an application that allows you to take a picture using the Imote2, a wireless sensor, and then send it to the computer via serial connection. The image can be captured in color (picture is too large) or in black and white (best choice) with dimensions of 640 × 480 or 320×240. There is also a function to take the compressed image that does not work here, but in the next post I’ll show you how to properly implement.
TinyOS operating system
CameraTestJepgSerial folder downloaded from SourceForge.net
sensor imote2 of Crossbow Technology
Olimex ARM-USB-OCD (our sensor controller)
to install the program you have to compile it, in order to create the executable file that will then be uploaded onto the sensor. To compile the program for a sensor intelmote2 (our Imote2), just open a terminal on
and then type
As you will see will give you 2 to correct mistakes and we have to change 2 small little things:
cameraJpegTestM.nc (capital X)
After that, we are ready to begin!
In order to be executed, the program requires the use of SerialForwarder, so open a terminal and type
java net.tinyos.sf.SerialForwarder -comm serial@/dev/ttyUSB1:115200 -port 9002
The value “ttyUSB1″ depends on which USB port was connected to the controller.
If that does not work for you, it means that you must modify the usb port number by the instruction ttyUSBX instead of X and put the number of your door. If you are on linux, to find the correct usb port, just type
dmesg in the terminal, then disconnect the USB cable programmer and redact
dmesg, now you’ll be out, for example, “now disconnected /dev/ttyUSB0″ and out “now disconnected /dev/ttyUSB1 “… so you know that your programmer is connected to port 0 and 1. We will always use the highest value to read through serialforwarder. Plug the cable back and restart the SerialForwarder with the correct port number.
Now attach the sensor to the sensor controller, and then connecting the controller to the PC via USB cable. Open a new terminal and placed in the folder of
make intelmote2 install.1 openocd
instruction install.X, will install the executable and give TOS_NODE_ID equal to X at the sensor.
You’ll see a lot of text appear on the terminal, it is quite normal. When you see this word
Reset the sensor by pressing the key next to its USB port, the LED will restart.
Then you’ll see
Connecting to OpenOCD
Ok, you’ve just installed the executable on the sensor.
Now open another terminal, located in the folder and type java
If that gives you any problem here, is because you miss some files, tell me now that I put them on the net.
Here’s the graphical interface of the program. Pressing the button “Get Image” will be taken and displayed the image.
Unfortunately for a driver problem of the camera, the image is translated to reality, but with a simple algorithm operating on the bytes have been able to return it to its original condition.
For any problem, errors in the article or program errors, do not hesitate to contact me via the comments field!
VUOI CREARE IL TUO SITO O BLOG WORDPRESS?
EMAIL NEWSLETTERVuoi ricevere i miei ultimi articoli
comodamente nella tua email? È gratis!
Ben 3552 persone lo stanno già facendo!