Ota wifi port not appearing for wemos d1 mini

I am trying to run the Basic OTA arduino sketch with a Wemos D1 min boardi. The sketch uploads and I get correct output on the serial monitor, it has joined the wifi network, but an OTA port is not listed. I have python 2.7 installed. I have restarted the IDE and computer a few times. I found I have to press the Wemos reset button to get output on the Serial monitor, is this normal? Any help would be appreciated.

`I also tried reinstalling the ESP8266 core in board manager but have the same results.

Basic OTA is not a Blynk related function (aside from Local Server based support)… have you done any Googling about it?

On the Wemos? with a Basic OTA Arduino sketch? EDIT - Got ya… you are probably referring to on the PC, not ON the Wemos :stuck_out_tongue: (getting confused with beta Python support for the RPi).

Overall, it sounds like generally non-Blynk related issues… but regardless… we haven’t a clue if you are missing some commands or something, since we can’t see your current sketch :wink: Can you post it here please.

It’s the BasicOTA sketch. I have tried re-installing the IDE, 1.8.5, resinstalling the ESP8266 core, and still there is no OTA port shown. I don’t have anything strange going on, I am using Win10 64bit, I have used Ardiuno for several years and programmed this Wemos board normally by USB. This is my first attempt at OTA and it’s not working at all. After I upload the Basic OTA sketch then I try to upload another sketch by OTA, but the OTA port is not shown in the ports list like it should.

Here’s the BasicOTA.ino sketch:

#include <ESP8266WiFi.h>
#include <ESP8266mDNS.h>
#include <WiFiUdp.h>
#include <ArduinoOTA.h>

const char* ssid = "";
const char* password = "";

void setup() {
  Serial.begin(115200);
  Serial.println("Booting");
  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");
  Serial.print("IP address: ");
  Serial.println(WiFi.localIP());
}

void loop() {
  ArduinoOTA.handle();
}

The Wemos shows up as “USB-SERIAL CH340” under Device Manager.

That is correct… at least for the clones.

As for the OTA sketch… this is the basic Blynk compatible template I use for each new sketch I make… It contains everything needed and works just fine for the port scan, including the custom name I give it in the void setup()

I use Local Server, and rarely use the cloud… so I don’t know if that makes a difference or not.

#include <ESP8266WiFi.h>
#include <BlynkSimpleEsp8266.h>

#include <ESP8266mDNS.h>  // For OTA
#include <WiFiUdp.h>  // For OTA
#include <ArduinoOTA.h>  // For OTA

char auth[] = "xxxxxxxxxx";
char ssid[] = "xxxxxxxxxx";
char pass[] = "xxxxxxxxxx";
char IP[] = "xx.xx.xx.xx";


void setup()
{
  Serial.begin(9600);  // Debug console if required.

  Blynk.begin(auth, ssid, pass, IP, 8442);
  // Put other setup info here

  ArduinoOTA.setHostname("Wemos D1 Mni - Custom Device Name");  // For OTA - change name here to help identify device.
  ArduinoOTA.begin();  // For OTA
}

void loop()
{
  Blynk.run();
  // Put other loop stuff here

  ArduinoOTA.handle();  // For OTA
}

Thanks but had no effect. I also reinstalled python 2.7.14 but nothing changed. reinstalled and restarted everything, no change.

Well, then whatever the issue is, is related to your network or something else in your system… either way, it is NOT a Blynk related issue.

I also tried doing this with an Adafruit Huzzah board that I know works and there is no OTA port shown, so it has nothing to do with the board. I am using these boards with Blynk. I want to use OTA programming with the Arduino IDE. It needs something fixed, I have no idea what it is. Thanks for your help.

ESP8266WebServer is working for both boards

It is not the boards… it is either your network or your OTA libraries, or something else you are doing different… just because you want to use Blynk with these boards doesn’t mean we can solve your network issues.

I suggest you spend some time Googling the whole “missing port in IDE with OTA” issue and seeing what you can find…

  1. https://github.com/esp8266/Arduino/issues/2415

  2. https://github.com/esp8266/Arduino/tree/master/doc/ota_updates

  3. https://forum.arduino.cc/index.php?topic=445223.0

etc…

It’s not the network, the network works. It’s not the libraries, they are the standard Arduino libraries. So I think someone needs to fix the bugged up IDE.

https://forum.arduino.cc/

No one replies.

Soon, no one will reply here either :wink: if you don’t at least look at some of the links I have already supplied… There were some interesting reasons and solutions in them… and yes, involving their network.

@perigalacticon which version of the Arduino core are you using 2.3.0 or later?

I have a very “busy” Windows 8.1 system and bridged routers etc. Invariably I will have 100+ Windows open if you include 4 instances of Chrome. dozens of tabs open in each plus Arduino sketches galore,email etc, etc.

Quite often I find the port doesn’t show in the IDE which then requires a reboot and this can take 10 minutes or more.

I have a much “cleaner” Ubuntu system and that doesn’t have any problem seeing the ports. It could be the different networking protocols between the two OS’.

To be able to see the ports you must have the Bonjour service running on Windows. For my busy system I believe the service simply stops and trying to manually restart it doesn’t help. Bonjour gets installed with printer and networking software but it might be you don’t have it. Check your services.

The other issue when the ports do become available is that you will not be able to do an OTA update until you have unplugged the WeMos as least once since the last flash.

In the newer versions of the core and with verbose compiler messages set there is a message to the effect “numpty you haven’t rebooted since you last flashed”. Even though I am aware of this feature in ESP8266’s I still get caught out from time to time especially as I am reflashing minute by minute through the day.

When you flash via OTA the powering off is not required but during testing a lot of the flashing is via the USB port and hence the feature presents itself. In the real world Espressif are right that when you do a local flash and then take or send the ESP to a location where you are going to use OTA it will have naturally had the required reboot.

HTH

1 Like

I have Bonjour service it is running. I downloaded the Bonjour browser and it shows nothing is running.

Do you have access to a different OS on another PC?

I programmed the BasicOTA sketch, I disconnected it from USB, and connected to 5V power, and pressed reset. The led blinked 4-5 times and stopped. I went to the IDE, no OTA port was showing. I restarted the IDE, no OTA port is showing. Nothing is showing on the Bonjour Browser. I have an Android tablet?

I{ just saw that although the Services shows Bonjour as “Running”, under properties it shows “Stopped” I started it, but nothing changed, I restarted the IDE etc and no OTA port.

They answered your GitHub post within 18 minutes which is a pretty good service if you ask me. Especially as they will say GitHub is not really the right place. Their forum is the correct place.

As per the GitHub reply it’s probably your Firewall.

Just tried my wife’s relatively clean Windows 10 that has the Arduino IDE on it. At first no ports were showing and then I switched to the correct router and all ports appeared without any IDE restarts etc.

Maybe forget your WiFi network and reconnect saying yes to any prompts about local network access. Some people are fearful that this is opening up their computer to attack but as long as your local network is safe then you should allow full access, unless you want to abandon OTA.

Failing this do a thorough search through your firewalll settings.