Sun Microsystems V2.0 manual Set up

Page 15

Host

USB

Sun SPOT

(“base s tation”)

802.15.4 radio

Sun SPOT

(“Target”)

The Host can be any of the supported platforms (e.g. Windows PC, Mac). The Host application is a J2SE program. The Target application is a Squawk Java program.

In the SPOT SDK and documentation the 64-bit addresses that identify SPOTs are expressed as sixteen hexadecimal digits subdivided into four groups that are separated by dots for readability.

The Basestation may run in either dedicated or shared mode. In dedicated mode, it runs within the same Java VM as the host application and can only be used by that application. In this model, the host’s address is that of the basestation.

In shared mode, two Java virtual machines are launched on the host computer: one manages the base station and another runs the host application. In this model, the host application has its own system-generated address, distinct from that of the base station. Communication from host application to the target is therefore over two radio hops, in contrast to one hop in the dedicated case.

The main advantage of shared mode is that more than one host application can use the same basestation simultaneously. Shared mode also allows multiple host processes to communicate with each other using the radio communication stack, which makes it possible to simulate the communication behaviour of a group of SPOTs using host applications (this simulation has different timing characteristics).

The disadvantage of shared mode is that run-time manipulation of the basestation SPOT’s radio channel, pan id or output power is not possible.

By default, host applications will use the base station in dedicated mode. To switch to shared mode, insert this line into the .sunspot.properties file in your user root folder:

multi.process.basestation.sharing=true

Host applications that send or receive broadcasts, or that interact directly with the lower layers of the radio stack, will behave differently in the two modes. This issue is discussed in more detail in the section Broadcasting and basestations.

Set up

Connect a base station to your host computer. If you don't have a base station you can configure a Sun SPOT to be used as the base station by issuing the following command:

ant selectbasestation

Then press the Sun SPOT’s control button and the Sun SPOT will act as a base station.

15

Image 15
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 jarManifest and resources Excluding files from the compilationOther user properties Using the Basestation Built-in propertiesOverview Set up Base Station configuration Remote operationIntroduction Connect a Sun Spot base station Background Using short names for SPOTsManaging keys and sharing Sun SPOTs Take suitable actions during over-the-air downloadsSharing Sun SPOTs Changing the owner of a Sun SpotLimitations What is protected?Deploying and running a host application Generating a new key-pairMesh routing Configuring network featuresYour own host application Incorporating pre-existing jars into your host applicationHardware configurations and USB power Trace routeLogging Page Overview of an application ThreadsThread priorities Sun Spot device libraries Sun Spot device libraryDevice Interface 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 Conserving power using deep sleep mode Monitoring radio activityShallow Sleep Deep Sleep Activating deep sleep modeDevice Condition to permit deep sleep USB inhibits deep sleepPreconditions for deep sleeping Deep sleep behaviour of the standard driversWriting a device driver Http protocol support Configuring the http protocolSocket Proxy GUI mode Configuring projects in an IDEClasspath configuration Javadoc/source configurationDebugging 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 Reference Persistent system propertiesProperty name Meaning Start address Space Use Contents of the arm directoryContents of the lib directory Memory usageContents of the bin directory preverify.exe Contents of the tests directory Contents of the upgrade directory