I have some small projects built around EPS8266-1. To make them movable I use WiFimanager. This is working well.
Now I want a method to be able to use OTA for updating. I can use Arduino IDE to create a binary. Is there a possibility to create something similar to WiFimanager to program the ESP using the binary without using IDE or cloud?
You can do a HTTPupdater
and here is a demo-code for the ESP8266
New Version
Thank you both, I will try that.
My goal is to do the coding at home and just put the binary in my iPhone and use it so that I don’t need the laptop in the field.
I have used both ota and wifimanager before, but not in the same project..
In that case just have a look at the HttpUpdater example
Thank you, I just tested it and it works perfectly.
/*
test WiFimgr and OTA
*/
#include <ESP8266WiFi.h>
#include <ESP8266WebServer.h>
#include <ESP8266HTTPUpdateServer.h>
#include <WiFiManager.h>
#include <ESP8266mDNS.h> // mDNS library
ESP8266WebServer server(80);
ESP8266HTTPUpdateServer httpUpdater;
const int ESP_BUILTIN_LED = 2;
void setup() {
Serial.begin(115200);
WiFiManager wm;
bool res = wm.autoConnect("AutoConnectAP"); // Fallback AP if no known Wi-Fi
if (!res) {
Serial.println("Failed to connect");
ESP.restart();
}
// mDNS Setup
if (MDNS.begin("esp8266")) { // Access via http://esp8266.local
Serial.println("mDNS responder started");
}
httpUpdater.setup(&server);
server.on("/", []() {
server.send(200, "text/html",
"<h1>ESP8266 OTA Update</h1><p><a href='/update'>Update Firmware</a></p>");
});
server.begin();
Serial.println("HTTP server started");
pinMode(ESP_BUILTIN_LED, OUTPUT);
}
void loop() {
server.handleClient();
MDNS.update();
digitalWrite(ESP_BUILTIN_LED, LOW);
delay(1000);
digitalWrite(ESP_BUILTIN_LED, HIGH);
delay(1000);
}
Just an additional question.
I can make small adjustments in my code using the cloud editor on my iPhone. However I have to copy the edited code from the cloud editor to the IDE to be able to create a binary.
Is there some way to create the binary from the cloud editor?
This topic was automatically closed 180 days after the last reply. New replies are no longer allowed.