Tuesday Nov 23, 2010

Sun SPOT SDK v6.0 Released

If you didn't see the announcement last Friday, the Sun SPOT SDK v6.0 (Code-Name Yellow) has been released! A few of the highlights:


Software changes



  • SPOT libraries support both old rev6 and new rev8 hardware.

  • Added IPv6 support to radio protocols.

  • New Resources API to support writing device drivers and other system resources that can be used by MIDlets running in separate Isolates. Please see the javadoc for com.sun.spot.resources.Resources for details. Note: removes the existing performance penalty of accessing system resources from a separate Isolate.

  • New Sensor API to provide generic interfaces to common sensors and actuators for SPOTs. These interfaces need to be in the base spotlib, so that they can be used in SPOT applications without needing to refer to a specific implementation (e.g. transducerlib or user specific library for a different daughtercard). The initial set of interfaces are defined in the com.sun.spot.resources.transducers package. See the javadoc for com.sun.spot.resources.transducers.ITransducer for details on the metadata associated with each sensor.

  • New Condition class to regularly test a sensor (via software polling) to determine if a condition is met and when the condition is met then to invoke a callback. See the javadoc for com.sun.spot.resources.transducers.Condition for details.

  • New basic Task class to specify some code to be run starting at a specified time and then repeated periodically. See com.sun.spot.service.Task for details.

  • New BootloaderListenerService replaces BootloaderListener.

  • New IDeepSleepListener for registering/notifying listeners when SPOT wakes from deep sleep.

  • New IStandby Interface: used by rev8 accelerometer & tricolor light sensor.

  • New ADJDS311TriColorLightSensor class. New TriColorLEDArray class.

  • New (virtual) WatchdogTimer class.

  • Four serial lines are now available:

    • one from the sensor board: edemoserial://

    • and three from the main processor board:

    • serial://usb & serial:// which both go to RX1/TX1,

    • serial://usart & serial://usart0 which both go to RX0/TX0,

    • serial://usart1 which goes to RX2/TX2



  • Changed FiqInterruptDaemon to support multiple listeners for different events & added a method to disable button presses from causing a reboot.

  • Improved IToneGenerator API.

  • Rev 8 eDemoboard speaker controlled by a ToneGenerator.

  • All MIDlets now run in child Isolates. The SPOT can be configured to run several different MIDlets at startup.

  • Added new spot.restart.mode property to control what happens when all MIDlets finish. Recognized values are: restart (reboot SPOT = current default), off (SPOT goes into deep sleep) or continue (SPOT goes into shallow sleep & continues to listen for OTA radio commands).

  • New Gateway Server to run multiple host services to/from SPOTs.



Solarium



  • Solarium can now deploy to SPOTs using old SDKs (provided OTA & config page format still same).

  • Added shared basestation support to radio view.


Demos



  • Demos updated to use new Resources & Sensor APIs so they can work with both rev6 & rev8 SPOTs.

  • New HostQuerySpots Demo that shows how to send commands to SPOTs via the radio (OTA) from a host app.

  • New InfraRed Demo.

  • New Solarium demo: Robot view as plugin jar file.

  • New Geiger counter demo app.

  • New IPv6 demos.

  • New Sensor.Network demo.

  • New Web-of-Things demo.

  • TelemetryDemo on host can now display data from multiple SPOTs.


