Sun Microsystems V2.0 manual Remote operation, Base Station configuration, Introduction

Page 16
In each case, the procedure is the same:
1. ensure that the remote Sun SPOT is executing the OTA (“over the air”) Command Server
2. connect a Sun SPOT base station
3. specify the remote Sun SPOT’s ID, either on the ant command line (using the -DremoteId=<IEEE address> switch) or in the application’s build.properties file
(remoteId=<IEEE address>)
If you wish, you may also carry out a fourth step, which is:
4. program the remote Sun SPOT application to take suitable actions during over-the-air downloads.
Each of these four is now considered in more detail
Ensure that the remote Sun SPOT is executing the OTA Command Server
The remote Sun SPOT must run a thread that listens for commands. To check whether or not the command server is enabled on a SPOT use the ant info command. Factory-fresh SPOTs have the command server enabled by default (except for basestations).
16

Base Station configuration

It is possible to select a channel and pan id for the base station using command line properties in conjunction with ant host-run. The properties are:

-Dremote.channel=nn -Dremote.pan.id=nn

Alternatively, if you are operating in dedicated mode, the IRadioPolicyManager interface provides operations to adjust the output power of the radio, the PAN Id and the channel number. To access the policy manager from your host program do:

Spot.getInstance().getRadioPolicyManager()

Remote operation

Introduction

Until now, in this manual, we have worked with Sun SPOTs connected directly to the host computer. In this section we show how it’s possible to carry out some, but not all, of the same operations on a remote Sun SPOT communicating wirelessly with the host computer via a base station.

The operations that can be performed remotely include:

ant deploy

ant jar-deploy

ant run

ant fork

ant debug

ant info

ant settime

ant deletepublickey

ant set-system-property

ant system-properties

ant delete-system-property

Image 16
Contents Page Page Contents Http protocol support Introduction Building and deploying Sun Spot applications Deploying and running a sample applicationBuild Successful Total time 3 seconds \MyApplication Ant -Dport=COM2 info Total time 4 seconds \MyApplication Total time 0 seconds \MyApplication Deploying a pre-existing jar Incorporating utility classes into your application Excluding files from the compilation Manifest and resources Other user properties Built-in properties Using the BasestationOverview Set up Remote operation Base Station configurationIntroduction Connect a Sun Spot base station Using short names for SPOTs Managing keys and sharing Sun SPOTsTake suitable actions during over-the-air downloads BackgroundChanging the owner of a Sun Spot Sharing Sun SPOTsWhat is protected? Deploying and running a host applicationGenerating a new key-pair LimitationsConfiguring network features Your own host applicationIncorporating pre-existing jars into your host application Mesh routingTrace route Hardware configurations and USB powerLogging Page Threads Overview of an applicationThread priorities Sun Spot device library Sun Spot device librariesDevice Interface Persistent properties Accessing flash memory Overriding the Ieee addressUsart Radio communication library Program Radiogram protocol Client end Server endYou can open server radiogram connections in a similar way Broadcasting Radio properties Turning the receiver off and on Monitoring radio activity Conserving power using deep sleep modeShallow Sleep Activating deep sleep mode Deep SleepUSB inhibits deep sleep Preconditions for deep sleepingDeep sleep behaviour of the standard drivers Device Condition to permit deep sleepWriting a device driver Configuring the http protocol Http protocol supportConfiguring projects in an IDE Socket Proxy GUI modeJavadoc/source configuration Classpath configurationDebugging Ant selectapplication Configuring NetBeans as a debug client Configuring Eclipse as a debug clientUsing library suites Advanced topicsWith adderlib as your current directory, execute the command Use the command Using the spot client SpotSerialPortException other exception in serial port comms Persistent system properties ReferenceProperty name Meaning Contents of the arm directory Contents of the lib directoryMemory usage Start address Space UseContents of the bin directory preverify.exe Contents of the upgrade directory Contents of the tests directory