Tuesday Dec 07, 2010

Harnessing viruses to build a better battery

NewImage.jpgOk, now this is cool. You may not think so, but I sure do. I spent a fair amount of time researching battery types and capacities, as well as costs, and to say that it is a dizzying and complicated area is to massively understate the problem.

Considering that just about everything we use these days needs (or could benefit from) a small, lightweight and energy-dense battery (you can't really get all 3 at this time), this could be a huge step forward.

Keep in mind that one of the reasons that electric cars don't really 'work' for most applications is that the weight of the required batteries decreases the efficiency of the vehicle and, at some point, becomes counterproductive. It's all about energy density. It's the same reason that personal jet-packs don't work: You can't carry enough fuel to fly any great distance.

So if you can increase the energy density of the battery, without significantly increasing its overall weight, you win. This reported 10-fold increase in energy capacity would make this a winner.

The first virus to be discovered was the Tobacco mosaic virus (TMV) back in 1898. It is a rigid, rod-shaped virus that, under an electron microscope, looks like uncooked spaghetti. This widespread virus devastates tobacco, tomatoes, peppers and other plants but in the lab, engineers at the University of Maryland's A. James Clark School of Engineering and College of Agriculture and Natural Resources, have managed to harness and exploit the self-replicating and self-renewing characteristics of TMV to build tiny components for more efficient lithium-ion batteries.

To create the highly efficient batteries the researchers first modified the TMV rods to bind perpendicularly to the metallic surface of a battery electrode and arrange the rods in intricate and orderly patterns on the electrode. Because TMV can be programmed to bind directly to metal, the resulting components are lighter, stronger and less expensive than conventional parts. They then coated the rods with a conductive thin film that acts as a current collector and finally the battery's active material that participates in the electrochemical reactions.

10-fold increase in energy capacity

This results in an electrode with a greatly increased surface area that increases its capacity to store energy and enables fast charge/discharge times. The new batteries boast up to a 10-fold increase in energy capacity over a standard lithium-ion battery. The researchers say that the use of the TMV virus in fabricating batteries can be scaled up to meet industrial application needs. And because the TMV becomes inert during the manufacturing process, the batteries do not spread the virus.

"The resulting batteries are a leap forward in many ways and will be ideal for use not only in small electronic devices but in novel applications that have been limited so far by the size of the required battery," said Ghodssi, director of the Institute for Systems Research and Herbert Rabin Professor of Electrical and Computer Engineering at the Clark School.

"The technology that we have developed can be used to produce energy storage devices for integrated microsystems such as wireless sensors networks. These systems have to be really small in size - millimeter or sub-millimeter - so that they can be deployed in large numbers in remote environments for applications like homeland security, agriculture, environmental monitoring and more; to power these devices, equally small batteries are required, without compromising in performance," added Ghodssi.

(Via Harnessing viruses to build a better battery.)

That may be too information-dense for some, but suffice to say that it's kind of cool that it is using the Tobacco mosaic virus to increase the energy density. It's not clear if this type of technology could be useful in larger batteries like those required for electric cars and other larger applications, but being applicable to small (as in really small) devices makes it very interesting to me. If this technology is able to come to market in a useful package, it would certainly validate a certain amount of the research bets that we made by putting relatively power-hungry 32-bit processors on our sensor platform.

As an side, it also looks like some of the smart folks at MIT have done something similar that they think could be used in larger applications like electric cars, etc.

Using a virus that infects bacteria but is harmless to humans known as a bacteriaphage, the team were able to show it is possible to build both the positively and negatively charged ends of a lithium-ion battery using genetically engineered viruses. According to Angela Belcher, the MIT materials scientist who led the research team, the resultant virus-produced batteries have the same energy capacity as state-of-the-art rechargeable batteries being considered to power plug-in hybrid cars, and they could also be used to power a range of personal electronic devices.The benefits of this process is that it's both cheap and green, since it takes place at or below room temperature in an environmentally benign process that requires no harmful organic solvents and no toxic materials.

(Via New virus-built battery could power cars, electronic devices.)

So there you have it. We're finally going to extract some revenge on the much-maligned virus and bacteria and make them work for us for a change. Until, of course, the batteries become self-aware, at which point Sky-Net will be complete and we'll be toast.

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 can now deploy to SPOTs using old SDKs (provided OTA & config page format still same).

  • Added shared basestation support to radio view.


  • 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.


  • 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!!

Tuesday Oct 26, 2010

New Look

How do you like the new look? It was time to change things up around here. The old 'eco' theme was a little long in the tooth, and I had overloaded it with so much stuff it was taking forever to load. So I've moved to a more streamlined theme.

Let me know what you think!

Monday Oct 18, 2010

No Mythbusting (I Haz a sad)

Well, sadly, my Mythbusters caper is not to be. I was so looking forward to it, as it was going to be an awesome one! We were going to blow up a car. Or at least utterly destroy one.

But there are these things called lawyers. And it would seem that they have quashed the idea for fear of someone, somewhere, getting sued.

I hate when that happens. I'll just have to dream up some other scheme.

Friday Oct 15, 2010

Harmonic Code SteelSeries 1.4

As a follow up to my earlier post, I received a comment this morning pointing me to updates to the Gauges for Swing. I really do think that these are very nice swing components, and I hope you also find them useful!


[From Harmonic Code: SteelSeries 1.4 ...]

Transylvania JUG

Ok, this Java Users Group wins for the coolest Logo. A Duke that even James would be proud of.


Transylvania Java User Group

A JUG for all enthusiasts in Transylvania that think Java is (still) relevant...

[From transylvaniajug:]

And just in time for Halloween!

Thursday Oct 14, 2010

How a Physically Aware Internet Will Change the World

censors.jpg It's the beginning of SkyNet folks. Mark my words!

The next revolution of the Internet is not going to be built on manual input of information by 500 million or a billion users. Rather, there is much greater potential in connecting computers to sensors so that valuable new information can be created automatically without human data entry. Much like the early days of the Internet (which was purpose-built to help maintain our collective safety and connectivity), the next generation of sensor networks can monitor our environment and deliver relevant information –- automatically.

[From How a Physically Aware Internet Will Change the World]

Actually, this is something that I've been saying in talks for the last 4+ years! I've been saying that even if every person on the planet carried 3 cell phones, and had a personal computer, that would still be only about 20 Billion devices. Basing anything on the number of humans on the planet limits your market. On the other hand, if you put a sensor in every tire in every car, in every light socket, every switch, every everything that you can, then you're talking real numbers -- in the Trillions. Now that's a big market!

I'm just glad someone somewhere was apparently listening.

Wednesday Oct 13, 2010

International Flavor

I really like how international the visitors here are. I need some visitors from Australia, and maybe even Greenland just for fun, to fill out the map. But it's really cool how it's not just all US visitors, or European visitors. I'm thankful for all my readers! Keep coming back!

Update: I now have Australia and New Zealand! If only someone in Greenland knew about this blog ...


Custom swing components for Sun SPOTs

An excellent article posted on the Java User Group Münster website on custom Swing components, and specifically using them in Sun SPOT desktop applications. I love the UI components! We'll be using these in some demo apps soon!


[From Custom swing component | Java User Group Münster]

And make sure to read the presentation on making your own custom Swing components! I have been through it several times and hope to implement some of the concepts in future versions of Sun SPOT Manager in order to make it look ... less .. ummm ... yeah, less like that.

Monday Oct 11, 2010

Henchmen with Bad Teeth

Ok, the Orbiting brain lasers are pretty cool, but the genetically engineered cyber goats rule!

Wednesday Oct 06, 2010

This thing runs Java

But I especially like the last frame.

And Derek thinks this is about him.

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.

More Myth Busting?

mythbusters.jpgSo if you've been reading this blog for a while (right, as if!), then you've read about my previous encounters with the Mythbuster Jamie Hyneman. (I posted this one on another blog, but I just moved it here).

I'm pretty excited because I may just pull off my biggest Mythbusters caper yet! (Even bigger than almost becoming 4-square mayor of Mythbusters central ... oh, wait, I never said anything about that. Ha!) I'm working on it as we speak. All hush-hush and stuff.

So watch this space for more updates as they become available. This could be completely off the hook and too much fun, but I'm trying not to get my hopes up too much just yet ... Ok, maybe a little.


Well, we didn't bust any myths. And all things considered, Jamie was very gracious to us. I'll explain more on my other blog, and post a link here when I do.

P4240045 copy

For the first time, Adam was even there, but he didn't talk to us. (That's me in the orange shirt standing next to Jamie.)

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.


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.


