Permalink
Browse files

Add NodeMCU Flasher instructions

  • Loading branch information...
aderusha committed Apr 30, 2018
1 parent 3939f60 commit 70c025754662eb8cdec71583604c4c58c36d6f7f
View
@@ -0,0 +1,3 @@
.pioenvs
.piolibdeps
.vscode
@@ -1,6 +1,29 @@
# Arduino sketch
# Flash firmware to ESP8266
The first order of business will be to flash the provided Arduino sketch to the ESP8266 with the Arduino IDE. [Download the IDE for your platform](https://www.arduino.cc/en/Main/Software) and [follow these instructions to add support for the ESP8266 platform](https://github.com/esp8266/Arduino#installing-with-boards-manager).
The first order of business will be to flash the provided firmware to the ESP8266. You can do this using the [NodeMCU Flasher](#NodeMCU%20Flasher) (easy, Windows-only) or the [Arduino IDE](#Arduino%20IDE) (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: [Win32](https://github.com/nodemcu/nodemcu-flasher/raw/master/Win32/Release/ESP8266Flasher.exe) / [Win64](https://github.com/nodemcu/nodemcu-flasher/raw/master/Win64/Release/ESP8266Flasher.exe)
* [HASwitchPlate Firmware](https://github.com/aderusha/HASwitchPlate/raw/master/Arduino_Sketch/HASwitchPlate.ino.d1_mini.bin)
### 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<sup>(1)</sup>, then click the top-most gear icon to the right<sup>(2)</sup> to open a file browser. ![NodeMCU_Flasher_OpenFirmware](https://github.com/aderusha/HASwitchPlate/blob/master/Documentation/Images/NodeMCU_Flasher_OpenFirmware.png?raw=true)
* 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](#First-time%20Setup) to connect to your wireless network.
## Arduino IDE
[Download the IDE for your platform](https://www.arduino.cc/en/Main/Software) and [follow these instructions to add support for the ESP8266 platform](https://github.com/esp8266/Arduino#installing-with-boards-manager).
Next you will need to add several libraries to your Arduino environment. [Follow this guide for the general process](https://www.arduino.cc/en/Guide/Libraries) and add the following libraries to your IDE:
@@ -11,8 +34,13 @@ Next you will need to add several libraries to your Arduino environment. [Follo
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](https://platformio.org/) instead of Arduino, [modify the build flags](http://docs.platformio.org/en/latest/platforms/espressif8266.html#flash-size) to include `-Wl,-Teagle.flash.4m1m.ld`
![Arduino Erase All Flash Contents](https://github.com/aderusha/HASwitchPlate/blob/master/Documentation/Images/Arduino_1M_SPIFFS.png?raw=true)
Flash the sketch to your device, power it up, and connect to the WiFi AP displayed on the LCD panel using the password also displayed on the panel. You should be prompted to open a [configuration website](http://192.168.4.1) to find your WiFi network, enter WiFi password, and define your MQTT broker. You can also set an MQTT broker username/password (if required) and define or change the OTA firmware update password.
## First-time Setup
Once your device has been flashed, restart it, power it up, 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](http://192.168.4.1) to find your WiFi network and password. You can also 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](https://github.com/aderusha/HASwitchPlate/blob/master/Documentation/Images/WiFi_Config_0.png?raw=true) ![WiFi Config 1](https://github.com/aderusha/HASwitchPlate/blob/master/Documentation/Images/WiFi_Config_1.png?raw=true) ![WiFi Config 2](https://github.com/aderusha/HASwitchPlate/blob/master/Documentation/Images/WiFi_Config_2.png?raw=true)
After the initial Arduino deployment via USB you should be able to upload new firmware through the web admin interface or [using Arduino OTA updates](https://randomnerdtutorials.com/esp8266-ota-updates-with-arduino-ide-over-the-air/).
## 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](https://randomnerdtutorials.com/esp8266-ota-updates-with-arduino-ide-over-the-air/) without connecting to your device via USB.
Binary file not shown.
View
@@ -1,6 +1,6 @@
MIT License
Copyright (c) 2017 aderusha
Copyright (c) 2018 Allen Derusha allen@derusha.org
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal

0 comments on commit 70c0257

Please sign in to comment.