2021/07/25

Arduino #27 AsyncWifimanager ElegantOTA ESP8266 (WiFi Password Mgnt + WiFi Firmware Update)

*** If you are using the ESP32, Please see this: ESP32

It would be great if every IoT device deployed with OTA capability with Wifimanager.  Then the IoT device would be able to change SSID & password without connecting the device to the computer to update SSID and password as well as FOTA at any time when you wanted.

In this tutorial, let’s combine ESPAsync_Wifimanager and AsyncElegantOTA into a code base to become a handy tool for future IoT projects! 

I have made WiFiManager & AsyncElegantOTA tutorial videos. If you don't know what they are and how they work for IoT projects, I strongly recommend you to watch these videos first.

This time, I used ESPAsync_WiFiManager library, it's because WiFiManager does not work with AsyncElegnatOTA together. We have to change to ESPAsync_WiFiManager.  The main reason for this is that AsnycWiFiManager is using Asynchronous technology. Which means it can accept connections from different sources at the same time. So, while WiFiManager is running on the device, the device can also be a FOTA server to allow firmware to be remotely updated!

        Watch these videos first, if haven't heard about these.

        GitHub Library:

        Sample code:


For those of you do not have the time to watch the entire video, here is the Video Timeline 00:00 Project introduction 00:16 Arduino libraries used in this project 00:29 Short Wifimanager briefing (Check out my previous video) 00:59 Short AsyncElegnatOTA briefing (Check out my previous video) 01:34 Tutorial begin 02:04 Copy ESPAsyncWifimanager sample code to your editor 02:44 Check AsyncElegantOTA sample code 02:50 Start to merge the two libraries 05:16 Setup your IoT AP name 05:58 Copy AsyncElegantOTA code & modify 06:20 Modify server variables 07:05 What does webServer.on do? 07:35 Upload sketch 08:11 Test AsyncWifimanager and setup SSID & Password 09:10 Access ESP32 from browser 09:44 Access ESP32 OTA page The End.

Arduino #27 AsyncWifimanager ElegantOTA ESP32 (WiFi Password Mgnt. + WiFi Firmware Update)

*** If you are using the ESP8266, Please see this: ESP8266

It would be great if every IoT device deployed with OTA capability with Wifimanager.  Then the IoT device would be able to change SSID & password without connecting the device to the computer to update SSID and password as well as FOTA at any time when you wanted.

In this tutorial, let’s combine ESPAsync_Wifimanager and AsyncElegantOTA into a code base to become a handy tool for future IoT projects! 

I have made WiFiManager & AsyncElegantOTA tutorial videos. If you don't know what they are and how they work for IoT projects, I strongly recommend you to watch these videos first.

This time, I used ESPAsync_WiFiManager library, it's because WiFiManager does not work with AsyncElegnatOTA together. We have to change to ESPAsync_WiFiManager.  The main reason for this is that AsnycWiFiManager is using Asynchronous technology. Which means it can accept connections from different sources at the same time. So, while WiFiManager is running on the device, the device can also be a FOTA server to allow firmware to be remotely updated!

        Watch these videos first, if haven't heard about these.

        GitHub Library:

        Sample code:


For those of you do not have the time to watch the entire video, here is the Video Timeline 00:00 Project introduction 00:16 Arduino libraries used in this project 00:29 Short Wifimanager briefing (Check out my previous video) 00:59 Short AsyncElegnatOTA briefing (Check out my previous video) 01:34 Tutorial begin 02:04 Copy ESPAsyncWifimanager sample code to your editor 02:44 Check AsyncElegantOTA sample code 02:50 Start to merge the two libraries 05:16 Setup your IoT AP name 05:58 Copy AsyncElegantOTA code & modify 06:20 Modify server variables 07:05 What does webServer.on do? 07:35 Upload sketch 08:11 Test AsyncWifimanager and setup SSID & Password 09:10 Access ESP32 from browser 09:44 Access ESP32 OTA page

The End.

2021/07/11

Android control color RGB LED (Revised for ESP32)

ESP32 Source code on the bottom of this article! 

See the original complete project tutorial here: Android RGB LED Arduino Controller




In September 2014, I created this project with Arduino Mini Pro Mini and Android APP loved by so many readers!  There are more than 100,000 App downloads by now!  Since then, quite of few readers asked me how to change the sketch to be used on ESP32 with built-in Bluetooth.  Here it is!! 😀


Be aware that LED PWM pins used on ESP32 were completely different, since Arduino Mini Pro and ESP32 have different architectures. 

For ESP32, I used following pins:

  • Pin 13 = Red
  • Pin 12 = Green
  • Pin 14 = Blue
Caution: ESP32 does not allow to use pin 6, 7, 8, 9, 10, 11 or it will crash and reboot. I tried...😂


Also, there is no analogWrite() function in ESP32, so I need to change analogWrite() to ledcWrite() with 
  • Channel definition for PWM
    • R channel = 0
    • G channel = 1
    • B channel = 2
  • Setup PWM frequency: 5000
  • Setup PWM resolution: 8 (8bit = 255 colors)
Then I need to setup LED with:
  • ledcSetup( channel, frequency, resolution)
And then attach LED pins to channel
  • ledcAttachPin(Pin, channel)
Then write to LED pins with
  • ledcWrite( channel, value for resolution(0~255));


END

2021/07/10

ESP8266/ESP32 AsyncElegantOTA Wi-Fi OTA

It's always troublesome to update firmware for your IoT projects? Tried Arduino BasicOTA examples, but never get it to work? Then you must try AsyncElegantOTA! It's very easy to use and I've succeed the first time I try it. 



For those of you do not have time to watch it all, here is the video timeline for your quick reference.

Video Timeline:

00:13 Tutorial summary 00:53 What's OTA & Why 01:25 Tutorial begin 01:36 Install AsyncElegantOTA library 02:32 Download ESPAsyncWebServer & ESPAsyncTCP 02:57 Ensure Arduino board is capable of OTA 03:41 Where to place downloaded libraries 04:09 Open sample AsyncElegantOTA sketch 04:52 Upload sketch 05:05 Open serial monitor to see ESP8266 IP address 05:36 Access to ESP8266 from browser 06:10 Update ESP8266 firmware from browser 06:31 Where to find .bin file in VS Code 06:54 How to create .bin file in Arduino IDE 08:16 OTA update ESP8266 firmware 09:01 Next video tutorial - How to combine ESP8266 project with AsyncElegantOTA library


Library URL: