SpotsTroubleshootingFAQ < Mobileandembedded < TWiki

TWiki . Mobileandembedded . SpotsTroubleshootingFAQ

Common problems with Sun SPOTs and their solutions

This page lists a number of common problems that people have had with their SPOTs. Please add to this FAQ.

How to interpret the SPOT LEDs

In order to troubleshoot your SPOT is can be important to understand what information is being reported via the SPOT's Power & Activity LEDs.

Those LEDs can be controlled by Java programs on the Sun SPOT, but in ordinary circumstances, they are controlled by the operating environment on the Sun SPOT. The LED on the left will tell you about the power status on the Sun SPOT. Here are its most important signals:

Power LED Signal Meaning
 Three red flashes  Powering down
 Slowly alternate between bright and dim green   Charging from USB; CPU active
 Slowly alternate between dim green and off  Charging from USB; CPU asleep
 Steady dim green  Attached to USB, fully charged; CPU active 
 Steady dim red  Battery low
 One short green flash  Resetting, restarting program
 One bright green pulse, sharp on, soft off  Powering up
 Short red flash, short green flash  CPU going to deep sleep

The LED on the right is under application control. If that behavior is not changed, the system programs will use it to tell you about the communication status of the Sun SPOT. Here are its most important signals.

Activity LED Signal Meaning
 Rapidly flash green  Searching for the host workstation on the USB connection 
 Flash green  Packets being received from the host workstation 
 Flash red  Packets being sent to the host workstation
 Blink green twice every 12 seconds   Normal functioning as a basestation


Most common problems

Problem 1.1 – My Sun SPOT has got into a state where it continually restarts and I get an error whenever I try to deploy to it. How can I recover?

If your SPOT crashes shortly after startup - for example, you inadvertently deployed an application with a bad bug - it can be hard to get your SPOT's attention in order to reflash a more stable application. First you need to get the SPOT into a state where it is listening to commands from the host rather than continually restarting. To do that, follow this procedure:

        ant -Dport=COMnn info

If you don't know the correct port name just enter a dummy value, e.g. "X", and complete the procedure. The output should list the correct port name. Then repeat the procedure with the correct port.

As soon as the ant script starts to complain that the port isn't available, saying something like:

        [java] Port COM31 unavailable...
        [java] Available ports: COM1 COM2 COM3 LPT1
        [java] retrying...

immediately plug in the Sun SPOT.

The ant info command should now operate correctly. Once it has finished, you can take the necessary recovery action, normally to reinstall the system software using ant upgrade and then redeploying your (possibly corrected) application.

If the above procedure does not work then try removing the battery and plugging the Sun SPOT in to the host via USB and see if this causes it to boot. If so, try the upgrade procedure with the battery disconnected.


Software: All Platforms

Problem 2.1 – You get the following error message any time you attempt to communicate with a Sun SPOT over the USB cable, including any of the many ant commands:

        [java] WARNING: RXTX Version mismatch
        [java] Jar version = RXTX-2.1-7
        [java] native lib Version = RXTX-2.1-7pre17

The host workstation uses a serial communication package called RXTX to communicate with the Sun SPOTs. The version in use on the host workstation and on the Sun SPOT must match. The correct version of the RXTX library is installed on the host workstation when the SDK is installed, but if another version is on the load path, a mismatch can occur. Look for an old version of the RXTX library somewhere in your load path. The name of the file will vary with the operating system of the host workstation, as shown in the table below.

 Operating System   RXTX File Name 
 Windows  rxtxSerial.dll
 Macintosh   librxtxSerial.jnilib 
 Linux  librxtxSerial.so

Change your PATH variable to avoid the other version of RXTX or remove the excess version of RXTX.


Problem 2.2 – When I try to create a suite (via "ant suite" or "ant deploy") I get the following error:

        Unable to locate tools.jar Expected to find it in C:\...

Most likely your system environment variables are not setup correctly. Please make sure your PATH variable has your JDK directory as its FIRST value. This also ensures that Windows is not using the java.exe commonly located in C:\Windows\System32. Also ensure that JAVA_HOME is set correctly.


Problem 2.3 – How do I modify the sunspot.home property for the ant build system?

You need to modify the file .sunspot.properties located in your home directory. In Windows, this will be C:\documents and settings\(your account). On the Macintosh, this will be /Users/(your account). The Sun SPOT Manager Tool has a properties editor under the "Preferences" Tab, select "SDK Properties" from the "Edit Configuration File" Drop-Down menu.


Problem 2.4 – Is there an API to query the ID of a SPOT at run-time?

        System.getProperty("IEEE_ADDRESS")


Problem 2.5 – When I do an OTA ant deploy, I get a “No route found” error.

If your attempt to do an OTA ant deploy shows console output that looks like:

        -run-spotclient-once:
        [java] SPOT Client starting...
        [java] Error: No route found
        [java] The SPOT client will now exit
        BUILD FAILED.

then you probably have the OTA command server enabled on your basestation. It should not be so enabled. Do an ant disableota with the basestation as the target and retry your OTA deploy.


