Coder Social home page Coder Social logo

esp8266_arduino_ap_ota's Introduction

ESP8266_ARDUINO_AP_OTA

I was looking for Arduino code examples for OTA updates of ESP8266 sketches with the unit set up as AP only. The existing examples were using AP+STA mode which didn't work for me. I wanted to be able to update units in the field from a laptop or smartphone without having the ESP8266 connect to an existing WiFi network first.

I started tinkering with the Arduino Examples->ESP8266HTTPUpdateServer->WebUpdater sketch and finally got it working. The trick seems to be to disconnect station mode first before setting up as access point.

Test Configuration

  • Arduino IDE ver 1.8.5 with esp8266 package ver 2.4.1, Ubuntu 18.04 LTS, Chrome web browser
  • Wemos D1 mini (ESP-12F with 4Mbytes flash) board

Steps

Compile and upload the APWebUpdater.ino sketch to your ESP8266 module via the standard USB-UART interface.

Screenshot

Reset or power-cycle the board after uploading, even if you see the reboot messages in the serial monitor. This is important. If you forget, you will later see an OTA update failure message about a bootstrap problem and a prompt to reset the board.

In the example code, the access point is named EspAccessPoint with no access password. Connect to this access point.

Screenshot

Open your web browser and enter the url http://espotaserver.local/update (or http://192.168.4.1/update). You should see the httpupdate server webpage with a button to choose the firmware binary to upload.

Screenshot

Go back to the Arduino sketch. In the loop() method, enable the code to blink the led by changing #if 0 to #if 1. Now navigate to the Arduino menu "Sketch->Export compiled Binary". This will compile the sketch and export the compiled binary file to your Arduino sketch folder.

Go back to the ota server webpage, click on "Choose file", and select the new binary file in your sketch folder.

Screenshot

After uploading the file, click on the "update" button in the webpage.

Screenshot

You'll eventually see a webpage acknowledgement of upload success, and the ESP8266 will reboot with the new firmware. You will see the led blinking now.

esp8266_arduino_ap_ota's People

Contributors

har-in-air avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.