Your new topic does not fit any of the above??? Check first. Then post here. Thanks.

Moderator: igrr

User avatar
By andre_teprom
#73892 Hello,


I'm doing some experiments with this library which turn possible to upload firmware through wifi, which seemed promising to be incorporated in my current project as one additional resource.

However, in order to work, it is necessary that the ESP8266 card is connected to the same network where the computer with the Arduino IDE is running.

So I thought if I could somehow deceive the library to put a remote IP/Port that I want to redirect to there, I thought maybe this could be done with some VPN, Portfoward, or any other artifice, but I do not have any skill in those areas related to "connectivity".

Would anyone have any insigth to solve that issue ?
User avatar
By andre_teprom
#73906 I thought that, given such a variety of redirect resources currently available in network technologies, that there might be some alternative to achieve that.

Anyway, thank you for the answer, although not what I expected. ;)
User avatar
By jankop
#73908 I use for my toys simple OTA through a browser.
When using port mapping on router, it works from anywhere.
Here is the entire code that is necessary for that.
The uploaded file must, of course, be in binary form as *.bin
Code: Select all#include <ESP8266WiFi.h>
#include <ESP8266WebServer.h>
#include <ESP8266HTTPUpdateServer.h>
#define OTAUSER         "admin"    // Set OTA user
#define OTAPASSWORD     "admin"    // Set OTA password
#define OTAPATH         "/firmware"// Set path for update
#define SERVERPORT      80         // Server port
ESP8266WebServer HttpServer(SERVERPORT);
ESP8266HTTPUpdateServer httpUpdater;
//-----------------------------------------------------------------
void setup(void) {
  WiFi.begin();
  /* wait for WiFi connect */
  while (WiFi.status() != WL_CONNECTED) {
    delay(1000);
  }
  httpUpdater.setup(&HttpServer, OTAPATH, OTAUSER, OTAPASSWORD);
  HttpServer.onNotFound(handleNotFound);
  HttpServer.begin();
}
void loop(void) {
  HttpServer.handleClient();       // Listen for HTTP requests from clients
 // ...
 // ...
}
/* Send HTTP status 404 Not Found */
void handleNotFound() {
  HttpServer.send(404, "text/plain", "404: Not found");
}