-
Notifications
You must be signed in to change notification settings - Fork 9
Programming ESP8266
ESP8266 is supported in Arduino IDE with Arduino esp8266 core. It means that arduino sketch can be uploaded into ESP8266.
Arduino UNO WiFi Dev Ed is supported from version 2.4 of the esp8266 core for Arduino IDE. For now, the version 2.4 is only a release candidate.
To install this pre-release using boards manager, follow the instructions, with the package URL replaced with the following one:
https://github.com/esp8266/Arduino/releases/download/2.4.0-rc2/package_esp8266com_index.json
Additionally, you can install the Arduino ESP8266 filesystem uploader IDE plugin
Default setting in boards.txt (in esp8266 package) for the 'Arduino' boards is:
arduino-esp8266.serial.disableDTR=true
arduino-esp8266.serial.disableRTS=true
Remove or comment this lines for convenient restarting of the board.
The existing setting of extra flags for Uno WiFi overrides the default from platform.txt without defining the ESP8266 flag. It is a problem for example for Blynk library. If you plan creating an esp sketch using Blynk, change in board.txt the extra flags setting for Uno WiFi.
arduino-esp8266.menu.BoardModel.unowifideved.build.extra_flags=-DF_CRYSTAL=40000000 -DESP8266
In tools menu select board options.
- Choose Arduino from the ESP8266 section of the Boards menu.
- Next choose Model UNO WiFi.
- Flash Size selection should be "4M (1M SPIFFS)"
From now on always check the selected board in the right bottom corner of the IDE window. For ATmega sketch it should show "Arduino UNO WiFi on ...", for the ESP sketch "Arduino, UNO WiFi, 115200, 4M (1MB SPIFFS) on...".
Before using the Upload button with your ESP sketch, first Upload the EspProxy sketch into ATmega.
The EspProxy sketch detects uploading to esp from IDE and puts the ESP into bootloader mode. After the uploading the EspProxy returns to normal mode and bridges the Serial port of esp to USB for use of Serial Monitor with Serial of the esp.
Firmata is a system for accessing pins and interfaces of a microcontroller (MCU) from a computer (or other MCU). Library FirmataMaster is for esp8266 and enables control of an attached MCU with Firmata.
Example UnoWiFiFirmata.ino from Uno WiFi Serial1 library, shows how to modify a Firmata sketch to work with Serial1 and combine it with EspProxy features to upload sketches into esp from IDE without thinking about how is it connected and without caring about flashing mode.