Sun Microsystems V2.0 manual Connect a Sun Spot base station

Page 17

To configure the SPOT so that this thread is started each time the SPOT starts issue this command via a USB connection:

ant enableota

The SPOT remembers this setting in its configuration area in flash memory.

To configure the SPOT so that the OTA Command Server is not started each time the SPOT starts issue this command:

ant disableota

Although the OTA Command Server thread runs at maximum Thread priority, parts of the radio stack run at normal priority. This means that if an application runs continuously in parallel with the OTA Command Server, it should not run at a priority greater than normal, otherwise OTA Command Server commands may not be processed.

Connect a Sun SPOT base station

For details, see the section Using the Basestation.

Launch the spot client to control a remote Sun SPOT via the base station

To deploy an application use:

ant -DremoteId=<IEEE_ADDRESS> deploy

To run the deployed application use:

ant -DremoteId=<IEEE_ADDRESS> run

Unless the feature has been explicitly disabled, any output generated by the application using System.out or System.err will be redirected over-the-air and displayed in the command window exactly as if the SPOT was connected by USB2. This feature is disabled by setting the system property:

spot.remote.print.disabled=true

In these commands, <IEEE_ADDRESS> is the 64-bit IEEE address of the form xxxx.xxxx.xxxx.xxxx. By default this is the same as the serial number printed on each Sun SPOT. Alternatively you can execute an ant command to a locally connected Sun SPOT such as

ant info

which will print the serial number, for example:

...

[java] Sun SPOT bootloader (orange-20061120)

[java] SPOT serial number = 0014.4F01.0000.02ED

...

It is also possible to specify which radio channel and pan id the base station should use to communicate with the remote SPOT. To do this, set the ant properties remote.channel and

2The streams are not forwarded to the host until handshaking is complete. As a result, any output generated by your application before this point will not be displayed. Handshaking is usually completed within 100ms of start-up.

17

Image 17
Contents Page Page Contents Http protocol support Introduction Deploying and running a sample application Building and deploying Sun Spot applicationsBuild Successful Total time 3 seconds \MyApplication Ant -Dport=COM2 info Total time 4 seconds \MyApplication Total time 0 seconds \MyApplication Incorporating utility classes into your application Deploying a pre-existing jarOther user properties Manifest and resourcesExcluding files from the compilation Overview Using the BasestationBuilt-in properties Set up Introduction Base Station configurationRemote operation Connect a Sun Spot base station Managing keys and sharing Sun SPOTs Using short names for SPOTsTake suitable actions during over-the-air downloads BackgroundSharing Sun SPOTs Changing the owner of a Sun SpotDeploying and running a host application What is protected?Generating a new key-pair LimitationsYour own host application Configuring network featuresIncorporating pre-existing jars into your host application Mesh routingLogging Hardware configurations and USB powerTrace route Page Thread priorities Overview of an applicationThreads Device Interface Sun Spot device librariesSun Spot device library Persistent properties Overriding the Ieee address Accessing flash memoryUsart Radio communication library Program Radiogram protocol Server end Client endYou can open server radiogram connections in a similar way Broadcasting Radio properties Turning the receiver off and on Shallow Sleep Conserving power using deep sleep modeMonitoring radio activity Deep Sleep Activating deep sleep modePreconditions for deep sleeping USB inhibits deep sleepDeep sleep behaviour of the standard drivers Device Condition to permit deep sleepWriting a device driver Http protocol support Configuring the http protocolSocket Proxy GUI mode Configuring projects in an IDEDebugging Classpath configurationJavadoc/source configuration Ant selectapplication Configuring Eclipse as a debug client Configuring NetBeans as a debug clientAdvanced topics Using library suitesWith adderlib as your current directory, execute the command Use the command Using the spot client SpotSerialPortException other exception in serial port comms Property name Meaning ReferencePersistent system properties Contents of the lib directory Contents of the arm directoryMemory usage Start address Space UseContents of the bin directory preverify.exe Contents of the tests directory Contents of the upgrade directory