WIP (WORK IN PROGRESS)
Ability to upload code to an Arduino Board from Google Chrome without the need to use external software like the Arduino IDE.
Makes use of the Google Chrome WebUSB API. (Needs security - HTTPS to work, localhost will work for testing)
The project consists of a node server to host a webpage on localhost (still testfase). The webpage will search for Arduino devices and establish connection.
- Command: "(sudo) node server.js"
- Go to: "http://localhost:8080/"
- Use the "Test"-Button to connect to an Arduino connected to your device.
- Resolving the CORS-error ('Access-Control-Allow-Origin')
Use avrgirl-arduino in the browser! An example chrome app that you can fork and make your own.
Install the following tools globally:
npm install -g browserifynpm install -g http-server
To run the demo:
- Fork and clone this repo
- Run
npm installwithin the newly cloned local repo - Run
browserify background.js -o background.bundle.js - In your Chrome browser, visit
chrome://extensions - Click
Load unpacked extension - Navigate to this cloned repo, and click
Select - Click
Launchwhen you see the extension appear at the top of the extensions list - Copy the
idvalue of the extension, and updatevar extensionid = '...';line intest.html - Run the command
http-server -a 127.0.0.1 -p 8080back in your terminal and visit127.0.0.1:8080/test.htmlin your Chrome browser. Also open the dev tools for logs! - Plug in an Arduino Uno, and upload a compatible .hex file to it using the test.html form
- 🎉
To develop this further or make changes:
- Edit
background.js(notbackground.bundle.js) - Always run
browserify background.js -o background.bundle.jseach time you changebackground.jsorlib/flash.js, and then manually reload the chrome app. - When you reload the chrome app, you'll also need to refresh
test.htmlso the page can reconnect to the reloaded chrome app. - Using
watchifyinstead ofbrowserifyis totes cool and will work as expected.