The Source for Java Technology Collaboration


Whats the shortest path to a working Yggi from the svn ?

Prequisites

Make sure you have the latest Sun SPOTs development SDK installed on your machine and the Sun SPOTs ( currently v5.0 / red )

Basic running host

Check out the necessary source

svn checkout https://yggdrasil.dev.java.net/svn/yggdrasil/trunk yggdrasil 

Build libraries

cd yggdrasil
ant
This step should result in your having yggdrasil_common.jar and yggdrasil_host.jar in the /yggdrasil/lib directory

If successful you will see the following output in your terminal

BUILD SUCCESSFUL
Total time: 3 seconds

Deploy example application to SPOTs

connect your sunspot to the host via usb and then do the following
cd Applications/Examples/PrettyPrint/PrettySPOT
ant deploy run
after the standard deploy messages you should see some message like this when the spots start running
     [java] Squawk VM Starting (blue-080827)...
     [java] Our radio address = 0014.4F01.0000.01B3
     [java]  __   __            _             _ _        _   __ 
     [java]  \ \ / /_ _ __ _ __| |_ _ __ _ __(_) | __ __/ | /  \
     [java]   \ V / _` / _` / _` | '_/ _` (_-< | | \ V /| || () |
     [java]    |_|\__, \__, \__,_|_| \__,_/__/_|_|  \_(_)_(_)__/
     [java]       |___/|___/ 
 

You can deploy to as many SPOTs as you want to.

When you remove the SPOT from the usb cable you should notice that it is sleeping most of the time, and waking up every 20 seconds to sample the sensors, then once a minute it will wake up for a longer period of time to send back the samples taken.

Running host app

Make sure that you have a basestation connected to your host
cd ../PrettyHost
ant host-run

you should see message like the following at first ...

     [java] Sample received from: 0014.4F01.0000.01B3
     [java] Could not locate sensor
     [java] Sample received from: 0014.4F01.0000.01B3
     [java] Could not locate sensor
     [java] Sample received from: 0014.4F01.0000.01B3
     [java] Could not locate sensor

Then after a little while ( the data arrives on the minute boundary )

     [java] Sample received from: 0014.4F01.0000.01B3
     [java] 
     [java] Name: eDemoSensors
     [java] Description: a sensor to read a bunch of values from the eDemoBoard
     [java] Column Name: temperature
     [java] 32.5
     [java] 
     [java] Column Name: light
     [java] 29.0
     [java] 
     [java] Column Name: acceleration
     [java] 0.9435212920476148
     [java] 
  

Whats going on

  • SPOT send samples to host
  • host doesnt recognize the Sensor
  • host sends query to SPOT
  • SPOT responds with some handshake info, and metadata about sensor
  • host now knows about the Sensor
  • host prints out sample data as it arrives

What to try next

  • Try turning on logging in the SensorFramework , TaskManager , and Switchboard classes to see more about the flow ( see LoggerFactory .java )
  • Try adding another field to the EDemoSensor .java class, you will need to modify the initialize(), writeSample() and readSample() methods.

Topic QuickStart . { Edit | Ref-By | Printable | Diffs r6 < r5 < r4 < r3 < r2 | More }
 XML java.net RSS

  

Revision r6 - 2008-12-19 - 18:36:58 - arshan
Parents: SpotsSensorFramework