3

I want to create a browser plugin or extension that I can use to control an Arduino device. The Arduino device would be connected to a user's computer through USB. The user would visit a website which the plugin would recognize and download instructions that would be used to control the device locally.

The preference is that the user only needs to install a browser plugin, and not have to install any separate software on their machine.

What would be a good way to connect the browser to the Arduino device. I'd prefer to have a solution that would work on any browser.

One thought was to communicate with the Arduino device using node.js (or some other webserver), but that would mean that I'd have to install a node.js server along with the browser plugin. I couldn't find any information out there on how to do this. I'm open to considering any language / framework.

Update: The Arduino device that I'm using is the Teensy 2.0 USB Board (http://www.pjrc.com/store/teensy_pins.html). The reason we went with this device is that there is no COM/Serial conversion so it gives full USB 2.0 throughput. The smaller device also works better for the form-factor of the device we're building.

Javid Jamae
  • 8,741
  • 4
  • 47
  • 62
  • Java is your best bet, for cross-platform compatibility. – Brad May 02 '12 at 21:14
  • oh god no, why not just build a simple web service sinatra or the node equivalent. why a plugin? On a side note, I may be offering a service in the next 6 months that will take a lot of the pain out of this an offer an api for controlling embedded hardware in real time over the web. – nflacco May 02 '12 at 21:17
  • 1
    @nflacco - Because I only want to burden the users of the device to download a browser plugin / extension. I don't want them to have to install something natively (if possible). – Javid Jamae May 02 '12 at 21:19
  • 2
    What about deploying a web service that you host, and they point the Arduino at? or have the Arduino host an http server? Could you give more info on what exactly the information flow is... Does the Arduino connect to the internet, or a local network, or just your computer? What address does the browser or plug in point to? – nflacco May 02 '12 at 21:25
  • @nflacco - Interesting idea about having the Arduino host the http server, I didn't think about that. I updated the question to help clarify things. Thanks for the feedback and ideas so far! – Javid Jamae May 02 '12 at 21:42
  • Is this a standard Arduino where the USB is a USB->serial converter? So plugging in the Arduino just adds a serial port. – Craig May 02 '12 at 22:31
  • @nflacco, What are you talking about? He doesn't want to offer up some other service, he doesn't want to send this data over the web, he just wants a client-side web application to interact with his client-side hardware. What makes you think providing a web service to send your data to, just to turn around and send it back, is a good idea in this case? A browser plugin is the way to go, and the way it must go unless he actually wants to send data out and about. Java, despite many problems, is available for most users on most platforms, and is the best compatibility he'll find for this. – Brad May 03 '12 at 03:02
  • Craig - Its the Teensy 2.0 USB Board. I updated the question with the details. – Javid Jamae May 03 '12 at 14:02

2 Answers2

1

If you want to stick with only requiring a browser plugin and only requiring the device be plugged into the host computers USB port, than using Java is one solution.

The Java applet would need to be signed, though using a self-signed cert should be alright. In the context of Java applets, this has been asked a number of times on SO that should help you get started:

  1. signed applet
  2. java usb library

Do be aware that there are numerous issues with using the Java browser plugin and users need to accept the plugins security prompt to "trust" your applet.

Community
  • 1
  • 1
Maks
  • 7,562
  • 6
  • 43
  • 65
0

The Arduino programming language is based on the Wiring programming language which has a tutorial here about using flash to communicate with the board: http://wiring.org.co/learning/tutorials/flash/index.html

(note: it does use an executable though for the server/proxy).

Yansky
  • 4,580
  • 8
  • 29
  • 24