-1

I am working on a web app to program some nodeMCU devices that were flashed with the arduinoOTA library.

http://esp8266.github.io/Arduino/versions/2.0.0/doc/ota_updates/ota_updates.html

I tried the example and the OTA upload of the binary file compiled from Arduino IDE works.

Let's say my web app will allow user to code in Sketch, is there any open source server side or client side compiler that can compile the Sketch code into the bin file?

4
  • turn on verbose console output in Arduino IDE and you will see all the executed commands to compile and link. the builder is external and it is Open Source
    – Juraj
    Commented Oct 15, 2018 at 7:31
  • see for example Sloeber, the Arduino Eclipse plugin, how it uses Arduino toolchain and core packages without Arduino IDE
    – Juraj
    Commented Oct 15, 2018 at 8:23
  • @Juraj Please write this as an answer or give URL for a tutorial, etc. that already exists on the web, if you know of one.
    – MichaelT
    Commented Oct 15, 2018 at 10:00
  • 1
    The AVC GCC is used and is open source gcc.gnu.org
    – CrossRoads
    Commented Oct 15, 2018 at 13:18

3 Answers 3

1

Just have a look here https://github.com/arduino/Arduino/wiki/Build-Process to understand the process.

In fact Arduino code is not "C or C++" at 100%. You can't compile directy as some informations are missing. This is why when you "compile" with the IDE, it copies the files in a temp folder, add some lines at beginning of theses files and then call the basic and well known avr-gcc. If you have a dedicated server you just have to search for the avr-gcc package according to the OS. Eg, for Debian: https://packages.debian.org/stretch/gcc-avr

Then or you send directly the code avr-gcc is waitng for, or you apply on the code the same changes the IDE is doing before sending the code to GCC.

Hope this help

0

Arduino IDE runs external tools to create the hex or bin file. First the ino files of a project are processed by arduino builder to cpp file. Then the arduino builder invokes the toolchain of the MCU architecture - compiler and linker. For example AVR tools for 328p or 2560; ARM toolchain from SAMD; xtensa tools for Espressif chips.

New is Arduino CLI, which focuses on using Arduino with command line.

Tha Arduino builder, Arduino CLI and esp8266 Arduino core are Open Source. Extensa tools and Espressif SDK are not open source, but are free.

0

Try PlatformIO: https://platformio.org

Opensource and cross platform.

1
  • 1
    Great answer to some other question :) Commented Apr 15, 2019 at 13:37

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.