Improvements & Bug fixes



  • New SPOT SunSPOT-Programmer's Manual: combines old Owner's Manual, Developer's Guide and Solarium User's Guide.

  • Shared basestation is now the default.

  • Conversion of analog inputs (including the accelerometer) has been slowed down by default to ~58Hz in order to fix a problem where the ADT7411 was reading incorrect values for A0. New ADT7411 method, setFastConversion(boolean), to change the conversion speed.

  • Improved performance of GC up to 40% (bug #1461)

  • Fixed bugs in shared basestation radio implementation making it more reliable.

  • Improved radio performance & reliability.

  • Speed up writing to flash by using faster write_words instead of write_word.

  • During upgrades now only update the bootloader if it differs from the new SDK's bootloader.

  • Fixed a radio bug where an app that only transmitted would block.

  • Fixed old bug in ant run for remote SPOTs so ant exits when the SPOT app finishes.

  • Updated remote printing to work in the new multi-isolate world.

  • Lots of bug fixes.


Notes



  • Downgrading to Red will work, but afterwards the SPOT must be unplugged from USB, shut down and restarted for the eDemoboard to be recognized.

  • The ant target "deploy" now by default removes all unused app suites, and sets the specified deployed Midlet (#1 by default) as the only one to run on startup. A new target, "codeply" deploys BUT leaves app suites in place and simply adds the deployed Midlet to the already existing startup list.


There will also be an upcoming release of new hardware, called Rev8, including a new Sensor Board with the following highlights:



  • The main SPOT processor board has been redesigned. New features include:

    • RAM memory increased to 1 Mb.

    • Flash memory increased to 8 Mb.

    • Now based on the AT91SAM9G20 with a master clock speed of 133.3248MHz (400MHz processor -- 2.226 times faster then the rev 6 speed).

    • Access to the radio (CC2420) is now on a second SPI bus.

    • Three serial lines are now available:

      • RX1/TX1 go to pads on processor board,

      • RX0/TX0 go to RX/TX pin on sensor board,

      • RX2/TX2 go to the top connector.





  • Power Controller microcontroller now provides a Watchdog timer that is accessible to SPOT applications for increased reliability.

  • The SPOT sensor board has been redesigned. New features include:

    • No temperature sensor on eDemo (use temperature sensor on main processor board).

    • Now only 4 digital GPIO pins: D0-D3 (no D4).

    • Now only 4 analog in lines: A0-A3 (no A4+A5). Sampling takes longer as done via ATmega microcontroller.

    • New tri-color light sensor replaces old simple light sensor.

    • New MMA7455L accelerometer replaces LIS3L02AQ accelerometer. New accelerometer has three scale ranges: 2/4/8G.

    • I2C from sensor board output available on AVR SCL & SDA pins.

    • New lo-fi audio speaker lets the SPOT now make sounds.

    • New IR receiver (on SW1 input line) & IR transmitter (on SW1 input line).

    • By default sensor board ATmega microcontroller now stays awake when main processor board is powered down for deep sleep, and can generate interrupts to wake SPOT up on pin changes, switch presses, etc.

    • No longer support hardware threshold interrupts on acceleration, temperature or analog input. Use software monitoring instead.

    • Tricolor LEDs now controlled directly by main processor board.

    • Serial line from main processor board now available on RX/TX pins. Can also be level switched via SW3.

    • I2C from main processor board now available on SCL & SDA pins. Can also be level switched via SW3.




No, I can't say when the new hardware will arrive. Please don't ask. :-) But I will say Real Soon Now™. Stay tuned!!

Wednesday Oct 06, 2010

Hands On Labs Available

If you attended JavaOne in the past few years, there's a chance that you got to attend one of the Sun SPOTs Team's Hands On Labs. If you did, this may be less interesting to you.


If you didn't, then read on!


I've just finished posting the entire contents of 2 Hands On Labs, this year's "Web of Things" HOL from this year, and the "Developing Distributed Wireless Applications" from 2008. Sorry that last one took so long.


Head on over to www.sunspotworld.com and work your way through the slides and examples! YOu can do them on-line, from the website, or download the Zip File of the entire lab contents (you may want to do that anyway, as the source code for the labs and the solutions are included in there).


Note that while the Distributed Wireless Applications Lab can be run entirely in the Emulator included with the Sun SPOT SDK, the Web Of Things Lab actually requires a physical Sun SPOT kit. Which we're still sold out of. Real Soon Now. Really.

Monday Sep 13, 2010

64-Bit Windows and Linux Support

So people have been asking for a while (a long while, sorry folks) about 64-bit support for Sun SPOTs. We don't officially have it, but I can at least share with you how to make it work. So I'll do that.


First, you will need one of the recent releases of the upcoming 'yellow' release. You can get this from the Beta or Developer release centers in Sun SPOT Manager. Just select either one in the Preferences tab and install (you don't have to actually use the yellow release, but the .inf file you will need for 64-bit support is only distributed in the recent releases of yellow). Of course for Linux there is no required .inf file, so you can skip this step.


SPOTManagerUpdate.png


Install the Yellow release before plugging in a Sun SPOT. Once you have plugged in a Sun SPOT, the correct device descriptor file (.inf) should be loaded. If you have previously tried to use a Sun SPOT on your machine, you may have to remove all previous Sun SPOT devices to force Windows to reload the descriptor file.


Once that is done you can load any version of the Sun SPOT SDK that you like, as the rest of the steps can be completed under any version of the SDK once the correct device descriptor file has been loaded.


Go to CloudHopper and download the 64-bit version of the RXTX library for your platform. Place the files downloaded (if they are not automatically unzipped, you will need to unzip them first) into your sdk\\lib directory. You will need to replace the rxtx files in any sdk\\lib directory for any sdk you plan to use. The Sun SPOT SDK comes only with the 32-bit binaries. I suggest that you keep a copy of the 64-bit binaries (and jar file) some place where you can just copy it from whenever you install a new version of the SDK.


That's all there is to it!

Thursday Sep 02, 2010

Not going green, going Yellow!

I know, going green is all the rage these days (just look at the theme of my blog!).


And Sun has been one of the greenest of the green companies for years.


But we're (The Sun SPOTs Project) going Yellow!


For those of you that live on the hairy bleeding edge with us, you may have been using the Yellow engineering or developer builds for quite some time. But we're moving from Developer to Beta today, so the Yellow release is officially out in Beta as of tonight!


Just set your Sun SPOT Manager Tool to the Beta repository (don't make me have to tell you how to do that!) and download and install the Yellow-BETA1 version.


I'll be doing another post soon with all the new features and bug fixes included (we've been busy as bees making this a great release in anticipation of some new hardware!), so please download, install, test, and let us know what you think!

Friday Aug 06, 2010

The SunSpotStore

Wow. This is cool! The Sun SPOT Store is now open for business! Order spare batteries, eSerial Boards, and other add-on components.


This is cool. Very cool.



home_content.jpg


[From Welcome to the SunSpotStore]





Check them out, and support them (you know, by actually buying stuff from them!!). Watch the Sun SPOT ecosystem grow!

Thursday Jun 10, 2010

Want to be part of the fun?





That's right, the Sun SPOTs team in Oracle Sun Labs is hiring!! We're looking for qualified, motivated, and fun engineers to join the Sun SPOT team and Oracle Sun Labs.


Go to the Oracle Careers website and search for 'IOTA' (I'd link directly to the jobs, but it won't let me). But Those are pretty vague. If you've been following along here, or over at Sun SPOT World, you know what we do, you know who we are, and you'll know if you're what we're looking for!


So go apply! Come join the team!!




Monday May 17, 2010

New Pricing for Sun SPOTs

So we're almost sold out of Sun SPOTs, but we have also changed the pricing model. Remember when users were complaining that the retail price for $750/kit was too high? Right. So we have made some adjustments to the pricing model.



  1. There is no difference between 'retail' and 'educational' pricing anymore.
  2. The single price is $399.00 per kit.


You read those prices correctly. We have lowered the retail price from $750.00 to $399.00 which is a pretty darned good deal! I encourage you all to get over to our store and order up!

Monday Apr 26, 2010

The New AirStore in Sun SPOT SDK

Many of you may not know this, or may not have noticed, since ... well, we haven't made much noise about it, and it's only available in the Developer Releases so far, but it's just too cool not to say something about.


AirStore. What is AirStore? It's pretty much just what it sounds like. Storing stuff "in the air." And that's pretty much how it works. From one SPOT I can take some information and put it into the AirStore. Then from any other SPOT on in the area, I can just get values out of that AirStore. No writing the tiring code of connecting the radios, of making sure you're connecting to the right SPOT, etc. Just get some values.


And it really is that easy. A few steps:



  1. Add these lines to your project's build.properties file:


    user.classpath=${sunspot.home}/Demos/AirStore/lib/AirStore_common.jar:${sunspot.home}/Demos/AirStore/lib/AirStore_device.jar
    utility.jars=${sunspot.home}/Demos/AirStore/lib/AirStore_common.jar:${sunspot.home}/Demos/AirStore/lib/AirStore_device.jar

  2. Next, in your 'sending' project, just add an AirStore and put values in it:


    int x = 49;
    int y = 47;
    int z = 97;
    Record r = new Record();
    r.set("X", x);
    r.set("Y", y);
    r.set("Z", z);
    AirStore.put(r);

  3. In your 'receiving' project, add an AirStore and get the values from it:


    RecordTemplate rt = new RecordTemplate();
    rt.add("X");
    rt.add("Y");
    rt.add("Z");
    Record r = AirStore.getMatch(rt);
    int x = r.getInt("X");
    int y = r.getInt("Y");
    int z = r.getInt("Z");

  4. That's it!

Seriously. That's all there is to it.

By using the built-in (in the Demos directory) AirStore Inspector Application you can see the values being stored in the AirStore:

org.sunspotworld.airstore.inspector.AirStoreInspector001.png

If you deploy code containing step 2 to one SPOT, and code containing step 3 to another SPOT, the value of X from SPOT 1 will be sent to SPOT 2 (or, rather, any number of SPOTs running the code in step 3!). You'll see those values 'stored' in the air, and 'retrieved' from the air as well.

Now, there's something in there that needs a bit more explaining. The RecordTemplate part. This is a nifty bit of work that allows you to only retrieve records from the AirStore that match a particular pattern. In the code-example above, only a record in the AirStore that has X, Y and Z Keys will 'match' the template, and will be retrieved. So if I have another SPOT storing values into the AirStore as "A", "B" and "C", they won't get mixed up and mis-read here.

You can run the AirStore Inspector Application by running 'ant host-run' in the Demos/AirStore/AirStore_Inspector directory that comes with your SDK (starting with Red). With the AirStore Inspector running (see above) you can see the values you are writing to the AirStore.

This is a simple example of making a simple program to transmit values from one SPOT to another. Notice how much easier this is than the old way of establishing radio connections, etc. AirStore handles all of those details for you 'under the covers' so all you have to do is deal with your application code.

It is possible to 'remove' records from the AirStore rather than just getting them, and I'll cover that in a subsequent blog post.

Tuesday Mar 09, 2010

Forum Spam fun

So we get a fair amount of spam posting in our user forums. And by 'fair amount' I mean a lot. Mostly it's the bots trying to create spam accounts, which fails miserably since I'm smarter than they are (today), but sometimes a persistent one actually uses a real email address, and then goes to the trouble of actually authenticating their account so that they can post. Then they have the audacity to post. Mostly they are pointless, harmless, and sometimes even funny.


This one was all of those things. Mostly. (Yeah, I deleted it anyway, and banned said spammer from the forums for being a miscreant, but I always do that.) Anyway, moments after I deleted the post and banned the spammer, Randy Smith forwarded me (via email) his response to the posting, since the post showed up in his RSS feed.


Here's the post:



Date: March 9, 2010 4:41:20 AM PST

Subject: Sun SPOT Manager | How do you make sunspots

Reply-To: alexeena <alexeenasaluja-AT-gmail-DOT-com>





How do you make sunspots on the face go away? I've had one sunspot on my face for about 2 1/2 months and several other sunspots on my face for a bout a month. Please tell me a way that actually makes sunspots go away. Thank you.


Statistics : Posted by alexeena • on Tue Mar 09, 2010 1:41 am • Replies 0 • Views 2


And here's the response I got from Randy in my email:




Sun-SPOT-itis

Ok, so maybe it's not funny to you, but I actually LOLed. Yes, out loud and everything.

Friday Feb 26, 2010

All New Sun SPOT Manager Feature!

With no fanfare, and an awful lot of trouble, I released this week a new version of the Sun SPOT Manager application to the world. (Or should I say I inflicted it upon the world?). There were a few hiccups in the release, but those are behind us now, and things are smooth sailing again.


So why am I writing about this new release of Sun SPOT Manager? Well, because I've added a new "Community Building" feature to it that I hope you'll all start to use and find useful.


When Sun SPOTs first arrived in our offices -- the very first ones that ran on 2 "AA" batteries -- we all started busily trying to write applications for them. We also started walking up and down the halls of Sun Labs, and sending a flurry of emails, about how exactly to write applications for Sun SPOTs. Randy Smith wrote, we think, the first Sun SPOT application that exercised all the sensors on the sensor board. His code touched every sensor, and the LEDs (there were only 2 in those days). So we all immediately began copying and pasting the small bits of code we wanted out of Randy's application into our own. Making a few changes here and there as needed, and extending the code to suit our needs. In essence, every Sun SPOT app we have written has been an extension of, and built off of, this original code (at least to some degree).


So we thought it would be a great thing to make it easy to find useful bits of code -- we call them 'snippets' now -- and to be able to share bits of code easily. Enter the 'Sharing' tab on Sun SPOT Manager:





CodeShare001.png



Figure 1.



So far, we've got only 5 categories of Code snippets (Sensor, General, Host, Driver and Communication) for you to choose from, but we can add more as needed. You'll need a live internet connection to use the Sharing tab, as it connects live to our Snippet Database where all the code is stored. Also, as this is a new feature, the Snippet Database is a bit light on content but we're counting on all of you to quickly add your snippets and build it up. This is a resource for and by our community of users and developers, so build your resource!


Part of any community is your 'standing' in the community. It never hurts to have the respect of your peers. And we've made it possible to develop a 'following' and build your credibility in the Sun SPOT Snippet community (of course!). Your peers will be able to 'rate' your code snippets (no, you can't rate your own! We figure that you'd rate it a 5 out of 5 anyway, otherwise why would you be posting it?) and comment on your code snippets. So you'll be able to see how much people like your code, and how useful it is (and yes, it will be 'policed' to be nice, keep it reasonable, and remember, this is a community!)


Using the Sharing Panel


So how does this 'Sharing' work? Well, like the rest of the Sun SPOT Manager, I tried to make it as easy and intuitive as possible, but I'll give a short tutorial here (and please, if you, as a user of Sun SPOT Manager, find things that don't make sense or that you think need to be improved or changed, by all means let me know! I love feedback!).


As you can see in Figure 1 above, just click on the "Sharing" tab and you'll see the 3-paned window for Snippet Sharing. On the left side is the list of categories (if all the categories I listed above aren't showing, it just means that we don't currently have a Snippet in our database for that category, so please add one!). Clicking on a category will expand it, showing you the snippets in that category.





CodeShare002.png


Figure 2.




As you can see from Figure 2, if you hover your mouse over a snippet in the list you will see some additional information about it including a longer description, the author, and the rating. If you then select that snippet, the contents of the snippet will load into the 'Source Code' pane, and the rating and any comments will load into the pane below. YOu can drag these panels to resize them to fit your needs.


CodeShare004.png


figure 3.


The Source Code window shows the Source of the Snippet in a syntax-aware code editor window (well, you can't actually edit the code in there, but it is a full code-editor window so you get syntax highlighting, etc. If you want to save the Code Snippet for your use, you can either select and copy as you would in any application, or click the 'Save..." button to save the snippet as a file on your local machine.


Sharing a Code Snippet


So how do you share a Code Snippet that you have? Again, I tried to make this as easy and intuitive as possible, so just click on the 'New' Button. You'll see the Snippet Entry Window and you can either cut/paste a portion of code into the Source Code Editor, type it in directly, or select an existing Source Code file from your local computer.





CodeShare005.png


Figure 4.


The code will enter complete with syntax highlighting, etc. (though we don't provide code-completion). Once you're done, just click the 'Share' button to upload the Snippet to the Snippet Database. (Note: You'll need an account within the Sun SPOT Forums area of Sunspotworld.com in order to upload snippets. If you don't have one, please register here!) Once you're logged in, you can name your Snippet, and provide a brief description. Note that the brief description is what will show up in the pop-up as seen in Figure 2, so keep it short. You can however use some limited html syntax here like <strong> or <b> or <i> or make an unordered list (<ul>;) etc. You can't include URLs, graphics, etc. though.


Once you have uploaded your snippet, the Share Panel should re-load, and you should be able to find your new Code Snippet! (If it doesn't reload, just hit the 'Refresh' button to get a reload.


Updating or Removing your Snippets


You may notice (once you have uploaded a snippet or two) that when you select one of your own snippets, the 'Update' and 'Delete' button become available. Also, if you have selected one of your own Snippets the Code View window becomes editable and you can make changes to your Snippet. Once you've made changes, just click the 'Update' button to write those changes back to the database.


Likewise, if you decide that your Snippet really isn't your best work, and you'd like to delete it altogether, just click the 'Delete' button. Keep in mind, however, that this will delete your Snippet, any and all Comments, and the rating of your Snippet and it cannot be undone. All of that data will be lost forever.


Commenting on and Rating Snippets


Rating a Snippet is about the easiest thing to do: Just click on a coffee cup! They rank from left-to-right, so clicking on the left-most coffee cup will rate the Snippet a '1' (you'll have a chance to confirm your rating before it's submitted). Again, you need to be logged in to Comment on and Rate Snippets.


To Comment on a Snippet, just click on the 'Comment' button and fill out the form! You'll see any existing comments (in case you're responding to one) and can enter your own comment text. If you don't want your name displayed with your comment, just un-check the "Show Name" box (Note: choosing not to display your name will, in the tradition of slash-dot, list your comment as having been submitted by "Anonymous Coward").





CodeShare006.png


Figure 5.


That's all there is to it!


Again, this is your community of Snippets and fellow developers! Share your best stuff!



Tuesday Jan 12, 2010

Too cool not to share!

So I came in to the office this morning (ok, so I went downstairs to my office, since I work from home, but I digress) and found the following new post on the Forums at sunspotworld.com and had to share it. I'm sharing it verbatim:



2010-01-12_212120.jpg


a host program with a visualized Graphical interface






2010-01-04_154553.jpg


Intelligent Vehicle model




Using Sun SPOT as controller ,dual motor drive ,Infrared Sensors,LED lights and so on ,We made Intelligent Vehicle models that can avoid obstacle automatically, be controlled remotely and change speed. Meanwhile Sun SPOT is used as tools of communication. We realized wireless communication networks among Intelligent vehicles without any fixed infrastructures called Mobile Ad Hoc Network.

As the picture shows above, we made some intelligent vehicles which equipped Sun SPOT as controllers, Infrared Sensors as detectors, LED lights and Motor Drive.We write some program in the IDE of NetBean to simulate and realize Cooperative driver assistance systems, Current floating car data services and User communication and information application.

In Cooperative driver assistance systems, when our Infrared Sensors in the intelligent vehicle detect obstacles ahead , it can automatically change its direction, avoiding a crash happens. On the other hand when hard braking happens in one car ,another car behind would stop and change its direction if it is possible. Another example we can automatically lights up or down according the light intensity, so the drivers would not be troubled by the switches.

In Current floating car data services, We use Sun SPOT Base connected with PC as commander to tell the intelligent vehicle where to go and How fast. if the traffic is heave in the way to our destination, we command our car running slower for example.

In User communication and information application We just exploit some host function that can inquire the temperature and light intensity from cars with Sun SPOT.

We write a host program with a visualized Graphical interface as show above .We can remotely control vehicles with functions we mentioned above.




So therer you have it! A very cool project using Sun SPOTs. Go check it out, and post a kudos to the author, since he did such a cool project, and then was kind enough to post about it on our forums!




[ Larkinson's Law:

All laws are basically false. ]

Tuesday Jan 05, 2010

This time I mean it.

I've been saying this all year, but really, this time I mean it. No, I really REALLY mean it. I'm going to get back to blogging.


So as a start, I'll let you all in on what I've been working on lately. Yes, once again it's more additions to the Sun SPOT Manager. Cool additions, of course. These additions are not out yet, mind you, so don't go looking just yet. But Real Soon Now(tm) I promise.


So what are these new additions? Well, it's an easy way to share (and find shared) pieces of Sun SPOT code. We call them Code Snippets right now. And there will be a new tab on SPOT Manager for Sharing, and finding, Code Snippets. So far, it looks like this:


sharing1

You can see the Categories of snippets in the left list. (If there are categories you think should be added, let me know via the comments section. We just made these up out of thin air!). Clicking on a Code Snippet in the list will load it into the Code Viewer/Editor pane on the right which gives you complete syntax highlighting, line numbering, etc. All of that goodness is thanks to jSyntaxPane, which is very cool.


sharing2


jSyntaxPane also gives me a full search capability in a loaded Code Snippet (via ctl-f), including support for regular Expression syntax, if you're into that sort of thing.


sharing3

I'm also working on adding (well, I've already added it, just need to tweak it some more) full search capabilities so that you can search the Code Snippet database for exactly what you're looking for, based on any of the fields in the database.


sharing-search

And finally, since everyone will want to know just how good their Code Snippets are, there is a rating and commenting system included. So you can select a Code Snippet and add a rating (in Java Coffee Cups, of course!) and a comment. This system is still under development, and will likely be implemented a lot differently than you see here, but there will be a rating and commenting system, for sure.


sharing-rate

If you have suggestions on how you'd like to see the ratings and comments done, feel free to drop me a line!




[ May the bluebird of happiness twiddle your bits. ]



Wednesday May 13, 2009

Robotics and SPOTs

logo.jpgIf you're into robotics (and why wouldn't you be, right?), and especially if you're in the younger crowd, you'll likely be as excited as we are about this news: FIRST™ adds Java™ Technology to the First Robotics Competition Tool Kit. Yeah, that's us. It's Squawk.  


If you want to know more about FIRST, head over to their website. It's cool stuff, and having Java, and Squawk, as part of it is just too cool!


[ "That must be wonderful! I don't understand it at all." ]

Friday May 08, 2009

Awesome Blog Post

starfish.png


No, not this one, or even one of mine! But this one from my boss, Roger.


So now we're going to have to arrange for a Sun SPOT Engineering outing to Great America in San Jose to get some telemetry off of some of the big-boy rides there.


[ Hardware, n.:  The parts of a computer system that can be kicked. ]

Wednesday May 06, 2009

Red Beta

Ok, it's been a while since we've pushed out a Beta -- we've been doing fairly regular Developer Builds -- so it's that time! Version 5 of the Sun SPOT SDK (we call it 'Red') is now available on the Beta site.


Not sure how to get the Beta Software? Here's a quick tutorial.


If you already have the Sun SPOT SDK Installed (and of course you do, don't you?), then start the Sun SPOT Manager Tool.


Go to the 'Preferences Panel:




SPOTManager1.png


And select the 'Beta Update Center':




SPOTManager2.png


Then go back to the SDKs Panel:




SPOTManager3.png


and install the red Beta1. It's really that easy.


And for those of you that like to live on the bleeding edge with us, you can always go back to the Preferences Pane and select the 'Dev Preview' Update Center for regular Developer Builds. Right now, the Beta1 build and the last Dev Preview build are bit-for-bit exactly the same, but just for future reference ... (Note: The SPOT Manager will remember your choice of Beta Update Center or General Release Update Center, but by design it will always 'forget' the Dev Preview selection, just to keep you from accidentally installing a (potentially unstable) Developer Build.).


Enjoy! And please report any issues you may have on the forums. Also note that the Robotics Emulator and lots of other cool stuff is included in this release, so enjoy!


[ Real Users never know what they want, but they always know when your program doesn't deliver it. ]

Wednesday Apr 22, 2009

More than Just A New Look

There is more than just a new look at SunSPOTWorld.com these days. There is new content as well!


In case you haven't been following along, we have been releasing fairly regular "Developer Builds" of the Sun SPOT SDK. The upcoming release, code-named 'Red' is available to all as a Developer Preview Release, and it has a lot of cool new features (which I'm not going to go into here. A different blog post for that, I hope). What is in this release (the latest one anyway) is a Robot Simulator.


Let me say that again: A Robot Simulator. You can now, without physical Sun SPOTs, do a complete robot program to control an iRobot Create! Check out the simulator running a maze program:




Solarium001.png

And you can program the simulated Create in Java, deploy your program to a virtual Sun SPOT in Solarium, and then run it in the Robot Simulator. I have to say, this is one of the coolest things to come along in a while. Seriously.


You can work through the new Tutorial on using the Robot Simulator, or work through the standard Sun SPOT Tutorial, or just go straight to downloading the Sun SPOT SDK and playing with it! I recommend at least working through the standard Tutorial to start with, and reading the Getting Started documentation as well (does anyone really read the docs?).


This is just some of the new content we have developed and are developing to go along with the new release of Sun SPOT SDK.


Note: In order to access the Developer Preview Builds of the Sun SPOT SDK, you will first need to install the standard Blue release (if this is your first foray into the Sun SPOT SDK), and then go to the Preferences Panel of the Sun SPOT Manager and select "Dev Preview." Then return to the SDK tab and install the latest Red release.


Oh, and don't forget to visit the forums for tips, support, ideas, and just to see what other Sun SPOT Developers are up to!


[ Now and then an innocent person is sent to the legislature. ]

Friday Apr 17, 2009

Say Goodbye to the Brady Bunch!

The old SunSPOTWorld.com website, with its Brady Bunch Navigation is a thing of the past! It looked like this:





spotworld.png


And we've officially gone green! Check out the new layout and navigation and content and everything!





SPOTWorld2.png


Let me know what you think of the new site!






[ Next to being shot at and missed, nothing is really quite as satisfying as an income tax refund.


   -- F. J. Raymond ]

Saturday Mar 14, 2009

Minority Report (Take II)

So many (at least some) of you may remember the original Sun SPOT Minority Report Demo (hey, it made Engadget!) that was making the rounds. It was very cool.


Now, another group, unaffiliated with Sun, has made a new, two-handed version using their own gloves and Sun SPOTs.


It's very well done, and looks very cool! Check it out!

[ This fortune intentionally not included. ]

Saturday Jan 17, 2009

Get your Own eProto

200901172205.jpgOf course, you'll have to be good at soldering, or know someone that is, but you can order an eProto Kit from Brildea. But at this point, it's the only place you can get one, as we're (Sun Labs and the Sun SPOT Team) not able to manufacture and sell them.


I know it's not an ideal solution, but it's the only solution we have right now.


[ Nudists are people who wear one-button suits. ]

Friday Jan 16, 2009

Never blogging again

After my boss turned me on to this site, I have decided that I may never blog again. I may just make all my blog entries animated videos like this one:







It's a tad self-referential, but still...


[ Death is life's way of telling you you've been fired.


-- R. Geis ]

Thursday Jan 15, 2009

Bluetooth SPOT

My latest "Stupid SPOT Trick" has been to connect a Bluetooth board (from Sparkfun.com, of course!) to a Sun SPOT. It is both easier than it looks, and harder than it looks. Huh? Let me explain.


In a previous post I wrote about doing bi-directional Serial port access to a Sun SPOT so that I could talk to a device attached to the UART on the eDemoBoard of a Sun SPOT. So, of course, when my BlueGiga Board arrived, I immediately wired it to the eDemoBoard UART on pins D0 and D1. Seemed like the reasonable thing to do. At the time anyway.


Turns out that, according to the datasheet on the BlueGiga board (and don't try to buy one right now, I bought the last 2), it wants to communicate at 115200 baud, 8-N-1. Not being one to read the documentation all that thoroughly, I was unaware that the UART on the eDemoBoard will only go as high as 38400. So all my attempts to communicate resulted in garbage out (to be fair, garbage in, garbage out).


Turns out what you need is an eProto Board. With that, you can put Tx to pin A5 and Rx to pin A6, power to +3v and ground, and voila ... almost. There is one more trick to getting this board going. You need to connect the BTEN pin on the BlueGiga Breakout board via a 100k Ω resistor, to Vcc as well or the board, while powered, will not actually come up. Once I had all that done, of course, it was easy.


So I now have a Bluetooth-enabled Sun SPOT that can talk to other Bluetooth devices over the Serial Port Protocol (SPP) profile of Bluetooth via RFCOMM. I have it doing discovery (to find other Bluetooth devices), Authentication exchange, and full-duplex serial data exchange. Nice!


[ The generation of random numbers is too important to be left to chance. ]

Friday Jan 09, 2009

Read/Write Access to a Sun SPOT

So while I'm in the “use[ full | less ]” Sun SPOT tips mood, I thought I'd post this one. Since I just worked it out this morning, and since it is directly related to the previous 'tip'.


How would you implement a 'console' application on a Sun SPOT? Well, the bigger question of course is “why would you want to?” but that's a bigger question, so I will ignore it. But it is possible. Being a CLDC Device, the Sun SPOT has a System.out (as you are probably aware) but no System.in. So while your application can simply do a “System.out.println(“Foobar”); and that message will show up on a connected terminal of your host computer, you cannot read input from that computer via System.in as you might on a regular J2SE application.


But there is a way around that. If you poke around in the Sun SPOT Developer's Guide, you will find (on page 30, in case you're interested) a brief description of using the serial port of the Sun SPOT.



InputStream input = Connector.openInputStream("serial://usb”);

OutputStream output = Connector.openOutputStream(“serial://usb”);



Will open the input and output streams, respectively, of a USB-connected Sun SPOT.



while(true) {

   try {

   StringBuffer myBuf = new StringBuffer();

       int character;

   while ((character = input.read()) != (char)'\\n') {


    if((char)character == '\\r') break;

    myBuf.append((char)character);

    leds[0].setOn();

    } // Blink LED

    leds[0].setOff();

    String outString = "Read String: " + myBuf.toString() + "\\n";

    output.write(outString.getBytes());

     output.flush();  

} catch (IOException ex) {

   ex.printStackTrace();

}

}


Is all you really need. That will read input from the terminal, and echo it back after you hit return. Not very useful, but it could be used to send commands to an attached device (which is what I'm going to be doing. Watch for a post on controlling a BlueTooth Module attached to the eDemoBoard UART shortly).


But how does this relate to the BootLoaderListener thread from my previous post? Well, it turns out that if you followed my advice on that post, this code will fail. The BootLoaderListener will grab the serial UART, so your attempt to do so will generate a fatal exception. So while it is (generally) a good idea to run that thread, in this particular case it is a bad idea.


More to come on the BlueTooth Module as I get there.


[ A fool must now and then be right by chance. ]

Thursday Jan 08, 2009

Good SPOT Programming Practice

Since I've just been bitten by this one, I thought I would post a quick note on what I consider a good practice in SPOT Programming: Adding a bootloader listener thread. It's extremely easy to do, and (trust me on this one) it can save you a lot of time. The line you want is:


   new BootloaderListener().start(); // monitor the USB (if connected) and recognize commands from host

Add that as the first line in your MIDlet's StartApp() method. Now, why would you want/need to do such a thing? And how can it save your bacon? Well, (as I have just experienced) some things -- in my case I2C -- can get into a tight loop. Such a tight loop that it can be difficult to reset the SPOT with a button press. I spent quite a bit of time trying to time the plugging-in of the SPOT with an upgrade command to get past this tight loop I was in.

The bootloader listener thread running will 'hear' the bootloader command request when it is sent (at least after a small delay) and respond, automatically resetting the SPOT and dropping into the bootloader so that you can upgrade your SPOT, re-depoly an application, etc. Or just fix whatever got you into that tight loop in the first place. It's a life-saver when you need it, and takes very little overhead when you don't so it is definitely worth it.


[ Food for thought is no substitute for the real thing.


-- Walt Kelly, "Putluck Pogo" ]

Wednesday Jan 07, 2009

I can't say

I'd love to blog about this, but my boss said I can't. Blame him.


[ "He's the kind of man for the times that need the kind of man he is ..." ]

Monday Dec 01, 2008

New Breakout Board


Ok, so this is cool! It actually came from someone in Sun Labs, but not from the Sun SPOTs project. This is just one of those things that 'happens' when folks start playing with Sun SPOTs. 


What is it? It's a breakout board that makes access to all the various pins and inputs on the Sun SPOT eDemo Sensor Board really easy to access for prototyping. And the really cool part about this is that you can buy this board today, either as a pre-stuffed, complete and ready to use board, or as a 'kit' that includes the PCB and all the components so that you can practice your soldering skills. Once you're done, you can use a ribbon cable to connect to the Sun SPOT Header and have easy access to all the pins without having to solder to your Sun SPOT and (potentially) damage your Sun SPOT Board.


 And it's (relatively) cheap, too! Check out CircuitMonkey.com for the full scoop, but the fully populated, ready-to-use board is about $33.00 (US).


Cool stuff!


[ "Benson, you are so free of the ravages of intelligence"                -- Time Bandits ] 

Tuesday Nov 25, 2008

SPOT In Nature Article

So this is a really cool article on Sun SPOTs, our good friends over at Warren Wilson College in Asheville, NC, and their project in the Cocobolo Nature Preserve down in Panama. (How's that for a sentence chock-a-block full of links to just about everywhere on the inter-tubes?)


I highly recommend reading it, even if they did get the job titles of Roger Meike and Arshan Poursohi mixed up (unless there was some organizational shake-up of which I am unaware).


But the big news -- or at least the answer to the biq question is -- that you can go here to actually get involved and be a part of the project. You may not get a trip to Panama out of the deal, but you can contribute to the project, and do your not-so-small part to fight Global Climate Change. There's a lot of additional information over here as well. Come on, get involved!




[ Yes, but every time I try to see things your way, I get a headache. ]


Friday Oct 24, 2008

Sun SPOT Media Feed




2757420833_63b59bdf4a.jpg


[photo courtesy of Pete "The Plumber" St. Pierre]


No, the Sun SPOTs don't feed off of the media (though that's an idea ... ) but we do have a couple of interesting feeds for Sun SPOT related information.



  • Planet Sun SPOT

    This is an aggregator for news and blog posts about Sun SPOTs. If you have a Sun SPOT-related blog that you want listed here, please let us know and we'll add you!
  • Sun SPOT Media Feed

    This is a page where we gather pictures, videos, etc. of Sun SPOT projects. If you want your project, picture, or YouTube video to show up on this page, just make sure that you tag it with 'spaughts' when you post it (or go back and tag it now!) and it will automatically show up here.


So get blogging, photo-ing and video taping! And get them posted!! We want to see it!



[ If you think nobody cares if you're alive, try missing a couple of car payments.



-- Earl Wilson ]


Thursday Oct 23, 2008

Maze Game


SunSPOTWorld.png

Nice video of one of our users developing a Maze Game using Sun SPOTs











Remember, if you do a video of your Sun SPOT Project, put it on YouTube with the tag 'spaughts' and it will show up in our YouTube Feed for all to see, and possibly get featured on the SunSPOTWorld.com website, or here!


[ Only God can make random selections. ]



Wednesday Oct 22, 2008

Sun SPOT Car (Russian even!)

basic_diagram.jpg


So There's a new blog post from a Sun Campus Ambassador, about a new Sun SPOT Project they did which sounds awesome. Go check it out: here. And tell em I sent ya! <wink>


[ They're only trying to make me LOOK paranoid! ]

Tuesday Oct 07, 2008

Mems Gyro


00698-03-L.jpg


So I'm catching up on some of my "Stupid SPOT Tricks" and figured I should post this one. A long time ago now I got a couple of the IDG300 Dual Axis Mems Gyros from Sparkfun. Awesome little part. As usual, frighteningly easy to work with.


I wired it up to the Sun SPOT as follows:




















Gyro Wiring
Gyro Breakout Board Sun SPOT Pin
3.3V +3
GND GND
Yout A0
Xout A1
Vref None


For those of you that do better visually:


Gyro1.png

The wiring, as you can see, was simple and straightforward. The code, as usual, is as well.

Upon running the code the first time, I noticed that the gyro has a small amount of 'jitter.' The readings vary by a small amount even when the device is perfectly still. So I had to account for the jitter and quiet it somewhat. The basic class is very small:


public class MemsGyro extends MIDlet {
private static final int C_SLEEP = 100;
private static final int READ_SLEEP = 100;
private ITriColorLED [] leds = EDemoBoard.getInstance().getLEDs();
IScalarInput yout = EDemoBoard.getInstance().getScalarInputs()[EDemoBoard.A1];
IScalarInput xout = EDemoBoard.getInstance().getScalarInputs()[EDemoBoard.A2];
private int xDiff, yDiff;


protected void startApp() throws MIDletStateChangeException {
System.out.println("Hello, world");
new BootloaderListener().start(); // monitor the USB (if connected) and recognize commands from host
ISwitch sw1 = EDemoBoard.getInstance().getSwitches()[EDemoBoard.SW1];
calibrateGyro();
int x=0,y=0;
try{
while (sw1.isOpen()) { // done when switch is pressed
leds[0].setOn(!leds[0].isOn()); // Blink LED
int tx = xout.getValue();
if(tx > x+xDiff || tx < x-xDiff){
System.out.println("X Rotation: " + tx);
x = tx;
}
int ty = yout.getValue();
if(ty > y+yDiff || ty < y-yDiff){
System.out.println("Y Rotation: " + ty);
y = ty;
}
Utils.sleep(READ_SLEEP);
}
} catch (IOException ex) {
ex.printStackTrace();
}
notifyDestroyed(); // cause the MIDlet to exit
}

And the method I added to account for the jitter is:


private void calibrateGyro(){
int xMax = 0, yMax = 0;
int xMin = 100000, yMin = 100000;
leds[0].setRGB(100,0,0); // blink red while calibrating
try {
for(int z = 0; z<100;z++){
int y = yout.getValue();
int x = xout.getValue();
if(y > yMax)
yMax = y;
else if(y < yMin)
yMin = y;
if(x > xMax)
xMax = x;
else if(x < xMin)
xMin = x;
leds[0].setOn(!leds[0].isOn()); // Blink LED
Utils.sleep(C_SLEEP);
}
xDiff = xMax - xMin;
yDiff = yMax - yMin;
System.out.println("X Variation: " + xDiff + " Y Variation: " + yDiff);
} catch (IOException ex) {
ex.printStackTrace();
}
leds[0].setRGB(0,100,0); // otherwise blink green
}

And that just samples the Gyro for a few seconds, and determines what the maximum variation is while the Gyro is 'quiet' and then uses that later to tell us if the Gyro is actually on the move.

Now, what you use this for is entirely up to you!


[ Down with categorical imperative! ]

About

user9157252

Search

Categories
Archives
« April 2014
SunMonTueWedThuFriSat
  
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
   
       
Today