Utilizzando questo sito accetti il nostro uso dei cookie. Approfondisci

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.


Requirements:
TinyOS operating system
CameraTestJepgSerial folder downloaded from SourceForge.net
openocd installed
sensor imote2 of Crossbow Technology
IMB400 (camera)
Olimex ARM-USB-OCD (our sensor controller)

Installation:
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 tinyos-2.x-contrib/intelmote2/apps/cameraTestJpegSerial
and then type make intelmote2
As you will see will give you 2 to correct mistakes and we have to change 2 small little things:
"xbowCam.h" to "XbowCam.h" in cameraJpegTestM.nc (capital X)
And then
tinyos-2.x-contrib/intelmote2/tos/sensorboards/xbow_cb/xbowCam.h in XbowCam.h

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 cameraTestJpegSerial.
Type
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
Starting OpenOCD...
Reset the sensor by pressing the key next to its USB port, the LED will restart.
Then you’ll see
Connecting to OpenOCD
...
Erasing flash
Writing flash
Ok, you’ve just installed the executable on the sensor.

Now open another terminal, located in the folder and type java
javac CameraGUI.java
java CameraGUI

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.

image shifted intelmote2 cameratestjpegserial

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?

Scegli uno tra i migliori hosting per WordPress

HOSTING

Scegli uno tra i migliori hosting per WordPress

Hosting

Scegli uno tra i migliori temi WordPress professionali

GRAFICA

Scegli uno tra i migliori temi WordPress professionali

Grafica

Guide e risorse per gestire il sito WordPress a 360°

GESTIONE

Guide e risorse per gestire il sito WordPress a 360°

Gestione

EMAIL NEWSLETTER

Vuoi ricevere i miei ultimi articoli
comodamente nella tua email? È gratis!
Ben 3552 persone lo stanno già facendo!
Anonimo
   
con le dita sempre in costante, frenetico movimento sulla tastiera… vengo spesso trascinato e catturato “in rete” per colpa delle mille idee che mi girano per la testa (prima o poi troverò quella giusta)… dal futuro incerto (nonostante una laurea, e chi non lo è?..siamo in tanti!) .. credo fortemente nella condivisione della conoscenza!

Al momento non è possibile commentare questo articolo...

Seguimi

Scarica gli ebook gratuiti

Vuoi creare e gestire il tuo blog WordPress autonomamente ed in maniera gratuita?

Allora scarica gratuitamente gli ebook Blogging Box e Le 30+ cose da non fare con WordPress, inserisci la tua email qui sotto:
13591+
Scarica gratuitamente gli ebook!

Per maggiori informazioni guarda questa pagina per la Blogging Box e questa per le 30+ cose da non fare con WordPress.

Scarica gli ebook gratuiti

Vuoi creare e gestire il tuo blog WordPress autonomamente ed in maniera gratuita?

Allora scarica gratuitamente gli ebook Blogging Box e Le 30+ cose da non fare con WordPress, inserisci la tua email qui sotto:
13591+
Scarica gratuitamente gli ebook!

Per maggiori informazioni guarda questa pagina per la Blogging Box e questa per le 30+ cose da non fare con WordPress.
Unisciti agli oltre 10999 lettori
che seguono questo blog
3152
982
2251
4614