Java Sun SPOT Application Development using Java ME (J2ME)

Home --> Notes --> Java midlet shepherds to my PS3 and Aroids

Java midlet shepherds to my PS3 and Aroids


How sweet is the Shepherd's sweet lot!
From the morn to the evening he stays;
He shall follow his sheep all the day,
And his tongue shall be filled with praise.

For he hears the lambs' innocent call,
And he hears the ewes' tender reply;
He is watching while they are in peace,
For they know when their Shepherd is nigh.

- William Blake

Letting your Java app monitor your HOT playstation 3 and even your beloved plants is easy to do when you have alert midlets to shepherd the way. By passing the information to a hosted Java EE webapp, anyone can remotely monitor the PS3 and plants from anywhere using a browser.

Click here to view some dynamically updated graphs showing the changes in temperature and light captured by my Java midlets.

The set-up I created is fairly simple, as you can see from the images. I have a base-station SPOT connected to my desktop in the computer room, and I placed two different SunSPOT wireless sensors some distance away from this. One is about 2 m away, nestled snugly close to my Playstation 3, while the other I placed about 15 m away, held aloft beside of of my aroid plants by three barbacue sticks.

 

I placed two different Sun SPOTs running my midlets in two different places to monitor light and temperature. One is held aloft besides an aroid plant, the other sits right next to my idle Playstation 3. Click on thumbnails above to view detailed images.

The two midlets deployed into each Sun SPOT basically measure the light and temperature of their surroundings every 5 minutes, then relay the information to the desktop base-station, where it is then sent to a Java EE web app running on a remote host server. You can view the sample code for these midlets in the previous notes.

 

A SPOT socket proxy relays the midlet messages to a hosted java server web application.

I can remotely monitor this dynamically-generated information by querying the Java EE webapp, which displays it as graphs generated by an integrated JFreeChart. If you are interested in viewing these graphs, click here.

Some bugs in the system though in that the Sun SPOT devices or the socket proxy on the desktop after awhile starts sending data erratically to the Java server application, or even stops sending altogether, so I guess this is a work in progress :-)

return to previous page.

Copyright © 2007  RML. Java ME and other terms are trademarks or copyright of Sun Microsystems and/or other companies. Legal Stuff.