Replacing communication software is NOT hard!

At a glance, replacing such an integral part of the Standard SDK might sound very complicated even for advanced users, but generally it is not and you can get the Demo started on your SPOTs in less than 15 minutes. We offer two different guides which will demonstrate how to replace the communication stack on your SPOTs:

  • Ready-to-Run Package: This package in our download section contains an Eclipse project, libraries and everything you need to get started really quick. If you are not an Eclipse user, you can still use this package!

  • KSN Radio Stack Sources: The sources of the KSN Radio Stack can also be acquired at the download section. This option is for you, if you want to modify parts of the stack or if you are a more advanced user of the stack. The KSN Radio Stack Manual provides a detailed description how to use this package.

Using the Ready-to-Run package

We assume at this point, that you have connected and successfully used Sun SPOTs to your computer before using the Blue SDK. The necessary steps differ depending on your operating system and hardware, and a description can be found in the user guide delivered with the Sun SPOTs.

Generally these steps include:

  1. Install a Java Runtime Edition (JRE) which can be downloaded at http://java.sun.com.

  2. Install Apache ANT which is available from http://ant.apache.org/.

  3. Modify your PATH variable and add entries for ANT and the JRE to it.

  4. Install the SPOT SDK delivered by Sun to your computer's hard drive.

  5. Install Drivers in your operating system to allow you to connect Sun SPOTs to your computer and deploy software on them.

Note: Using the Ready-to-Run package will not make any modifications to your current Sun SPOT SDK configuration! All your Sun SPOT projects are still working with your original SDK.

After these steps have been accomplished, you should be able to run ANT and the JRE from your command-line and execute ant info successfully on a connected Sun SPOT. To start using the KSN Radio Stack and run the demo contained within the Ready-to-Run package, the following simple steps must be accomplished:

  1. Download the Ready-to-Run Package and unpack it to your hard drive. To ease the presentation here, we assume you unpacked it to /ksn/radiostack.
    If you use Eclipse, you may import the project without unpacking directly into your workspace.
    The package has the following folder structure:

    • bin: Contains compiled class files of the demo.
    • build: ANT scripts for building and deploying the KSN Stack and the demo on your SPOTs.
    • lib: Libraries used for the Demo. This directory also includes the KSN Radio Stack library.
    • src: Source code of the Demo application.
    • SunSPOTSDK: A complete Sun SPOT SDK with all libraries and scripts.
  2. Navigate to the /ksn/radiostack/KSNRadioStackReadyToRun/build directory on your hard disk.

  3. Connect a SPOT on which you want to run the KSN Radio Stack and type ant flashlibrary. This will replace the standard stack on the nodes with the KSN Radio Stack. After the process is finished, you must restart the SPOT. Repeat this step for each node on which you want to run the KSN Radio Stack. If you don't want to run the demo, you are finished with the replacement of the communication stack!
    Note, that nodes that run the KSN Radio Stack cannot communicate with nodes that run the standard radio stack delivered with the SPOT SDK.

  4. To run the demo with your SPOTs, open the MainApplication.java with your favorite editor or Eclipse and change the IEEE addresses in the code to values suited to your SPOTs.
    To simplify the presentation here, we assume your SPOTs have the IEEE addresses 0014.4F01.0000.ABCD and 0014.4F01.0000.1234 and the two lines have been changed as follows:
    private IEEEAddress leftSwitchSendsTo = new IEEEAddress("0014.4F01.0000.ABCD");
    private IEEEAddress leftSwitchSendsTo = new IEEEAddress("0014.4F01.0000.1234");
    The demo will not run without this step, because we don't know the IEEE addresses of your SPOTs.

  5. Again navigate the build directory and execute ant compile deploy while the SPOTs with IEEE addresses 0014.4F01.0000.ABCD and 0014.4F01.0000.1234 are connected to your computer. This deploys the Demo application to your SPOTs and after the process is finished, please restart your SPOTs.

If you push now the left or right button, the SPOT will measure the temperature and send the temperature value to 0014.4F01.0000.ABCD (left button) or 0014.4F01.0000.1234 (right button) using the KSN Radio Stack. The temperature measured on the SPOT where the button was pushed can be displayed using ant echo, e.g., connect 0014.4F01.0000.ABCD to your computer, execute ant echo and push the left button on 0014.4F01.0000.1234.

The demo also works for multiple hops. To test the multihop capabilities of the KSN Radio Stack place your two SPOTs 0014.4F01.0000.ABCD and 0014.4F01.0000.1234 into different locations where they cannot reach each other. Repeat the steps above with a few more nodes and place them between 0014.4F01.0000.ABCD and 0014.4F01.0000.1234 and push the button. The temperature will be delivered over multiple hops if you placed the nodes correctly.