- 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}
witheagle.flash.4m.ld
- Edit
-
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
- Set up terminal connection with nodemcu-tool
./node_modules/.bin/nodemcu-tool -p /dev/ttyUSB0 -b 115200 terminal
For anyone looking, an updated gist to do this using
arduino-cli
is at: https://gist.github.com/adi-g15/de41e96079a5b63045e86dc7c8c5c87e.