Sun Microsystems V2.0 manual Conserving power using deep sleep mode, Monitoring radio activity

Page 37

RSSI (received signal strength indicator) measures the strength (power) of the signal for the packet. It ranges from +60 (strong) to -60 (weak). To convert it to decibels relative to 1 mW (= 0 dBm) subtract 45 from it, e.g. for an RSSI of -20 the RF input power is approximately -65 dBm.

CORR measures the average correlation value of the first 4 bytes of the packet header. A correlation value of ~110 indicates a maximum quality packet while a value of ~50 is typically the lowest quality packet detectable by the SPOT’s receiver.

Link Quality Indication (LQI) is a characterization of the quality of a received packet. Its value is computed from the CORR, correlation value. The LQI ranges from 0 (bad) to 255 (good).

These values are obtained using:

myRadiogram.getRssi();

myRadiogram.getCorr();

myRadiogram.getLinkQuality();

Monitoring radio activity

It is sometimes useful to monitor radio activity, for example when investigating errors. Two sets of facilities are provided. One allows the last ten radio packets received to be displayed on demand, along with information about the state of the radio chip at the time the packets were read. The second facility provides a count of key errors in the MAC layer of the radio stack.

To view the last ten radio packets, do

IProprietaryRadio propRadio = RadioFactory.getIProprietaryRadio(); propRadio.setRecordHistory(true);

// radio activity including receiving packets propRadio.dumpHistory(); // prints info to system.out

To see counts of MAC layer errors, do

IProprietaryRadio propRadio = RadioFactory.getIProprietaryRadio(); propRadio.resetErrorCounters(); // set error counters to zero

… // radio activity provoking errors

System.out.println("RX overflows since reset " + propRadio.getRxOverflow()); System.out.println("CRC errors since reset " + propRadio.getCrcError()); System.out.println("Channel busy stopped TX " + propRadio.getTxMissed()); System.out.println("Short packets received " + propRadio.geShortPacket());

Conserving power using deep sleep mode

Shallow Sleep

A thread is idle if it is executing Thread.sleep(), blocked on a synchronization primitive or waiting for an interrupt from the hardware. Whenever all threads are idle the Sun SPOT drops into a power saving mode (“shallow sleep”) to reduce power consumption and extend battery life. Decisions about when to shallow sleep are taken by the Java thread scheduler inside the VM. This is transparent to applications – no special work on the part of the programmer is required to take advantage of it.

While considerable power can be saved during shallow sleep, it is still necessary to power much of the Sun SPOT hardware:

37

Image 37
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 jarExcluding files from the compilation Manifest and resourcesOther user properties Built-in properties Using the BasestationOverview Set up Remote operation Base Station configurationIntroduction 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 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 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 Monitoring radio activity Conserving power using deep sleep modeShallow Sleep 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 IDEJavadoc/source configuration Classpath 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 Persistent system properties ReferenceProperty name Meaning 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