How to add a Web Setup Portal to ESP8266 Projects (Soft Access Point)

Sdílet
Vložit
  • čas přidán 1. 05. 2021
  • A quick tutorial on how to use ESP8266 Access Point to server a web page to configure the device: an example and walk through. Arduino and HTML code provided.
    GET THE COMPONENTS
    =====================
    ╚═ Wemos d1 mini (4M version)
    ■ from MrDIY store - store.mrdiy.ca/p/wemos-d1-mini
    ■ from Amazon/AliExpress - store.mrdiy.ca/p/wemos-d1-min...
    BIN file
    =======
    gitlab.com/MrDIYca/code-sampl...
    Music: 'Sunset Dream' by Cheel
  • Věda a technologie

Komentáře • 60

  • @3AT127
    @3AT127 Před 2 měsíci +1

    Very elegant code, more clever than the other related codes! Congrats!

  • @justelisISkauno
    @justelisISkauno Před 9 měsíci +1

    This video is a fantastic guide for anyone looking to enhance their ESP8266 projects with a Web Setup Portal using a Soft Access Point. The clear explanations and step-by-step instructions made it so easy for me to implement this feature in my own projects. Thanks for sharing this valuable knowledge.

  • @FrankGraffagnino
    @FrankGraffagnino Před 3 lety +4

    perfect. short and to the point. great code walkthrough. I would think most people may want to choose whether to start in AP or client mode based on whether they are able to get any information from the EEPROM (basically test if it was "factory" reset or not) and then give the user some way to erase the EEPROM when they want to go back to AP mode and setup again for a different wifi. Great job!

    • @MrDIYca
      @MrDIYca  Před 3 lety +2

      Thank you. Yes, that is a good point. Alternative ways: link the AP to a pin status or do what Tasmota does by erasing the EEPROM when the device is reset multiple times in a short time period.

    • @ZorlacSkater
      @ZorlacSkater Před 6 měsíci

      You could also just start with AP + Station mode. Some chips support it.

  • @prateekmahajan1929
    @prateekmahajan1929 Před 3 lety +1

    Dude this is very cool, concise I'm looking forward for more

    • @MrDIYca
      @MrDIYca  Před 3 lety +1

      Awesome, thank you!

  • @war4tek
    @war4tek Před 4 měsíci

    Thank you! Clear and to the point. I appreciate you taking the time to make this video.

  • @edgarsantos6050
    @edgarsantos6050 Před 4 dny +1

    An important tip for beginners using Arduino R3 Wifi, like me, after programming the ESP8266, to make the project work, you need to disconnect the power, turn dip switch 7 to OFF and connect the power again.

  • @vasanthkumar-sb5jm
    @vasanthkumar-sb5jm Před 3 lety +1

    Woo cool very nice, it's very beautiful and educating.
    One more update just add one push button to create access point while pressing it around 5 sec and once ssid and psd get make one flage true and store it eeprom, in setup read that flage from eeprom if it's true then try to connect that wifi else in loop just keep read push buton status. I just thought these things

  • @pokpikchan
    @pokpikchan Před rokem

    Very nice video. Easy and informative

  • @LuisMiguelBautista
    @LuisMiguelBautista Před rokem +1

    Awesome tutorial mate 👏🏼👏🏼👏🏼👏🏼👏🏼
    Here is just an small tip that it’s more than deserved

  • @raymondmichael4987
    @raymondmichael4987 Před 10 měsíci

    Thanks, I will definitely try this 😊

  • @1_HighDuke
    @1_HighDuke Před rokem

    Very useful, thank you!

  • @IIFabisII
    @IIFabisII Před 2 lety

    Justo lo que buscaba, pero aun me falta entenderlo bien , sería posible un video para reforzar un poco más el uso de formularios en web y el modo post en el esp8266 .. muchas gracias amigo.

  • @njrdevs
    @njrdevs Před rokem

    Thanks for the tutorial.. it's really helpful.. I'm new to Arduino and stuffs.. is there anyway to clear the data stored in the EEPROM?

  • @afrenchcocorico164
    @afrenchcocorico164 Před 2 lety +2

    It would be great if there was a way to use click to connect feature (for example in android or windows instead of the local ip address)
    Is that possible ?
    Thanks

  • @lucianobertini7260
    @lucianobertini7260 Před 6 měsíci +1

    Hello! Thank you very much for the code. Perfect solution for me. But the way I access the server is different. Instead of 30 attempts, I use a button on my device. If the device is turned on with this button pressed, it goes into Access Point mode. I keep an LED blinking to indicate this mode. If the button is not pressed, the normal setup follows. Before, I had two wifi networks configured, one to join if the button was pressed and another if it was not pressed. But I knew I nedded a better solution. Now it's perfect. Thank you very much.

  • @sycope
    @sycope Před rokem

    Awesome video! Definatly going to make us of this for upcoming projects. Is there anyway to automatically open the web page when the user connects to the AP? Rather than having to go and enter the IP?

  • @mibrahim4245
    @mibrahim4245 Před 2 lety +1

    Awesome

  • @kennethwinston5738
    @kennethwinston5738 Před 2 lety

    Hey, forgive me, I am just a beginner. I have created a detailed arduino code that monitors a multitude of things (temperature, humidity, etc.). I am trying to display that data to a webpage. I have both a ESP8266 NodeMCU chip and just normal ESP12E chips. I am so lost as to what flashing the chips mean and how to get someone connected to the chip and to access the data. Any help for me?

  • @johanhedlund4127
    @johanhedlund4127 Před 2 lety +1

    Thanks for a nice tutorial! I am looking to expand the setup portal to also make it possible to configure MQTT parameters at the same time. In order to do that, I need to get the HTTP-form info with the MQTT server address as uint8_t data type. Any idea on how that could be achieved?

    • @MrDIYca
      @MrDIYca  Před 2 lety

      You are welcome. An extra MQTT field should be the same as the ssid and password fields - just add another input field in the html and save it on the backend. Hope that helps.

  • @coffee_bean__
    @coffee_bean__ Před rokem +1

    how would you turn this into a captive portal? great video.

  • @KK-ib5nh
    @KK-ib5nh Před 7 měsíci

    How to save the html file . What to write in "href" and how can I save the data in json file formate?

  • @SecretFlesh
    @SecretFlesh Před 3 lety

    thank you for this tuts sir

  • @adiii41
    @adiii41 Před 7 měsíci

    OMG... This has to be it... It looks so easy now...

  • @SynQ98
    @SynQ98 Před rokem

    Thanks for uploading this video. It was very helpful, but I had a little problem while implementing this in my project. Turns out that inputs must have "name" attribute to pass them from form
    ex.
    when I had names of the inputs only in the "id" attribute, none of them got passed.
    I hope that if anyone has same problem, my comment will be helpful :)

    • @MrDIYca
      @MrDIYca  Před rokem

      Glad it helped! My source code, l linked to, does have the 'name' attribute. Where are you not seeing 'name'?

  • @ZorlacSkater
    @ZorlacSkater Před 7 měsíci

    I tried it together with an Arduino Uno but I get
    "A fatal esptool.py error occurred: Failed to connect to ESP8266: Timed out waiting for packet header"
    when trying to upload the script.
    Is there a guide on how to connect the ESP8266 correctly?
    I connected it like this:
    TX ESP8266 => TX Arduino
    RX ESP8266 => RX Arduino
    3.3V ESP8266 => 3.3V Arduino
    EN ESP8266 => 3.3V Arduino
    GND ESP8266 => GND Arduino
    Reset ESP8266 => GND Arduino

  • @swapnilwabale2227
    @swapnilwabale2227 Před 11 měsíci

    Great workdone

  • @espa_tronc_communsitraka

    how to read the password and ssid on the eeprom?

  • @dzulfikarsadid6283
    @dzulfikarsadid6283 Před 2 lety

    how to use it with html file stored in littleFS not as string?

  • @wellnessfromfood8627
    @wellnessfromfood8627 Před 2 lety

    One question - how did you know to navigate to 192.168.4.1? Can one tailor that to something else - or is it always that ip? Thanks!

    • @MrDIYca
      @MrDIYca  Před 2 lety

      192.168.4.1 is just the default. You can always change it using softAPConfig()

  • @mibrahim4245
    @mibrahim4245 Před 2 lety

    Is it better to automatically reboot the esp after the credentials being stored

    • @MrDIYca
      @MrDIYca  Před 2 lety +1

      You can do without but it is much easier to just reboot yes.

    • @mibrahim4245
      @mibrahim4245 Před 2 lety

      @@MrDIYca thxx ❤

  • @chandhrenb335
    @chandhrenb335 Před 2 lety

    pls make a video on how to add custom parameters like blynk auth token, sinric API key .....will be very helpful....thank you

    • @MrDIYca
      @MrDIYca  Před 2 lety

      adding a new field ( like an api key, auth token ..etc) is no different that the SSID and password fields - simply add an extra one :)

    • @chandhrenb335
      @chandhrenb335 Před 2 lety

      @@MrDIYca tried it but i created a option on the web page for auth token ......but idk how you are getting the data like ssid and pass in the backend .....will be very useful if you upload a vid regarding this topic .....went through many vids on youtube regarding this topic ....all I see ppl asking how to add custom parameters in the comments......will be very helpful for us if post a vid on this

  • @ProfWereW
    @ProfWereW Před 3 měsíci

    Would this work with ESP-01s?

  • @bbirajohnson506
    @bbirajohnson506 Před 2 lety +1

    I NEED TO SERVE A MEDIA STREAMING WEB PAGE USING AN ESP8266 CAPTIVE PORTAL. CONNECTION SHOULD AUTOMATICALLY REDIRECT USER TO MEDIA PAGE OFFLINE. THANKS FOR THE TUTORIAL...

    • @Wind-on-myFace
      @Wind-on-myFace Před 2 lety

      I am looking for the same for automatic redirection

  • @industron22
    @industron22 Před 5 měsíci

    Please add static ip to node mcu in this code

    • @MrDIYca
      @MrDIYca  Před 5 měsíci +1

      You might want to check this tutorial - randomnerdtutorials.com/esp8266-nodemcu-static-fixed-ip-address-arduino/

  • @dtec30
    @dtec30 Před rokem

    what setsup the ip adress

  • @joy-uw5fd
    @joy-uw5fd Před rokem

    Sir I cannot connect setup portal, what is the default password?

    • @MrDIYca
      @MrDIYca  Před rokem

      It is in the code: "mrdiy.ca"

  • @noblecodm839
    @noblecodm839 Před rokem

    which is the serial frecuency??

    • @MrDIYca
      @MrDIYca  Před rokem

      The code doesn't use Serial

    • @noblecodm839
      @noblecodm839 Před rokem

      @@MrDIYca oh hi. Is there any way possible to show the ssid and password? Maybe a EEPROM.Read? I need to serial.print that

    • @noblecodm839
      @noblecodm839 Před rokem

      @@MrDIYca thanks, I do love your videos