Skip to content

Instantly share code, notes, and snippets.

Last active Oct 25, 2021
What would you like to do?
Arduino CLI with ESP8266
  • Install Arduino IDE to /opt/arduino
  • Install PubSubClient and MsgFlo
  • Edit /opt/arduino/libraries/PubSubClient/src/PubSubClient.h and set a bigger buffer size (for example 512)
  • Add ESP8266 board URL:
/opt/arduino/arduino --pref "boardsmanager.additional.urls=" --save-prefs
  • Install board package
/opt/arduino/arduino --install-boards esp8266:esp8266 --save-prefs
  • Fix build-flash linking:

    • Edit packages/esp8266/hardware/esp8266/2.3.0/platform.txt
    • Replace {build.flash_ld} with eagle.flash.4m.ld
  • Verify build: /opt/arduino/arduino -v --verify --board esp8266:esp8266:nodemcu --port /dev/ttyUSB0 sensor.ino

  • Upload build: /opt/arduino/arduino -v --upload --board esp8266:esp8266:nodemcu --port /dev/ttyUSB0 sensor.ino

See also Arduino CLI docs

./node_modules/.bin/nodemcu-tool -p /dev/ttyUSB0 -b 115200 terminal
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment