Skip to content

Instantly share code, notes, and snippets.

@bergie bergie/README.md
Last active Feb 21, 2020

Embed
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=http://arduino.esp8266.com/stable/package_esp8266com_index.json" --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 https://github.com/arduino/Arduino/blob/master/build/shared/manpage.adoc

./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
You can’t perform that action at this time.