Problem 2.6 – Remote commands (e.g. deploy, info, etc.) are being ignored

This can happen if the SPOT application exits then it will not listen for remote commands. Connect the SPOT via USB and redeploy a known application to it.


Problem 2.7 – Basestation not recognized

Run 'ant selectbasestation' and then hit the reset button on the SPOT. This problem can be caused if you had (mistakenly) deployed an application to the basestation.


Problem 2.8 – Port in use error

One thing you need to be careful about is some nasty behaviour in Windows if you unplug a SPOT while a client-side application is running (e.g. "ant run"). In this scenario:

  1. "ant run"
  2. application is running
  3. unplug SPOT
  4. plug it back in
  5. ctrl-c the "ant run"
  6. "ant run"

you'll get the "port in use" error. When you pull out the plug the rxtx/USB goes into a funny state and you must exit the process before re-connecting the device. So:

  1. "ant run"
  2. application is running
  3. unplug SPOT
  4. ctrl-c the "ant run"
  5. plug it back in
  6. "ant run"

will work fine.


Problem 2.9 – Can't import the package java.util.Set or java.util.HashSet

The Squawk JVM implements the CLDC 1.1 spec of Java ME, so not all Java SE classes are available.


Software: Linux

Problem 3.1 – (Linux): When trying to deploy an application to a Sun SPOT, I get error messages from RXTX, saying that the device is not available, or that it doesn't have permission to access it or the lock file.

Make sure that you followed the instructions in the section “Adjust Permissions (Linux)” on page 29 of the Installation Instructions. In particular don't forget to logout after performing the changes.

If you still cannot deploy to the Sun SPOT, make sure that the /var/lock directory exists, and that it is has read, write, and execute permissions for the group to which you added the user. If it doesn't exist, you should create it. The recommended permissions are 755, and the group should be lock. Also check the permissions and group of the device file. The name of the device should be in the error message; common names are /dev/ttyACMx or /dev/usbmodem.

If this doesn't fix the problem, verify that there is no link to /var/lock or /var/spool/lock as this may cause RXTX to detect the lock file twice and to fail.


Problem 3.2 – (Linux): When trying to deploy an application to a Sun SPOT I get an error message: "No Sun SPOT devices found. ...." or similar.

Besides the obvious things, like making sure that a Sun SPOT is actually connected to the USB port, it may be that your Linux installations doesn't have the cdc_acm driver which is required to access the Sun SPOT. Try calling "dmesg | grep usb" in a command window. There should be a message that looks something like "usb ...: New full speed USB using ...". Furthermore there should also be a message referring to cdc_acm. If you see the general messages but you do not see any cdc_acm messages, you probably have to install the cdc_acm driver onto your system.

If you see the cdc_acm messages, and still get a "No Sun SPOT devices found..." error, it may be that the spot-finder script has failed to detect the device. This may occur if the hal_device command is not available and the device gets assigned a name not matching the expected /dev/ttyACM* pattern. We recommend you install hal_device on your system in this case. Alternatively, you may specify the appropriate device name manually in the ant port property. You define this property in the build.properties for a project or in the command line to ant.


Problem 3.3 – (Linux): When trying to deploy an application to a Sun SPOT, I get the error message (or something similar):

Port Error: An SELinux policy prevents this sender from 
sending this message to this recipient unavailable...

This means that the SELinux policy is too restrictive and is not allowing access to the serial device. This is, for example, the case in the default settings for Fedora Core 5.

If you don't require the additional security, SELinux allows you to either disable it or set it to a less restrictive setting. For example, in Fedora Core 5, changing the SELinux setting to permissive solves this problem. You can change the SELinux setting in the System/Administration/Security Level and Firewall menu. If you don't want to give up this security level, you need to define a SELinux policy which gives RXTX permission to the device.


Hardware

Problem 4.1 – SPOT doesn't power up. Neither the power LED nor the activity LED light.

Check battery connector.

Plug the SPOT unit into a powered USB host. This can be a powered USB hub, a USB port on Computer, or a USB mini Type B charger. Make sure the connectors are seated properly and the host device is powered. If the SPOT is not a basestation SPOT and if power LED starts to slowly flash green, then the battery is charging; allow the battery to charge for three hours.

Push the attention button, do not hold it in.

Additional troubleshooting If you have a digital voltmeter and are comfortable using it on small circuits, make the following voltage measurements. Unscrew the main retaining screw (phillips head) and remove the eDEMO board to expose the main board. Leave the battery installed and plug the USB port into a powered source. Set the DVM to measure volts and connect the leads of the DVM to common and volts. Connect the common (-) lead to gold ring around the screw retention hole. From the top of the board with the antenna at the top, find a via marked VSTBY. This is above and to the right of the 30 pin white connector. This should measure +3.0V ±5% when any power source is connected. Find the left most ceramic capacitor next to 3V. This is on the lower left side of the board. Put the positive (+) lead on the bottom of this capacitor. This should measure +3.0V ±5% when power is on. Find the capacitor below the 3.0V marked 1.8V. On the top lead of the capacitor measure 1.8V ±5%. If the SPOT is not a basestation perform the following measurement. In the lower right hand corner is a through hole pad marked V+, this should measure between 3.2V and 4.7V. If you remove the USB, it should not drop below 3.2V. If it does, the battery is defective or dead.


