Skip to content

Latest commit

 

History

History
49 lines (29 loc) · 4.15 KB

01_Arduino_Sketch.md

File metadata and controls

49 lines (29 loc) · 4.15 KB

Flash firmware to ESP8266

The first order of business will be to flash the provided firmware to the ESP8266. You can do this using the NodeMCU Flasher (easy, Windows-only) or the Arduino IDE (less easy, but cross-platform). You should only need to run through this process once as future firmware updates can be applied through the provided web interface.

NodeMCU Flasher

If you're running Windows and you just want to get started without dealing with Arduino this is probably going to be your best option.

Required Downloads

NodeMCU Flasher Process

  • Plug your WeMos D1 into an available USB port on your PC
  • Launch the NodeMCU flasher and select the COM port for your device from the COM Port drop-down menu
  • Select the Config tab(1), then click the top-most gear icon to the right(2) to open a file browser. NodeMCU_Flasher_OpenFirmware
  • Navigate to the HASP firmware image you downloaded and click Open to select it
  • Switch back to the Operation tab and click Flash(F)

Now proceed to First-time Setup to connect to your wireless network.


Arduino IDE

Download the IDE for your platform and follow these instructions to add support for the ESP8266 platform. HASP is currently compiled with Arduino core for ESP8266 version 2.5.0. Once this is installed, select the board LOLIN(WEMOS) D1 R2 & mini from 'Tools' > 'Board'

Required Libraries

Next you will need to add several libraries to your Arduino environment. Follow this guide for the general process and add the following libraries to your IDE:

To enable future firmware updates you'll need to modify settings in the Arudino IDE for 1M SPIFFs, leaving 3M free for code and updates. In the Arduino IDE select Tools > Flash Size: > 4M (1M SPIFFS). If you're using PlatformIO instead of Arduino, modify the build flags to include -Wl,-Teagle.flash.4m1m.ld Arduino Erase All Flash Contents

First-time Setup

Once your device has been flashed, restart it and connect to the WiFi SSID and password displayed on the LCD panel (or serial output if you don't have the LCD ready). You should be prompted to open a configuration website to find your WiFi network and password. You can set the MQTT broker information and admin credentials now, or use the web interface to do so later. Once you save settings the device will connect to your network. Congratulations, you are now online!

WiFi Config 0 WiFi Config 1 WiFi Config 2

Firmware updates

After the initial firmware deployment you should be able to upload new firmware through the web admin interface or using Arduino OTA updates without connecting to your device via USB.