Arduino Forum

Products => Arduino CLI => Topic started by: Leonas on May 13, 2020, 10:44 am

Title: Enabling user to update sketch on an ESP8266
Post by: Leonas on May 13, 2020, 10:44 am
Sorry if this has been asked before but I don't exactly see it described like this. I assume it should be possible but let me know if and why not.

What I would like to do is send a user of my program a copy of arduino-cli.exe and the .bin file so they can upgrade the program themselves, without them needing to install a full copy of Arduino IDE, the source code, the libraries and the ESP8266 boards folders.

I understand the fqbn is necessary to compile the .ino sketch but once compiled, everything required should be in the .bin file, no? So why is it still necessary to specify (for example) --fqbn esp8266:esp8266:huzzah with arduino-cli upload? Or is it just ok to specify the fqbn without the actual files needed on their computer in C:\Users\username\AppData\Local\Arduino15\packages?
Title: Re: Enabling user to update sketch on an ESP8266
Post by: pert on May 28, 2020, 12:08 pm
without them needing to install a full copy of Arduino IDE, the source code, the libraries
By providing arduino-cli and the compiled binary, none of that is needed.

and the ESP8266 boards folders.
But this still is needed (part of it).

So why is it still necessary to specify (for example) --fqbn esp8266:esp8266:huzzah with arduino-cli upload? Or is it just ok to specify the fqbn without the actual files needed on their computer in C:\Users\username\AppData\Local\Arduino15\packages?
It's needed because each platform has its own upload tool and configuration that generates the command for running that tool. Arduino CLI doesn't directly upload the compiled binary to the ESP8266, it just generates the command and runs the platform's upload tool (esptool in this case).

If you like, you could just provide esptool and the compiled binary with a script that runs the right command. The download URLs for esptool are listed in the ESP8266 package index:
https://arduino.esp8266.com/stable/package_esp8266com_index.json (https://arduino.esp8266.com/stable/package_esp8266com_index.json)