Renaun, evangelist at Adobe, explains how to interface your Arduino with Chrome using the serial API. You can find links to the Chrome Extension and Arduino Sketch Example Files, Chrome Serial API Page and the Brackets Open Source Web Editor at Renaun’s website.
Leave a comment

So what is this? An Arduino with an Ethernet “shield” sending serial port stuff from (or to/from) the Chrome browsers javascript API? The hardware is not clear. But I don’t have an hour to figure this all out. Did I miss something here?
Looks like the Chrome browser includes a serial API which allows local Chrome apps / extensions to communicate directly with the PC’s serial port, and he’s written up a Chrome app demonstrating javascript talking to an Arduino over its built-in USB serial. His link on his blog to the app is actually pointing to a subdirectory with the Arduino sketch, but if you move up the github a bit you’ll find the Chrome code too.
Basically the same idea as a python script or .NET app or whatever acting as a custom interface to an Arduino sketch via serial, but using Javascript. Locked to Chrome only, though, and only as a locally installed app or extension.
It’s cool to know it’s possible, and I suppose a potential advantage of making a serial-connected app this way is being able to have an easier, app-store-driven install process, but I think that’s all outweighed by how much harder it would be for your users who aren’t Chrome users already. And unless you want to walk people through installing an unpacked extension from github you’re basically requiring your users to register for a google account just to install your client interface.
Probably easier to just make a wholly standalone app, maybe using node-webkit or app.js if you want to use (node.js-backed) javascript, I believe LightTable is using one of these methods to make a standalone executable (with Windows, Mac, and Linux versions) embedding node.js and a web browser and it’s certainly easy to download and get running. Using node.js for the javascript would require a different, node.js-specific serial API, though I’m sure they exist.
For me, the exciting part of making a client interface in-browser would be the promise of cross-platform compatibility, and using a Chome-only API kind of defeats the whole purpose, especially one that’s only available to locally installed apps, not web pages. But I’m not sure if it would be possible to make anything truly browser-based unless you also brought your connected device onto the same actual network as the browser, via an ethernet/wifi shield, and so I can see why you might be tempted to make compromises to use the serial port. But I don’t know if there’s any alternative to going the networking route when it comes to tablets and phones if you want to avoid a native app.
Not sure what Adobe has to do with any of it, but maybe that’s just how he introduces himself as a force of habit.
Yes you miss. Chrome browser with this API can read directy from serial port connected to your computer, you don’t need any Ethernet device.
For me it’s looks like an serial terminal bulid in webrowser, isn’t it “P
If you know java script it could be handy.
Way to go Adobe – give up Flash, go Arduino!