[quote]I know from your previous posts that you have port forwarding setup so you have been in to the router settings. I am not saying disable port forwarding but you might need to provide access to additional ports.
[/quote]
OK, hopefully not that complicated.
[quote]I also know you have “2 networks” running i.e not all the network is on 192.168.1.x. I think you might have 192.168.10.x too but as the IP port is appearing in the IDE this might not be the issue.
[/quote]
192.168.1.x is the wireless
192.168.0.x is the Ethernet
laptop and ESP’s are on the wireless net
[quote]What computer and OS are you using.Which router?
[/quote]
And what is your subnet? Why would you want to keep wired/wireless seperated anyway in a home situation? I’m using a form of OTA via the webbrowser too and it works fine. The little webserver runs on the ESP and I can upload a compiled bin file to it.
Code is bit like this:
//************** HTTP UPDATE ******************
#include <ESP8266WiFi.h>
#include <WiFiClient.h>
#include <ESP8266WebServer.h>
#include <ESP8266mDNS.h>
#include <ESP8266HTTPUpdateServer.h>
const char* host = "bla";
const char* ssid = "wifinet";
const char* password = "wifipwd";
ESP8266WebServer httpServer(80);
ESP8266HTTPUpdateServer httpUpdater;
//************** END HTTP UPDATE **************
void setup()
{
Serial.begin(115200);
//************** HTTP UPDATE ******************
Serial.println();
Serial.println("Booting Sketch...");
WiFi.mode(WIFI_STA);
WiFi.softAPdisconnect(true);
//WiFi.begin(ssid, password); // If you uncomment this it will also be in AP mode, from security perspective, you don't want that!
while(WiFi.waitForConnectResult() != WL_CONNECTED){
WiFi.begin(ssid, password);
Serial.println("WiFi failed, retrying.");
}
MDNS.begin(host);
httpUpdater.setup(&httpServer);
httpServer.begin();
MDNS.addService("http", "tcp", 80);
Serial.printf("HTTPUpdateServer ready! Open http://%s.local/update in your browser\n", host);
Serial.println("");
Serial.print ( "IP address: " );
Serial.println ( WiFi.localIP() );
//************** END HTTP UPDATE **************
}
void loop()
{
//************** HTTP UPDATE ******************//
httpServer.handleClient();
//************** END HTTP UPDATE **************//
}
Nowyou can go to the IP of the thing and upload the bin file. It works perfectly
If could be. There is the possibility that one of your components is firewalled and has issues with protocols or weird stuff like that (trust me, I’m a network enigneer! ). What is the subnet of the wired and wireless components?
The following sketch will allow you to do OTA with a web browser or wireless serial comms (Arduino IDE etc).
Termite should give you something like this (3 available url formats):
Start
End
ets Jan 8 2013,rst cause:2, boot mode:(3,6)
...........
Booting
Ready - OTA Success!!!
IP address: 192.168.10.171
Now open http://esp8266.local/update in your browser or
http://192.168.10.171/update or http://cf3908.lan/update if you prefer.
You need to fix your network though @Dave1829 but it might be worth a try via a web browser from your known IP, ChipID or fixed url of http://esp8266.local/update
Arduino IDE (certainly 1.6.9 onwards) now allows you to export the compiled binary for your sketches (same folder as your sketches) from Sketch Menu. So you don’t have to go hunting for it in the tmp directory as indicated by the old Github notes.
#include <ESP8266WiFi.h>
#include <ESP8266mDNS.h>
#include <WiFiUdp.h>
#include <ArduinoOTA.h>
#include <ESP8266WebServer.h>
#include <ESP8266mDNS.h>
#include <ESP8266HTTPUpdateServer.h>
const char* host = "esp8266"; // will be "8266.local/update" in web browser
ESP8266WebServer httpServer(80);
ESP8266HTTPUpdateServer httpUpdater;
const char* ssid = "xxxxxxxx";
const char* password = "xxxxxxxxxx";
void setup() {
Serial.begin(115200);
Serial.println("\nBooting");
WiFi.mode(WIFI_STA);
WiFi.begin(ssid, password);
while (WiFi.waitForConnectResult() != WL_CONNECTED) {
Serial.println("Connection Failed! Rebooting...");
delay(5000);
ESP.restart();
}
// Port defaults to 8266
// ArduinoOTA.setPort(8266);
// Hostname defaults to esp8266-[ChipID]
// ArduinoOTA.setHostname("myesp8266");
// No authentication by default
// ArduinoOTA.setPassword((const char *)"123");
ArduinoOTA.onStart([]() {
Serial.println("Start");
});
ArduinoOTA.onEnd([]() {
Serial.println("\nEnd");
});
//ArduinoOTA.onProgress([](unsigned int progress, unsigned int total) {
// Serial.printf("Progress: %u%%\r", (progress / (total / 100)));
//});
ArduinoOTA.onError([](ota_error_t error) {
Serial.printf("Error[%u]: ", error);
if (error == OTA_AUTH_ERROR) Serial.println("Auth Failed");
else if (error == OTA_BEGIN_ERROR) Serial.println("Begin Failed");
else if (error == OTA_CONNECT_ERROR) Serial.println("Connect Failed");
else if (error == OTA_RECEIVE_ERROR) Serial.println("Receive Failed");
else if (error == OTA_END_ERROR) Serial.println("End Failed");
});
ArduinoOTA.begin();
Serial.println("Ready - OTA Success!!!");
Serial.print("IP address: ");
Serial.println(WiFi.localIP());
MDNS.begin(host);
httpUpdater.setup(&httpServer);
httpServer.begin();
MDNS.addService("http", "tcp", 80);
String ipaddress = WiFi.localIP().toString();
String chipID = String(ESP.getChipId(), HEX);
char charChipID[10];
chipID.toCharArray(charChipID, sizeof(charChipID));
char charipaddress[16];
ipaddress.toCharArray(charipaddress, sizeof(charipaddress));
Serial.printf("Now open http://%s.local/update in your browser or \n", host);
Serial.printf("http://%s/update or http://%s.lan/update if you prefer.\n", charipaddress, charChipID);
}
void loop() {
ArduinoOTA.handle();
httpServer.handleClient();
}
In a “secure” environment like your home you would normally have all devices on the same subnet so they can all “see each other”. Different subnets are used to “hide” different networks from different user types. So in a business the finance department might have a different subnet to the technical department etc.
I noticed you mentioned you have a separate WiFi router and cable broadband router, which is quite rare in a domestic environment these days. Manufacturers mainly use 192.168.10.x and 192.168.1.x for their default IP addresses but obviously they can be changed by the user. When you piggybacked one router to the other it looks like the IP’s worked out ok but that doesn’t mean the network is fully operational.
yeah, it is a fcukaround modem from the cable company, complete barstard. google it: Netgear CG3100
when i tried to make it all the same - i lost my NAS and my powerline broadband stuff all fell over, so really just got it to work, then was too scared to touch it!
Booting
Ready - OTA Success!!!
IP address: 192.168.1.103
Now open http://esp8266.local/update in your browser or
http://192.168.1.103/update or http://dc2054.lan/update if you prefer.
ets Jan 8 2013,rst cause:2, boot mode:(3,6)
load 0x4010f000, len 1384, room 16
tail 8
chksum 0x2d
csum 0x2d
v3de0c112
@cp:0
ld
ü
Booting
Ready - OTA Success!!!
IP address: 192.168.1.103
Now open http://esp8266.local/update in your browser or
http://192.168.1.103/update or http://dc2054.lan/update if you prefer.
Yes you must have these OTA elements in all sketches that you flash to the device or it will lose the ability to do further OTA updates. It will now take one upload without OTA elements, even empty setup() and empty loop() but then the device will be unobtainable.