Sun SPOT Platform and Tools - PowerPoint PPT Presentation

1 / 18
About This Presentation
Title:

Sun SPOT Platform and Tools

Description:

In the last 20 minutes of class, groups of two or three will be able to check ... SPOT library APIs and SPOT host library APIs (javadoc) ... – PowerPoint PPT presentation

Number of Views:85
Avg rating:3.0/5.0
Slides: 19
Provided by: M276
Category:
Tags: spot | apis | platform | sun | tools

less

Transcript and Presenter's Notes

Title: Sun SPOT Platform and Tools


1
Sun SPOT Platform and Tools
2
What I have planned
  • Go over installation
  • Discuss available resources
  • SPOT Manager demonstration
  • Introduce the emulator
  • Debugging suggestions
  • Break up into groups
  • Do Lab 1b
  • Play with emulator (as time allows)
  • In the last 20 minutes of class, groups of two or
    three will be able to check out SPOTs to take
    home (have to fill out form)
  • The homework described at the end of Lab 1b will
    be due Wednesday, January 21st (in one week from
    next class)

3
Installing the SPOT Software
  • Everything you need to work with the Sun SPOTs
    can be easily obtained through the SPOT Manager
  • SPOT software is java-based and runs on all
    common platforms (windows, mac, linux)
  • Necessary software includes
  • SPOT SDK
  • JDK (Java Development Kit) 1.5 or later
  • Apache Ant
  • Environment variables JAVA_HOME and ANT_HOME must
    be set (now done by the SPOT Manager)
  • NetBeans is optional, but with the SPOT modules
    can make working the SPOTs much easier

4
Installing on Windows Vista
  • For detailed installation instructions (all
    platforms), go here http//www.sunspotworld.com/G
    ettingStarted/
  • The installation is generally very
    straightforward and simple, however if you are on
    WINDOWS VISTA, you should be aware that you need
    to either disable User Account Control (Control
    Panel (Classic View) ?User Accounts?Turn User
    Account Control on or off), or run the SPOT
    Manager as administrator with extended
    privileges, covered here http//www.sunspotworld.
    com/GettingStarted/Vista.html
  • For more help, see this forum post
    https//www.sunspotworld.com/forums/viewtopic.php?
    f35t729p8628hilitspotmanagervistap8628

5
Setting Environment Variables
  • This should be done for you, however, on Vista it
    seems you need to do it yourself (I had too)
  • To set environment variables, right-click on My
    Computer, select Advanced System Settings, and
    then select Environment Variables from the
    Advanced tab
  • Make sure ANT_HOME and JAVA_HOME are defined
    and their bin folders are in your path.

6
Vista Environment Variables
7
Vista Environment Variables
8
Vista Environment Variables
9
Available Resources
  • First place to go http//www.sunspotworld.com/doc
    s/
  • Contains
  • Developers Guide (may be helpful for the
    lab1b homework)
  • Theory of Operation
  • Owners Manual
  • Release Notes
  • Quick Start Tutorial
  • Emulator Tutorial
  • SPOT library APIs and SPOT host library APIs
    (javadoc)

10
Suns Sun SPOT course
  • Available at http//www.sunstudentcourses.com/
  • Requires registration -\ but PLEASE REGISTER!
  • This is a good additional reference. In
    particular, after today if you want to learn more
    about the SPOT World emulator, try this course
    and the introduction guide on the SPOT
    documentation page.
  • We will reference this course throughout the
    coming labs as a place to go for background
    material and additional information.

11
The Forums
  • The forums are a great place to go when you can
    not find what you are looking for in the other
    documentation, especially if you are having
    problems.
  • Try to do a search before posting a question in
    case it has already been answered
  • www.sunspotworld.com/forums

12
Using the SPOT Manager
  • The SPOT Manager is helpful for
  • Starting a shared basestation
  • Upgrading the SPOT software to the current SDK
  • Starting the emulator
  • Managing SDK installations
  • Examining connected SPOTs
  • And more
  • Now I will demonstrate.

13
Deploying Applications
  • You will (hopefully) all be doing this later, but
    I will demonstrate it, as well, to make sure we
    are all on the same page.
  • If you have trouble deploying, try updating your
    SPOTs (basestations, especially, may not be
    up-to-date)
  • If you get a Java Exception when trying to start
    a shared basestation, try opening a command line,
    navigating to any SPOT project directory (e.g.
    C\Program Files\Sun\SunSPOT\sdk-blue\Demos\AirTex
    t), and typing ant startbasestation run

14
The SPOT World Emulator
  • To learn about, read the emulator guide at
    www.sunspotworld.com/docs and the section on
    using the emulator from Suns student course.
  • If you finish Lab1b in class today, start reading
    these and experimenting with the emulator. Try
    deploying various Demo applications and playing
    with them on the emulator (and compare the
    behavior to when you deploy the application on a
    real SPOT)

15
Debugging Applications
  • The emulator (new to version Purple) should be
    very helpful for testing and debugging throughout
    the course.
  • With the emulator, you can also attach an
    external debugger. I have not tried this yet.
  • With real SPOTs, LEDs are useful for debugging
    and feedback
  • With a SPOT plugged in, you running the SPOT
    application from NetBeans will result in all
    println() calls to print in NetBeans.

16
Debugging with LEDs
  • A couple helpful methods
  • private void displayNumber(int val, LEDColor
    col)
  • for (int i 0, mask 1 i lt 7 i,
    mask ltlt 1)
  • leds7-i.setColor(col)
  • leds7-i.setOn((val mask) ! 0)
  • protected void flashLights(LEDColor color)
  • for(int i 0 i lt 8 i)
  • ledsi.setColor(color)
  • ledsi.setOn()
  • Utils.sleep(2500)
  • for(int i 0 i lt 8 i)
  • ledsi.setOff()
  • leds7.setColor(LEDColor.WHITE)
  • leds7.setOn()

17
The Homework
  • Will be due Wednesday, January 21st
  • Concentrate on the desktop application
  • Send all modified source files and a brief
    description of what you did and how your solution
    works to damont_at_pdx.edu

18
For next time
  • Before next class, please read the background
    material listed for Lab 3 Radio Communication
  • SPOT Developers Guide 25-37
  • If you arent familiar with TCP/UDP socket
    programming in Java http//www.javaworld.com/java
    world/jw-12-1996/jw-12-sockets.html and
    http//www.cs.rpi.edu/courses/fall02/netprog/notes
    /javaudp/javaudp.pdf
  • Register for the sun student courses and read the
    section called Using the SPOT emulator
Write a Comment
User Comments (0)
About PowerShow.com