├── .gitignore ├── README.md ├── boards ├── adafruit.json ├── arcore.json └── esp8266.json ├── package.json ├── packages ├── adafruit.json ├── arcore.json └── esp8266.json ├── proxy.js └── proxy.png /.gitignore: -------------------------------------------------------------------------------- 1 | node_modules 2 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # Arduino Board Manager Custom Board Proxy 2 | 3 | **Warning:** Third party boards are now officially supported in Arduino v1.6.4+, so this is no longer needed. 4 | Check out [this tutorial for more info](https://learn.adafruit.com/add-boards-arduino-v164). 5 | 6 | This is a simple node.js HTTP proxy that allows you to inject custom boards into the Arduino 1.6.2+ 7 | `package_list.json` file. When the list is requested, it grabs the latest package list from Arduino's 8 | servers and injects the custom packages into the file before serving it back to the IDE. 9 | 10 | You will only need to download and run the proxy if you have custom boards of your own to add to the Board Manager list. If you are looking to add Adafruit's custom boards to your Board Manager list, there is no need to download anything. Check out [this tutorial](https://learn.adafruit.com/adding-custom-boards-to-the-arduino-v1-6-board-manager) for more info about pointing your Arduino IDE at our proxy. 11 | 12 | ## Installing 13 | 14 | Make sure you have the latest stable node.js: 15 | 16 | ``` 17 | $ node -v 18 | v0.12.2 19 | ``` 20 | 21 | Clone the repo and install dependencies: 22 | 23 | ``` 24 | $ git clone https://github.com/adafruit/adafruit-arduino-proxy.git 25 | $ cd adafruit-arduino-proxy 26 | $ npm install 27 | ``` 28 | 29 | Start the server: 30 | 31 | ``` 32 | $ node proxy.js 33 | ``` 34 | 35 | ## Example Packages & Boards 36 | 37 | You can take a look at the `boards` & `packages` directories for examples. They probably can be simplified, 38 | but they are a good starting place. 39 | 40 | ![Screenshot](/proxy.png?raw=true "Proxy") 41 | 42 | ## License 43 | 44 | Copyright (c) 2015 Adafruit. Licensed under the MIT license. 45 | -------------------------------------------------------------------------------- /boards/adafruit.json: -------------------------------------------------------------------------------- 1 | [ 2 | { 3 | "name": "Adafruit AVR Boards", 4 | "architecture": "avr", 5 | "version": "1.0.1", 6 | "category": "Adafruit", 7 | "url": "http://apt.adafruit.com/proxy_files/adafruit-1.0.1.tar.bz2", 8 | "archiveFileName": "adafruit-1.0.1.tar.bz2", 9 | "checksum": "SHA-256:308e0b8c9a82fee600a3fc86f525a850008f288d4be1b4b305b1dd1be2a285e7", 10 | "size": "26390", 11 | "help": { 12 | "online": "https://adafruit.com" 13 | }, 14 | "boards": [ 15 | {"name": "Adafruit Flora"}, 16 | {"name": "Adafruit Gemma 8MHz"}, 17 | {"name": "Adafruit Trinket 8MHz"}, 18 | {"name": "Adafruit Trinket 16MHz"}, 19 | {"name": "Pro Trinket 5V/16MHz (USB)"}, 20 | {"name": "Pro Trinket 3V/12MHz (USB)"}, 21 | {"name": "Pro Trinket 5V/16MHz (FTDI)"}, 22 | {"name": "Pro Trinket 3V/12MHz (FTDI)"} 23 | ], 24 | "toolsDependencies": [ 25 | { 26 | "packager": "arduino", 27 | "name": "avr-gcc", 28 | "version": "4.8.1-arduino5" 29 | }, 30 | { 31 | "packager": "arduino", 32 | "name": "avrdude", 33 | "version": "6.0.1-arduino5" 34 | } 35 | ] 36 | }, 37 | { 38 | "name": "Adafruit AVR Boards", 39 | "architecture": "avr", 40 | "version": "1.0.2", 41 | "category": "Adafruit", 42 | "url": "http://apt.adafruit.com/proxy_files/adafruit-1.0.2.tar.bz2", 43 | "archiveFileName": "adafruit-1.0.2.tar.bz2", 44 | "checksum": "SHA-256:941de48a4258bbce8c33ffb584caab0bba11eb5428052da2303998c6535712ce", 45 | "size": "26589", 46 | "help": { 47 | "online": "https://adafruit.com" 48 | }, 49 | "boards": [ 50 | {"name": "Adafruit Flora"}, 51 | {"name": "Pro Trinket 5V/16MHz (USB)"}, 52 | {"name": "Pro Trinket 3V/12MHz (USB)"}, 53 | {"name": "Pro Trinket 5V/16MHz (FTDI)"}, 54 | {"name": "Pro Trinket 3V/12MHz (FTDI)"} 55 | ], 56 | "toolsDependencies": [ 57 | { 58 | "packager": "arduino", 59 | "name": "avr-gcc", 60 | "version": "4.8.1-arduino5" 61 | }, 62 | { 63 | "packager": "arduino", 64 | "name": "avrdude", 65 | "version": "6.0.1-arduino5" 66 | } 67 | ] 68 | }, 69 | { 70 | "name": "Adafruit AVR Boards", 71 | "architecture": "avr", 72 | "version": "1.0.3", 73 | "category": "Adafruit", 74 | "url": "http://apt.adafruit.com/proxy_files/adafruit-1.0.3.tar.bz2", 75 | "archiveFileName": "adafruit-1.0.3.tar.bz2", 76 | "checksum": "SHA-256:4cc973e2d95b0eb9e3cbb11550c4ff4d02d82879f9520b75cf42364534363d64", 77 | "size": "26674", 78 | "help": { 79 | "online": "https://adafruit.com" 80 | }, 81 | "boards": [ 82 | {"name": "Adafruit Flora"}, 83 | {"name": "Pro Trinket 5V/16MHz (USB)"}, 84 | {"name": "Pro Trinket 3V/12MHz (USB)"}, 85 | {"name": "Pro Trinket 5V/16MHz (FTDI)"}, 86 | {"name": "Pro Trinket 3V/12MHz (FTDI)"} 87 | ], 88 | "toolsDependencies": [ 89 | { 90 | "packager": "arduino", 91 | "name": "avr-gcc", 92 | "version": "4.8.1-arduino5" 93 | }, 94 | { 95 | "packager": "arduino", 96 | "name": "avrdude", 97 | "version": "6.0.1-arduino5" 98 | } 99 | ] 100 | }, 101 | { 102 | "name": "Adafruit AVR Boards", 103 | "architecture": "avr", 104 | "version": "1.1.0", 105 | "category": "Adafruit", 106 | "url": "http://apt.adafruit.com/proxy_files/adafruit-1.1.0.tar.bz2", 107 | "archiveFileName": "adafruit-1.1.0.tar.bz2", 108 | "checksum": "SHA-256:4e72d4267d9a8d86874edcd021dc661854a5136c0eed947a6fe10366bc51e373", 109 | "size": "29455", 110 | "help": { 111 | "online": "https://adafruit.com" 112 | }, 113 | "boards": [ 114 | {"name": "Adafruit Flora"}, 115 | {"name": "Pro Trinket 5V/16MHz (USB)"}, 116 | {"name": "Pro Trinket 3V/12MHz (USB)"}, 117 | {"name": "Pro Trinket 5V/16MHz (FTDI)"}, 118 | {"name": "Pro Trinket 3V/12MHz (FTDI)"} 119 | ], 120 | "toolsDependencies": [ 121 | { 122 | "packager": "arduino", 123 | "name": "avr-gcc", 124 | "version": "4.8.1-arduino5" 125 | }, 126 | { 127 | "packager": "arduino", 128 | "name": "avrdude", 129 | "version": "6.0.1-arduino5" 130 | } 131 | ] 132 | } 133 | ] 134 | -------------------------------------------------------------------------------- /boards/arcore.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "Leonardo & Micro MIDI-USB (arcore)", 3 | "architecture": "avr", 4 | "version": "1.0.0", 5 | "category": "Adafruit", 6 | "url": "http://apt.adafruit.com/proxy_files/arcore-1.0.0.tar.bz2", 7 | "archiveFileName": "arcore-1.0.0.tar.bz2", 8 | "checksum": "SHA-256:37ec329c16cc5d8f7da810665505107b24d85e6eea7e74d1677615cf7c5bcb01", 9 | "size": "1135927", 10 | "help": { 11 | "online": "https://adafruit.com" 12 | }, 13 | "boards": [ 14 | {"name": "Arduino Leonardo (MIDI)"}, 15 | {"name": "Arduino Leonardo (MIDI, iPad compatible)"}, 16 | {"name": "Arduino Micro (MIDI)"} 17 | ], 18 | "toolsDependencies": [ 19 | { 20 | "packager": "arduino", 21 | "name": "avr-gcc", 22 | "version": "4.8.1-arduino5" 23 | }, 24 | { 25 | "packager": "arduino", 26 | "name": "avrdude", 27 | "version": "6.0.1-arduino5" 28 | } 29 | ] 30 | } 31 | -------------------------------------------------------------------------------- /boards/esp8266.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "ESP8266", 3 | "architecture": "esp8266", 4 | "version": "1.6.1", 5 | "category": "Adafruit", 6 | "url": "http://apt.adafruit.com/proxy_files/esp8266-1.6.1.tar.bz2", 7 | "archiveFileName": "esp8266-1.6.1.tar.bz2", 8 | "checksum": "SHA-256:0caa1b48de7de52bd59096074e81f3cce15da286ec0a6c3e5380895ea66df0a9", 9 | "size": "123332", 10 | "help": { 11 | "online": "https://adafruit.com" 12 | }, 13 | "boards": [ 14 | {"name": "Generic ESP8266 board"}, 15 | {"name": "WIFIO"} 16 | ], 17 | "toolsDependencies": [ 18 | { 19 | "packager": "esp8266", 20 | "name": "esptool", 21 | "version": "0.4.2" 22 | } 23 | ] 24 | } 25 | -------------------------------------------------------------------------------- /package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "arduino-proxy", 3 | "version": "1.0.0", 4 | "description": "A hack to add boards to the Arduino Board Manager", 5 | "main": "proxy.js", 6 | "dependencies": { 7 | "request": "^2.54.0" 8 | }, 9 | "devDependencies": {}, 10 | "scripts": { 11 | "test": "echo \"Error: no test specified\" && exit 1" 12 | }, 13 | "keywords": [ 14 | "arduino", 15 | "hack" 16 | ], 17 | "author": "Todd Treece ", 18 | "license": "MIT" 19 | } 20 | -------------------------------------------------------------------------------- /packages/adafruit.json: -------------------------------------------------------------------------------- 1 | { 2 | "name":"adafruit", 3 | "maintainer":"Adafruit", 4 | "websiteURL":"http://adafruit.com", 5 | "email":"info@adafruit.com", 6 | "help": { 7 | "online": "https://forums.adafruit.com" 8 | }, 9 | "platforms":[], 10 | "tools":[] 11 | } 12 | -------------------------------------------------------------------------------- /packages/arcore.json: -------------------------------------------------------------------------------- 1 | { 2 | "name":"arcore", 3 | "maintainer":"Ralf Kistner", 4 | "websiteURL":"https://github.com/rkistner/arcore", 5 | "email":"ralf@journeyapps.com", 6 | "help": { 7 | "online": "https://adafruit.com" 8 | }, 9 | "platforms":[], 10 | "tools":[] 11 | } 12 | -------------------------------------------------------------------------------- /packages/esp8266.json: -------------------------------------------------------------------------------- 1 | { 2 | "name":"esp8266", 3 | "maintainer":"ESP8266 Community Forum", 4 | "websiteURL":"http://www.esp8266.com", 5 | "email":"info@adafruit.com", 6 | "help": { 7 | "online": "https://adafruit.com" 8 | }, 9 | "platforms":[], 10 | "tools":[ 11 | { 12 | "name":"esptool", 13 | "version":"0.4.2", 14 | "systems":[ 15 | { 16 | "host":"i686-mingw32", 17 | "archiveFileName":"esptool-0.4.2-windows.tar.bz2", 18 | "url":"http://apt.adafruit.com/proxy_files/esptool-0.4.2-windows.tar.bz2", 19 | "checksum":"SHA-256:8b22ebaa113ebb7d3740f0a51d00382745c4126724f9245a2f87d8401f5a4559", 20 | "size":"128085753" 21 | }, 22 | { 23 | "host":"x86_64-apple-darwin", 24 | "url":"http://apt.adafruit.com/proxy_files/esptool-0.4.2-osx.tar.bz2", 25 | "archiveFileName":"esptool-0.4.2-osx.tar.bz2", 26 | "checksum":"SHA-256:d8b57987ad2ebbbc8f4604204a5637eec6752a68b1ca579fe6021335804c172b", 27 | "size":"50609724" 28 | }, 29 | { 30 | "host":"x86_64-pc-linux-gnu", 31 | "url":"http://apt.adafruit.com/proxy_files/esptool-0.4.2-linux64.tar.bz2", 32 | "archiveFileName":"esptool-0.4.2-linux64.tar.bz2", 33 | "checksum":"SHA-256:59570dd2cadfac665201d1c8fb2a43b68a0d17601a2492efc78e0fc6ca9abe3f", 34 | "size":"27304717" 35 | } 36 | ] 37 | } 38 | ] 39 | } 40 | -------------------------------------------------------------------------------- /proxy.js: -------------------------------------------------------------------------------- 1 | var request = require('request'), 2 | http = require('http'); 3 | url = require('url'); 4 | 5 | // build adafruit package 6 | var arcore = require('./packages/arcore.json'); 7 | arcore.platforms = arcore.platforms.concat(require('./boards/arcore.json')); 8 | 9 | // build adafruit package 10 | var adafruit = require('./packages/adafruit.json'); 11 | adafruit.platforms = adafruit.platforms.concat(require('./boards/adafruit.json')); 12 | 13 | // build esp8266 package 14 | var esp = require('./packages/esp8266.json'); 15 | esp.platforms = esp.platforms.concat(require('./boards/esp8266.json')); 16 | 17 | http.createServer(function(req, res) { 18 | 19 | var parsed = url.parse(req.url); 20 | 21 | if(! /downloads\.arduino\.cc$/.test(parsed.hostname) && ! /adafruit\.com$/.test(parsed.hostname)) 22 | return res.end(); 23 | 24 | var proxy_options = { 25 | url: req.url, 26 | method: req.method, 27 | headers: req.headers 28 | }; 29 | 30 | if(! /package_index\.json$/.test(req.url) || req.headers.range != 'bytes=0-') 31 | return request(proxy_options).pipe(res); 32 | 33 | request(proxy_options, function(err, proxy_response, body) { 34 | inject(body, res, proxy_response); 35 | }); 36 | 37 | }).listen(5050); 38 | 39 | function inject(data, res, proxy) { 40 | 41 | try { 42 | var parsed = JSON.parse(data); 43 | } catch(e) { 44 | return res.end('{"packages": []}'); 45 | } 46 | 47 | parsed.packages.push(arcore); 48 | parsed.packages.push(adafruit); 49 | parsed.packages.push(esp); 50 | 51 | var body = JSON.stringify(parsed); 52 | 53 | proxy.headers['content-length'] = body.length; 54 | res.writeHead(proxy.statusCode, proxy.headers); 55 | res.write(body); 56 | res.end(); 57 | 58 | } 59 | -------------------------------------------------------------------------------- /proxy.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/adafruit/adafruit-arduino-proxy/266ea574635b0fcc0416c68ab918f2c275ad665e/proxy.png --------------------------------------------------------------------------------