[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 Jul 22, 2010

Employment Opportunities at Sun Labs

Someone out there must want to come work on our team, to work on Sun SPOTs, and to have as much fun as we have here. Check out the job listings here:

[From Employment Opportunities at Sun Labs]

And then go apply! Come join us! Make history. Or at least make Sun SPOTs. :-)

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:


  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);

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

    RecordTemplate rt = new RecordTemplate();
    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:


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.

Monday Apr 12, 2010

SparkFun.com vs SPARC International Resolved

Nice to see that this was worked out with a minimum of lawyering and all seems well again. We love SparkFun.com (hey, I just ordered a new Stepper Motor from them this morning!!) and we hated to see bad blood.

Wednesday Apr 07, 2010

Wireless sensor tags create an `instrumentation cloud`

This looks pretty cool ...


A US company has developed a wireless sensor card that introduces a new concept for performing measurement and analysis, known as the "instrumentation cloud". Cores Electronic's Tag4M WiFi sensor tag no longer relies on software running on a specific PC. Instead, it transmits data the Internet and uses Web pages as "instruments" that can be accessed by any device that that can surf the Web, including mobile phones.

According to Cores' president, Marius Ghercioiu, the tag "heralds a new way of collecting real-world data where we are throwing off the chains that bind us to specific hardware and software. Most wireless sensor units currently on the market are designed to work in local mode with a computer running a specific software application. In contrast, we designed the Tag4M to interface with a Web page, which can be hosted on any Web-enabled hardware, whether in your pocket or across the country."

