Adding the WiFi AutoConnect Feature to an Existing Sketch

Introduction: Adding the WiFi AutoConnect Feature to an Existing Sketch

About: #BnBe is a platform to help teach electronics no matter what the age or skill level. We’re currently designing a wide range of products from beginner level kits to industry-standard microcontroller platforms.

In a recent post, we learned about the AutoConnect feature for the ESP32/ESP8266 boards and one of the questions asked was about adding it to existing sketches. In this post, we will learn how to do just that and we will use the network time project as an example.

Since there is a lot of code that needs to be copied over, I would recommend watching the video to learn more as it's much more efficient to watch it in action than read about it.

Teacher Notes

Teachers! Did you use this instructable in your classroom?
Add a Teacher Note to share how you incorporated it into your lesson.

Step 1: Download the Sketches

You will need to download and obtain two sketches as we will be using them for this project. Start by download the network time project sketch (E12) from the following link: https://www.bitsnblobs.com/wp-content/media/fw/diy/diy-e12.zip

Extract the file and rename it to E16 as that will be the final sketch for this project.
Next, download the AutoConnect sketch (E13) using the following link: https://www.bitsnblobs.com/wp-content/media/fw/diy/diy-e13.zip

Extract this file too and open both sketches in the Arduino IDE.

Step 2: Update the Sketch

Now, we need to copy over some code from the AutoConnect sketch to the new sketch (E16). Please watch the video to follow through the steps or else you can download the final sketch using the following link:https://www.bitsnblobs.com/wp-content/media/fw/diy/diy-e16.zip

Step 3: Upload and Test

Upload the sketch to the board using the settings mentioned in the sketch. If the network credentials were previously stored in the flash, then the board will automatically connect to the WiFi network. If not, then you will need to connect to the access point and configure the network, just like we did in the AutoConnect video. Everything else is the same so please refer to the original post to learn how to use the AutoConnect library, if needed.

Link to original post: https://www.instructables.com/id/Using-WiFi-AutoConnect-With-ESP8266ESP32-Boards/


Be the First to Share

    Recommendations

    • Magnets Challenge

      Magnets Challenge
    • Raspberry Pi Contest 2020

      Raspberry Pi Contest 2020
    • Wearables Contest

      Wearables Contest

    Discussions