![](/images/new-backgrounds/1311413/31141329x1.webp)
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
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
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
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