Problem 4.2 – The Sun SPOT powers up but doesn't boot. The power LED comes on green but the activity LED doesn't flash.

Connect the Sun SPOT to the USB port of your host workstation and run ant info to see if the problem is a faulty activity LED.

The Sun SPOT has either a hardware fault or a corrupt ARM bootloader. This requires factory service.


Problem 4.3 – The Sun SPOT powers up and the power LED turns constant bright red. This may occur during upgrading of power controller firmware.

This is corrupted firmware for the power controller. Try to upgrade without power cycling the SPOT. This may require factory service to restore.


Problem 4.4 – The Sun SPOT comes on and boots (activity LED flashes green) but host workstation can't find the Sun SPOT as a USB device.

Check the USB cable. Check for potential interfering drivers on the host workstation (try on a different computer). Exit any application that is trying to communicate to the Sun SPOT, disconnect the USB cable, hold the attention button for > 3 seconds, then tap the attention button to restart the SPOT. Plug the cable back in and try again.

For Windows only: Look in the Device Manager to see if there is an "unknown" USB device. If there is, see if it appears and disappears when you connect and disconnect the Sun SPOT. If the unknown device appears to be the SPOT, connect it, ask Windows to uninstall it, then disconnect the SPOT, then reconnect it. You should now get the "new device" dialog and be able to reinstall the driver.


Problem 4.5 – The Sun SPOT comes on and starts to boot but activity light flashes red and not green.

The ARM9 memory test has failed. Retry but if there are continued failures this indicates bad memory and requires factory service.


Problem 4.6 – The Sun SPOT comes on and boots. The host workstation USB finds the SPOT but says the device is busy.

There is probably an active process still connected to the SPOT. Disconnect the Sun SPOT, kill all the processes that talk to the SPOT, reboot the SPOT and reconnect.


Problem 4.7 – The Sun SPOT continually reboots.

The Sun SPOT may have encountered an exception which causes it to continually reboot. There may be a problem in the deployed SPOT application. Do "ant echo" and look at any output from the SPOT to see what the problem is. Try deploying a known demo to the SPOT and see if that works. If not try reloading the SPOT system code by running ant upgrade on the SPOT.


Problem 4.8 – The Sun SPOT communicates with the host workstation USB but the power LED flashes red.

Connect the Sun SPOT to the host workstation USB. Load the application in the demo folder called SpotCheck?. This will print out the voltage and current usage of the SPOT along with any fault issues with the SPOT.


Problem 4.9 – The Sun SPOT communicates with the host workstation USB but the eDEMO board is not working properly.

Load and run the application in the demo folder called SpotCheck?. Cycle through the tests to check the light sensor, temperature sensor, accelerometer and LEDs on the eDemo board.


Problem 4.10 – The Sun SPOT communicates with the host workstation USB but doesn't communicate with the radio.

Check for potential interference and shielding of the antenna fin. Antenna (thin part of the SPOT box) must be clear of metal objects. Testing requires two SPOTs with eDEMO boards. Load and run an application in the demo folder called RadioStrength?. Each SPOT will then take turns transmitting and receiving data packets and the signal strength will be displayed as a bar graph on the Sun SPOT LEDs.


Problem 4.11 – The Sun SPOT only works when plugged into USB. If not plugged into USB the power LED flashes red and green and the SPOT appears dead.

The SPOT is going into deep sleep as part of the SPOT's automatic power management. If no threads are scheduled to run for 3 seconds then the SPOT tries to save power by turning off the ARM9 processor & the sensorboard. It indicates that it is going to deep sleep by a single red and green flash on the power LED. Please see the SPOT Developer's Guide for more details about deep sleep, including how to disable it.


Problem 4.12 – The eDemo sensor board is not working. Attempts to upgrade the eDemo firmware fail.

If you are using the Blue SDK (or earlier) try looking at http://www.sunspotworld.com/downloads.html and following the instructions for demosensorboardfirmware-blue.jar. Starting with the Red release we upgrade the eDemo firmware directly using the SPI bus. This special updater uses the new method to reinstall the old firmware used in Blue.


If Your Sun SPOT needs Factory Service

If you think your Sun SPOT requires factory service, please first post a description of your problem to one of the Sun SPOT Forums. Please look at SpotsForumFAQ for what sort of information you should include in your post. Also in your post, please say that you have been through the Troubleshooting FAQ and the problem number that you suspect to be your issue. If replies on the Forum do not solve your problem then send an email to service@sunspotworld.com with "Service request" in the subject line of the message, and a link to the forum posting where your issue has been discussed.

----- Revision r8 - 27 May 2009 - 21:07:54 - RonGoldman