More info here. [From Wireless sensor tags create an `instrumentation cloud`]

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:


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:


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.


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.


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.


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").


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:


a host program with a visualized Graphical interface


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:


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.


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.


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.


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.


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. ]

Monday Nov 02, 2009

I'm back!

It's been a long hiatus from blogging for me, but I'm back! Here, I'll make some excuses:

  1. I usually take the summer off from blogging, and it just kind of got away from me
  2. I ended up suffering from a "persistent, intractable migraine" which had me cowering in a dark room for over 3 months, and even in the hospital for 5 days. I'll can now tell you what true misery is like.

Ok, so I only have 2 excuses, and only one of those is really a 'reasonable' one. Fine, I can accept that. But I'm back and should be back to blogging regularly shortly.

Some things I hope to be blogging about soon:

  1. My trip to China with Roger this summer
  2. My current work on a Sun SPOT Application Exchange marketplace -- similar to, but of course way better than -- the Apple iTunes store, right?
  3. Some new "Stupid Spot Tricks" with some new sensors I've gotten including a soil moisture sensor (which Roger has already blogged about better than I will, but I have a project for it so ... ), some gas-detection sensors, etc.

At least that list is longer than my list of excuses for not blogging. I might even write up the experience of the headaches, since it was an epic journey, but we'll have to see on that one.

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." ]

Monday May 11, 2009

Project Kenai

Safari006.pngSo if you haven't used Project Kenai before, you really ought to check it out. Especially if you're a disgruntled user of java.net. Seriously. Here's some impressive stats about Project Kenai.

  • They've increased their membership by over 1,000 members in a little over a week's time!

  • As of today, they're sitting at 7,206 members and 521 public projects. Let's see if they can we hit 10,000 members before JavaOne!

More cool facts below.


Project Kenai, is Sun's developer "cloud" onramp. Having gone live back in September of 2008, we have exceeded over 7,000 members and surpassed 500 hosted open source projects. Currently, Kenai offers an integrated suite of productivity services for developers to host their open source code/projects as well as connect with peers of like mind (with additional cloud features to be released in the future); today's features include:

  • Evolving integration with NetBeans

  • Source Code Management (Subversion, Mercurial, and/or Git)

  • Issue Tracking (Jira or Bugzilla)

  • Wiki

  • Forums

  • Mailing Lists

  • Download facility for documents

Anyone can join by going to http://kenai.com. And if parties are ready to start hosting a project, they simply need to send an invitation request with a description of their project to: kenai-admin-AT-sun-DOT-com.

I have started a couple of Sun SPOT projects on Kenai, and hope we can migrate our existing projects over there at some point. The interface is clean and the service is fast and responsive. I love it! Try it out today!

[ "The way to make a small fortune in the commodities market is to start with a large fortune." ]




« July 2016