Sun Spot Talk

1,979 views
1,904 views

Published on

This is the presentation I used to give a talk on Sun SPOTs at the Technical Seminar, RNSIT, Bangalore, INDIA.
28/02/2009

Published in: Technology
0 Comments
0 Likes
Statistics
Notes
  • Be the first to comment

  • Be the first to like this

No Downloads
Views
Total views
1,979
On SlideShare
0
From Embeds
0
Number of Embeds
55
Actions
Shares
0
Downloads
69
Comments
0
Likes
0
Embeds 0
No embeds

No notes for slide
  • Sun Spot Talk

    1. 1. <ul><li>Vittal P </li></ul><ul><ul><li>RNSIT SUN CA </li></ul></ul><ul><li>[email_address] </li></ul><ul><li>http://blogs.sun.com/vittal </li></ul>Programming the world with Sun SPOTS
    2. 2. <ul><ul><li>The Squawk Java VM </li></ul></ul><ul><ul><li>What is Sun SPOT? </li></ul></ul>Agenda <ul><ul><li>Coding a SPOT </li></ul></ul><ul><ul><ul><li>Sun SPOT Demo </li></ul></ul></ul>
    3. 3. What is a Sun SPOT? <ul><li>A hardware and software research platform </li></ul><ul><li>A small, battery operated, wireless device running the Squawk Java Virtual Machine (VM) without an underlying OS. </li></ul><ul><li>On-board sensor board Accelerometer, Light Sensor, Temperature Sensor, I/O pins </li></ul><ul><li>The Sun SPOT development kit can be purchased at www.sunspotworld.com </li></ul>
    4. 4. What is Sun SPOT? <ul><li>A Java platform for developing applications for wireless networks and small devices </li></ul><ul><li>Applications such as: </li></ul><ul><ul><li>Robotics </li></ul></ul><ul><ul><li>Art </li></ul></ul><ul><ul><li>Toys </li></ul></ul><ul><ul><li>Personal electronics </li></ul></ul><ul><ul><li>Commercial Applications </li></ul></ul><ul><ul><li>Telemetries </li></ul></ul>
    5. 5. Why SunSPOTs? <ul><li>Too many low-level concerns in current WSN systems </li></ul><ul><li>4x more productive in Java than in C </li></ul><ul><li>Allows the developer to focus on application functionality and features </li></ul>
    6. 6. Why Sun SPOT? <ul><li>Abstraction of low level details through VM </li></ul><ul><li>Protection of hardware by VM </li></ul><ul><ul><li>Memory protection from bad code </li></ul></ul><ul><ul><li>Security protection from malicious code </li></ul></ul><ul><li>802.15.4 wireless communication </li></ul><ul><ul><li>upto 250Kbps, ZigBee support </li></ul></ul><ul><ul><li>adhoc, mesh, cluster tee and star topologies. </li></ul></ul><ul><li>A simple device with sensors and wireless operates at low power </li></ul>
    7. 7. What did Sun Labs come up with? <ul><li>Powerful mid-level device: </li></ul><ul><ul><li>Space for exploratory programming </li></ul></ul><ul><ul><li>Allow processing of data on node to reduce network traffic </li></ul></ul><ul><ul><li>Enable over-the-air-programming </li></ul></ul>
    8. 8. The anatomy of a SunSPOT <ul><li>The device has three layers: </li></ul><ul><ul><li>Battery </li></ul></ul><ul><ul><li>ARM based processor board with wireless radio </li></ul></ul><ul><ul><li>Add-on sensor board </li></ul></ul><ul><li>Processor board acts as basestation </li></ul><ul><li>User programs the device in Java using NetBeans </li></ul>
    9. 9. SunSPOT Hardware <ul><li>Processor board </li></ul><ul><ul><li>180 MHz 32 bit ARM920T core - 512K RAM/4M Flash </li></ul></ul><ul><ul><li>2.4 GHz 802.15.4 ZigBee radio with integrated antenna </li></ul></ul><ul><ul><li>USB interface </li></ul></ul><ul><ul><li>3.7V rechargeable 720 mAh lithium-ion battery </li></ul></ul><ul><li>Sensor board </li></ul><ul><ul><li>2G/6G 3-axis accelerometer </li></ul></ul><ul><ul><li>Light and temperature sensor </li></ul></ul><ul><ul><li>8 tri-color LEDs, 2 momentary switches </li></ul></ul><ul><ul><li>6 analog inputs, 5 general purpose I/O pins and 4 high current output pins </li></ul></ul>
    10. 10. You need 2 spoons of java... <ul><li>SunSPOT Software Development Kit </li></ul><ul><ul><li>Blue ver 4.0 </li></ul></ul><ul><li>Java </li></ul><ul><li>Ant </li></ul><ul><li>NetBeans (works both with 6.1 and 6.5) </li></ul>
    11. 11. Sun SPOT Software Development Kit <ul><li>Squawk Java VM: Desktop and Sun SPOT </li></ul><ul><li>Libraries </li></ul><ul><ul><li>Java ME CLDC 1.1 libraries </li></ul></ul><ul><ul><li>Hardware libraries </li></ul></ul><ul><ul><ul><li>SPI, AIC, TC, PIO drivers all written in the Java programming language </li></ul></ul></ul><ul><ul><ul><li>Demo sensor board library </li></ul></ul></ul><ul><ul><li>Wireless layer libraries </li></ul></ul><ul><ul><li>Network layer libraries </li></ul></ul><ul><ul><ul><li>802.15.4 MAC layer written in Java </li></ul></ul></ul><ul><ul><li>Desktop libraries </li></ul></ul>
    12. 12. <ul><ul><li>The Squawk Java VM </li></ul></ul><ul><ul><li>What is Sun SPOT? </li></ul></ul>Agenda <ul><ul><li>Coding a SPOT </li></ul></ul><ul><ul><ul><li>l </li></ul></ul></ul><ul><ul><ul><li>Sun SPOT Demo </li></ul></ul></ul>
    13. 13. What is squawk? <ul><li>Another Sun Labs project </li></ul><ul><li>A java JVM written in java </li></ul><ul><li>Now open source (January 23rd 2008) </li></ul><ul><li>Inspiration from Squeak, a Smalltalk environment written in Smalltalk </li></ul><ul><li>New home on the net https://squawk.dev.java.net/ </li></ul>
    14. 14. The Squawk virtual machine
    15. 15. SunSPOT build and deploy process SunSPOT build Squawk suite converter javac .class .suite .bin deploy
    16. 16. Split VM architechture
    17. 17. But – why not embedded Linux? <ul><li>By running on the bare metal, Squawk avoids the need for an operating system (OS) in the Sun SPOT, thereby freeing up memory that would otherwise be consumed by an OS. </li></ul>
    18. 18. But – why not embedded Linux? (2) “ A lightweight configuration of embedded Linux requires 250 KB of ROM and 512 KB of RAM ” Arcticle on Java on the Bare Metal of Wireless Sensor Devices
    19. 19. The right tool...for the right job <ul><li>A series of features made Squawk JVM ideal for a wireless sensor platform: </li></ul><ul><ul><li>1. was designed for memory constrained devices, </li></ul></ul><ul><ul><li>2. runs on the bare metal on the ARM, </li></ul></ul><ul><ul><li>3. represents applications as objects (via the isolate mechanism), </li></ul></ul><ul><ul><li>4. runs multiple applications in the one VM, </li></ul></ul><ul><ul><li>5. migrates applications from one device to another, and </li></ul></ul><ul><ul><li>6. authenticates deployed applications on the device. </li></ul></ul>
    20. 20. Design Overview
    21. 21. <ul><ul><li>The Squawk Java VM </li></ul></ul><ul><ul><li>What is Sun SPOT? </li></ul></ul>Agenda <ul><ul><li>Coding a SPOT </li></ul></ul><ul><ul><ul><li>Sun SPOT Demo </li></ul></ul></ul>
    22. 22. Sun SPOT Radio Communication Example: A Java Snippet for Sending try { // Broadcast a message on port 52 DatagramConnection conn = (DatagramConnection) Connector.open(“radiogram://broadcast:52”); Datagram packet = conn.newDatagram(conn.getMaximumLength()); packet.writeInt(someValue); conn.send(packet); } catch (IOException ioe) { /* Handler */ }
    23. 23. Sun SPOT Radio Communication Example: A Java Snippet for Receiving try { // Listen on port 52 DatagramConnection conn = (DatagramConnection) Connector.open(“radiogram://:52”); Datagram packet = (Radiogram) listenerConn.newDatagram(0); conn.receive(packet); //get the address of the sending SPOT String address= packet.getAddress(); int rssi = packet.getRssi(); //get signal strength } catch (IOException ioe) { /* Handler */ }
    24. 24. Sun SPOT Sensor Code Snippet RangeInput light = SensorBoard.getLightSensor(); RangeInput temp = SensorBoard.getTemperatureSensor(); ISwitch switch1 = SensorBoard.getSwitch1(); Accelerometer3D accel = SensorBoard.getAccelerometer(); // Set accelerometer to 6G scalling ( (LIS3L02AQAccelerometer) accel).set6GSScale(); SensorBoardColouredLED led1 = SensorBoardColouredLED.getLed1(); led1.setOn(); // Change LED colour as SPOT is tilted int xAccel = accel.getX().getValue(); if(xAccel > 0) led1.setRGB(xAccel, 0, 0); else led1.setRGB(0, 0, xAccel);
    25. 25. demo
    26. 26. Where to go from here... <ul><li>http://www.sunspotworld.com/ </li></ul><ul><ul><li>Documentation, SDK </li></ul></ul><ul><ul><li>Discussion Forums </li></ul></ul><ul><ul><li>FAQs and application notes </li></ul></ul><ul><li>http://blogs.sun.com/davidgs/ </li></ul><ul><ul><li>News and informal info on SPOTs around the world </li></ul></ul><ul><li>https://squawk.dev.java.net/ or http://research.sun.com/projects/squawk/squawk-rjvm.html </li></ul><ul><ul><li>The “old” research page and the new home as a open source project on java.net </li></ul></ul><ul><li>http://www.sun.com/emrkt/educonnection/newsletter/0108insidetech.html?cid=e4731 </li></ul>
    27. 27. <ul><li>Vittal P </li></ul><ul><ul><li>RNSIT SUN CA </li></ul></ul><ul><li>[email_address] </li></ul><ul><li>http://blogs.sun.com/vittal </li></ul>QUESTIONS?

    ×