

RESTduino - Arduino hacking for the REST of us - jasongullickson
http://jasongullickson.posterous.com/restduino-arduino-hacking-for-the-rest-of-us

======
bct
This is really cool, looks like it will make integrating your microcontroller
with other systems really easy.

But - and I hate to be the REST Nazi - this is RPC, not REST.

"REpresentational State Transfer" is about making things happen by
Transferring REpresentations of resources' State.

The GET requests are good, but for setting outputs it should do something
like:

    
    
      PUT http://192.168.1.177/9
      

with body

    
    
      HIGH
    

POST could work too, the important thing is that the resource's state, the
resource's address, and the action being performed are all separate.

This RPC system is beautifully simple, it does what it needs to and I can't
think of any way that making it RESTful would improve it, but it's not RESTful
right now, and calling it that only deepens the confusion about what REST is.

~~~
extension
What you're describing might be called an HTTP API. A REST API would be based
on hypertext, standardized media types, and opaque URLs.

~~~
bct
True. Now that you point it out, it is odd that I chose to focus on that one
divergence.

------
JonnieCache
This is going to cause so much consternation. The microcontroller hacking
community already looks down on the arduino because it is vastly overpowered
for what most people use it for.

They think people should be using the arduino as a rapid prototyping system,
and then making their own circuit board with the individual components
arranged as needed.

They is a constant stream of blog posts looking for ways to get noob arduino
hackers to "graduate" to designing their own circuits.

While it all seems terribly unreasonable from the point of view of a software
developer used to the idea of a tradeoff between hardware costs vs development
time, it is very similar to the programming language wars.

See: [http://hackaday.com/2011/02/11/how-the-arduino-won-this-
is-h...](http://hackaday.com/2011/02/11/how-the-arduino-won-this-is-how-we-
can-kill-it/)

~~~
jasongullickson
The Professor on Gilligan's Island made a radio out of coconuts but that
doesn't mean you have to...

Don't get me wrong, I love coding down to the bare metal too but if something
like this encourages one "Rails Guy" to interface his web stats to a water
fountain then I'm delighted.

Besides, the smart hacker would see the business opportunity in helping these
"noobs" turn their over-powered Arduino designs into streamlined products.

~~~
JonnieCache
_> web stats to a water fountain then I'm delighted._

I'm totally doing that.

------
follower
Yeah, a REST interface a pretty interesting way to interact with the Arduino.

I made something similar a couple of years ago (the details of which used to
be at <http://code.rancidbacon.com/Flashduino> and may return when I get a
server back up).

The demo I had actually served up an Adobe Flash file that was stored in the
Arduino's flash memory (it was small and generated with Python & Ming) that
then interacted with the Arduino via the "REST" interface. I got it
reading/writing pins and the EEPROM from both Adobe Flash and Javascript
before I got distracted. :)

I've long thought that interacting with Firmata via REST could be a nice
approach--I think Massimo from the Arduino team wrote an Ethernetised Firmata
at one stage but don't think it used HTTP.

------
nickpinkston
This is pretty cool, but to be honest, as a complete software noob who also
hacks with Arduino, I don't get why this is easier than just using the
examples that comes with the IDE.

Also interesting is BugLabs' "web services" where you can log into each module
using a RESTful API:

<http://wiki.buglabs.net/index.php/Software:BUG_Web_Services>

~~~
follower
> I don't get why this is easier than just using the examples that comes with
> the IDE.

In theory it means that you can get a pre-programmed Arduino with network
connectivity and give it to a web dev person who has no knowledge of
microcontrollers and show they how they can turn an LED on or off by accessing
a URL from Javascript. No IDE required.

------
orblivion
More than a replacement for learning Arduino, I could see this being more
useful as a rapid prototype tool for interfacing between the web and a piece
of hardware or circuitry. If all you need to do is check some states and flip
some switches, why bother doing the same thing over and over in C when you can
do it more reliably in jQuery?

------
benatkin
It would be fun to put an Arduino on justin.tv and use showoff.io to let
viewers interact with it.

------
rdtsc
Just as fun : send high rate updates via websockets from your embedded system
to your browser.

<http://code.google.com/p/cwebsocket/>

------
zwieback
Nice. This is also very helpful for people like me who are comfortable with
embedded systems but have little or no modern web development skills.

------
kaerast
Oh I like the sound of this. Though personally I found this to be the easy
part; getting Arduino to send web requests to a webserver on button pushes is
far harder (especially if you want it to do DHCP and DNS lookups).

~~~
follower
> especially if you want it to do DHCP and DNS lookups

Up until now this has been true with the official Arduino Ethernet shield but
there's been work integrating DHCP and DNS functionality into the Arduino
core. I believe it's targeted at the Arduino 1.0 release.

Other networking shields (like the WiFly--disclosure, I wrote the library for
it for the manufacturer) have DHCP and DNS support out of the box.

------
erikj54
Nice project Idea. Impressive creativity.

------
squeed
_checks date_. Are you sure this isn't an April Fools' joke?

