Proposal : arduino-cli-server, a compile/upload local server

This proposal starts with several findings :

  • cloud compiling at some point cost money to someone and so will never be free forever (which is understandable)
  • codebender used to be free it’s no longer the case (it’s understandable, this is not a rant)
  • a lot of efforts went already into building custom browser / block based interfaces to generate arduino code, and a lot efforts were duplicated, doing the arduino compile/upload toolchain needed, Especially when the only tool used is a web browser. With various ideas including uploading the code to some remote server, get back a compiled file then upload it to a board using convoluted js and serial implementation in the browser (chrome only?)
  • bunch of websites propose arduino code samples and no easy integration to upload quickly the result to an arduino is available (even more with codebender being now paid)
  • sometimes using remote compiling is not possible (no internet access)

This proposal tries to fix that and would ideally try to reach developers of various project so they could work together on a single tool they could all share for their own projects. The compile / upload part is hard and boring, it would be great to unite efforts.

This is the scenario :

  • An easy to install app is provided, that must be installed (tray icon)
  • User install arduino cli as a prerequisite (it could be also bundled or downloaded on app install)
  • The app is a bridge between arduino-cli and any web based application running either locally or remote.
  • The app starts a small webserv on the local computer, ready to receive arduino-cli commands and code uploads
  • Any web application can communicate with the server in order to
  • list the connected boards
  • install board support and libraries
  • compile and upload code to any connected arduino board

More technically :

  • web server started on a fixed port (to be determined), would be nice to use :3280 (uno is 328p)
  • accepts http requests
  • provide a simple api which is modelled after arduino cli (to be refined)
  • replies using web friendly format (json) and also usable directly without JS parsing (plain html response)
  • provides feedback/error reporting/progress so the app can react accordingly

API

Post request to the following :
localhost:3280/core/update-index
localhost:3280/core/search
localhost:3280/core/install
localhost:3280/board/list
localhost:3280/compile

Returning a json response including progress if something takes time like installing boards, compile and upload

Depending on the scope of arduino-cli, this could be part of arduino-cli itself...

My idea is also to contact several project who might need this tool or who would have it already developed, and see if they would like to work together on it. Note that I don't have alone the required skills to make it. Such projects would include blockly@rduino, ardublockly, xod, mblock, and several other based on blocks and other code generator tools not using arduino ide.

What do you think?

This proposal can be edited in this google doc : arduino cli server proposal - Google Docs

or commented here of course.