Hi Pete
PeteKnight wrote:The easiest way to do HTTP updates is to use a free web hosting account. I use hostinger.co.uk
i login a free hosting account, i use
http://www.000webhost.com by Hostinger and i create ????????.000webhostapp.com "web server".
i update my code :
Code: Select all#include <Arduino.h>
#include <ESP8266WiFi.h>
#include <ESP8266WiFiMulti.h>
#include <ESP8266HTTPClient.h>
#include <ESP8266httpUpdate.h>
#define USE_SERIAL Serial
ESP8266WiFiMulti WiFiMulti;
//===================================
//= SETUP =
//===================================
void setup() {
USE_SERIAL.begin(9600);
// USE_SERIAL.setDebugOutput(true);
USE_SERIAL.println();
USE_SERIAL.println();
USE_SERIAL.println();
for (uint8_t t = 4; t > 0; t--) {
USE_SERIAL.printf("[SETUP] WAIT %d...\n", t);
USE_SERIAL.flush();
delay(1000);
}
// WiFi network info.
WiFiMulti.addAP("?????????", "????????");
} // FIN de setup
//===================================
//= LOOP =
//===================================
void loop() {
// wait for WiFi connection
if ((WiFiMulti.run() == WL_CONNECTED)) {
t_httpUpdate_return ret = ESPhttpUpdate.update("https://????????.000webhost.com/updater.ino.bin"); //("https://server/file.bin");
switch (ret) {
case HTTP_UPDATE_FAILED:
USE_SERIAL.printf("HTTP_UPDATE_FAILD Error (%d): %s", ESPhttpUpdate.getLastError(), ESPhttpUpdate.getLastErrorString().c_str());
break;
case HTTP_UPDATE_NO_UPDATES:
USE_SERIAL.println("HTTP_UPDATE_NO_UPDATES");
break;
case HTTP_UPDATE_OK:
USE_SERIAL.println("HTTP_UPDATE_OK");
break;
}
}
} //FIN de loop
PeteKnight wrote: pick-up the file and rename it to updater.ino.bin
i did it : after compile in BIN, and rename , i put "updater.ino.bin" in my "/public_html" with fillezilla.
this is what it diplay on Serial monitor :
Code: Select all[SETUP] WAIT 4...
[SETUP] WAIT 3...
[SETUP] WAIT 2...
[SETUP] WAIT 1...
HTTP_UPDATE_FAILD Error (-1): HTTP error: connection refused
did you find something wrong ? Thanks