OTA_Mode - No Network port is shown !

Here is my situation. I have both IDE 1.8.3 and 1.8.7 installed. I run both ESP8266's and ESP32's that use OTA.

When using 1.8.3 I always see the OTA addresses in the PORTS. When using 1.8.7 it is hit and miss, mostly the OTA ports don't show up.

However, if I have 1.8.7 running and the OTA ports don't show up, if I open 1.8.3 they show up there and also in 1.8.7. Strange, but I don't have to do anything else to make that work. I can upload sketches over OTA using 1.8.7. But if I close 1.8.3 then I can't upload over OTA, it says the board is not connected and the PORT list is missing the OTA addresses. If I re-open 1.8.3 then it all works again.

There appears some thing wrong in versions 1.8.7 and up. My two cents.

UPDATE 4/27/2020 I did a fresh install of Windows 10 Pro and now Arduino 1.8.12 can see the OTA ports just fine.

Wasted a lot of time on both experiments& net investigations ( BTW over 90% of advices are useless) I found:

  1. Don't fight with Arduino IDE. It is completely useless. Definetely there is a bug inside IDE.
  2. Don't fight with ArduinoOTA libraries. They are not the source of problems.
  3. To execute OTA use external script.
  4. Instal Bonjour sevice in Windows machines. To check presence of the board you would like to update by OTA use eg. Bonjour Browser . It is not ideal (it shows the boards which don't exist at the moment on-line.Don't know why.Refresh doesn't help). Even better use Advanced IP Scaner (no problem similar to Bonjour Browser). Generally if OS see your board one could be sure the OTA will be successful.
  5. Place the espota.py in the main Python directory as well as your sketch.bin file.
  6. Open command line window. Change directory to main Python directory (eg. cd c:\Python27).
  7. Use following script in command window:

python espota.py -i 192.168.1.2 -p 8266 --auth= -f sketch.bin

Of course change the IP of your board and the name of your scetch file. Ready. :)

zapinio: Wasted a lot of time on both experiments& net investigations ( BTW over 90% of advices are useless) I found

I think the reason why a lot of the advice here is useless to a specific person is that the thread deals with multiple issues faced by different people. Some have problems in their sketches, some have issues with their routers, some deal with changes in Arduino IDE that suddenly stops working, etc. So there are different fixes for different problems and this discussion has become a mess over time.

Anyway, I wanted to thank you for the python approach. I have recently upgraded my router to a Mikrotik one and since then, nothing can detect the boards, so none of the "Bonjour Browser" fixes work anymore for the Arduino IDE. Knowing the IP address this just works with no issues.

I think it would be nice if Arduino IDE didn't rely completely on detection and allowed us to upload to a known IP address as well. Maybe one day...

I had the same problem, already now for a long time (years?)

My devices were (usually) not showing up in the 'Tools → ‘Port’ menu of the Arduino IDE. However, very occasionally (let’s say 1 in 50 times), they would show up (or at least some of them). Very strange!

I am using Windows 7 SP1, version 2.6.3 of the esp8266 board package, and Arduino IDE 1.8.11 . But the problem was already there in earlier versions of the IDE and earlier version of the esp8266 board package. I seem to remember that long time ago, with a much earlier version of the IDE, things were working fine.

I checked everything over and over. All seemed fine. I followed most of the hints and tips as given in this forum, and sometimes things would work, but sooner or later it would stop working again.

To look around on my own network, I downloaded and installed ‘Bonjour browser for Windows’. This program shows my ESP devices, nicely advertising their OTA update port, 8266 . Now, I noticed that, while running this ‘Bonjour browser for Windows’ program, the Arduino IDE would suddenly show my devices in the 'Tools → ‘Port’ menu. It was working! So I thought. The next day, the devices would not be shown in the Arduino IDE.

I suspected the running of ‘Bonjour browser for Windows’ simultaneously with the Arduino IDE had something to do with it. So I fired that up again, and lo and behold, after a few moments the devices were shown in the Arduino IDE!

Repeated a couple of times, and it was consistent: when ‘Bonjour browser for Windows’ was running, the devices are shown, otherwise not.

So I decided to have a look with ‘Wireshark’ (a network packet sniffer). I captured all ‘mdns’ packets during a session when ‘Bonjour browser for Windows’ was running together with the IDE. I then compared that to a similar session with ‘Bonjour browser for Windows’ not running. In the latter session (only the IDE running), I noticed that my laptop was not sending any “Standard query” packets to port 5353. When running the Arduino IDE together with the ‘Bonjour browser for Windows’, I could see the “Standard query” packets to port 5353 being sent and all devices responding one by one, and subsequently appearing in the IDE’s menu.

Being completely convinced that this “OTA” stuff was specific to the esp8266 hardware (Arduino Uno does not support it), I searched through all the code and (Python) scripts in the directory structure of the ‘esp8266\hardware’ board package directory. But I found nothing that I could relate to mDNS.

So I decided to look further, in the files of the Aruino IDE itself, in/under ‘c:\Program Files (x86)\Arduino-1.8.11’. In the ‘…\lib’ subdirectory, there is a file called ‘jmdns-3.5.3.jar’. That looks like something to do with mDNS. After Googling for it, I found there is a newer version of this Java library, at https://mvnrepository.com/artifact/org.jmdns/jmdns/3.5.5. So I downloaded the ‘jmdns-3.5.5.jar’ file, removed ‘jmdns-3.5.3.jar’ out of the ‘…\lib’ subdirectory and placed ‘jmdns-3.5.5.jar’ in it.

As a result, running the ‘c:\Program Files (x86)\Arduino-1.8.11\arduino.exe’ would crash :confused: Somehow, the ‘arduino.exe’ expects exactly version 3.5.3 of this .jar file.

I loaded ‘arduino.exe’ into a hex (binary) editor, looked around a bit and indeed I found he hard coded file name with the version in it. Keeping a copy of ‘arduino.exe’ in ‘arduino.exe.bak’, I simply changed the string ‘jmdns-3.5.3.jar’ to ‘jmdns-3.5.5.jar’ (see attached screen capture).

Suddenly it all worked. I could launch the Arduino IDE and it would consequenly show all my devices, directly at startup. No need for other software or ‘Bonjour service’ to run along. Another trace with ‘Wireshark’ now shows nicely the “Standard query” packet to port 5353, and all the responses, when starting up the Arduino IDE.

So my conclusion: the Aruino IDE is using a buggy version 3.5.3 of the Java ‘jmdns’ library, and upgrading that to version 3.5.5 solves (for me) the issues.

To double-check, I switched back to version 3.5.3 of the Java ‘jmdns’ library, and indeed the flaky behaviour of the devices not showing up in the IDE started all over again.

One strange thing I noticed: on my desktop PC, all was working fine, even with the version 3.5.3 of the Java ‘jmdns’ library. So I decided to dig deeper. My desktop PC has only one network interface, my laptop has multiple (wired, wireless, even a couple of “virtual” and “VPN” ones). So I setup Wireshark to start capturing on all network interfaces simultaneously (yes, Wireshark supports that :slight_smile: ). Now I could see clearly what was happening. With version 3.5.3, the “Standard query” packets to port 5353 are sent to only one network interface (the wrong one). With version 3.5.5, the “Standard query” packets are sent to all (“connected”) network interfaces. The responses are then coming in on the active network interface, and the devices are subsequently shown in the Arduino IDE menu.

I had a look in the other versions of the Arduino IDE. The current newest version, 1.8.12, is still using 3.5.3. Version 1.8.5 and older were using 3.5.1 . This corresponds to forum postings reporting that IDE versions 1.8.5 and earlier are working ok. I also checked the sending of the “Standard query” packets; indeed up to version 1.8.5 they are sent to all network interfaces, and starting from version 1.8.6 they are sent to one (usually wrong) network interface.

@camel_a: Thanks a lot, much appreciated!

Great job ;RE ;RE ;RE Thanks. I will experiment according to your investigations. Thanks once more.

camel_a: I had the same problem, already now for a long time (years?) ... One strange thing I noticed: on my desktop PC, all was working fine, even with the version 3.5.3 of the Java 'jmdns' library. So I decided to dig deeper. My desktop PC has only one network interface, my laptop has multiple (wired, wireless, even a couple of "virtual" and "VPN" ones). So I setup Wireshark to start capturing on all network interfaces simultaneously (yes, Wireshark supports that :) ). Now I could see clearly what was happening. With version 3.5.3, the "Standard query" packets to port 5353 are sent to only one network interface (the wrong one). With version 3.5.5, the "Standard query" packets are sent to all ("connected") network interfaces. The responses are then coming in on the active network interface, and the devices are subsequently shown in the Arduino IDE menu. ...

Wow camel_a, nice work! This problem has plagued many people for a very long time.

I thought I'd share my little modification to the solution, which I feel is slightly less intrusive: I downloaded the 3.5.5 version of the jar and overwrote the 3.5.3 version with it. So my jar is named 3.5.3, but it's actually 3.5.5. That way, you don't need to hexedit the .exe file. It works!

thanks!!!

In Arduino 1.8.13 jmdns has been updated to v3.5.5.

I still don't get a network port. Can't reboot router with gaming teen at home... Will try later.

dvilo: In Arduino 1.8.13 jmdns has been updated to v3.5.5.

I still don't get a network port. Can't reboot router with gaming teen at home... Will try later.

That's very good news - I've tried it by comparing 1.8.12 and 1.8.13 and while I couldn't see the network port in 1.8.12, it worked for me in 1.8.13 (although it took a few seconds for the network port to appear - it wasn't there when I first looked, only appeared after a little while). Thanks!

Looks good! I just tried the IDE version 1.8.12 clean install and the network ports didn't show up. Then tried version 1.8.13 and all network ports showed up directly! :D

blynkuser: I need WIFI_AP_STA for my app. Workaround is to handle the MDNS outside of the OTA library.

In setup() I've added the following between starting WiFi and starting OTA:

extern MDNSResponder MDNS;
MDNS.begin("TestHost", WiFi.localIP(), 0);

Looking at the source code of ESP8266mDNS_Legacy:

   bool begin(const char* hostName);
    bool begin(const String& hostName)
    {
        return begin(hostName.c_str());
    }
    //for compatibility
    bool begin(const char* hostName, IPAddress ip, uint32_t ttl = 120)
    {
        (void) ip;
        (void) ttl;
        return begin(hostName);
    }
    bool begin(const String& hostName, IPAddress ip, uint32_t ttl = 120)
    {
        return begin(hostName.c_str(), ip, ttl);
    }

It seems that calling code with the IP address does nothing.

My issue is that ArduinoOTA does not reinitialize when there is a change in network. In ArduinoOTA.begin, it has:

void ArduinoOTAClass::begin(bool useMDNS) {
  if (_initialized)
    return;
/* other code */
  _initialized = true;
}

So it seems it is only allowed to initialize once, and never again even if network were to change. Quite a bad assumption since WiFi devices connecting to various network over their lifetime is the norm these days.

This morning I flashed the OTA sketch to a NodeMCU, but no network port is shown. I checked the firewall on the router and on this pc with W10, no luck, not even after disabling the firewall on W10. The router's firewall isn't reporting any mDNS packages being processed by the rule allowing 5353 udp between the specified networks.

I have a hunch why this isn't working, does anyone know if OTA with the Arduino IDE can be done across subnets? Since the ESP-module is in a different VLAN and subnet. I wrote rules to allow traffic for both 5353 as well as the port specified in the sketch, but no luck.

I'm having a similar trouble, I think. It just seems that 10% of the times it works randomly. I've tried disabling the firewall in the win10 and in the router, as well as checking if it's connected to the wifi and if it "pings".

Just (I think) found a solution (for me). I've opened 2 IDEs, one 1.8.13 and opened the serial monitor, resetted my esp32, opened one 1.8.5 and for 3 times it worked in a row. I'm not saying it is these versions and specifically this way. I think it resides in opening the serial monitor and another window of the IDE.

It seems it was a one time forever solution. Now I reactivated all the firewalls, and I'm not needing 2 IDEs to show it 100% of the times.

Now it doesn't work anymore. Nothing. It was working both in Arduino IDE and PlatformIO (VS Code).

Hey all :) I also asked that months ago, never got any reply and it seems people still have similar problems :o

My OTA problem started with ESP32. Each time I reboot the device (I do it via MQTT) I can use OTA because the port appears in the IDE. After a while the port disappears and I have to reboot the ESP before OTA, which kinda sucks.

I just had to update some ESP8266 devices and I just started my IDE again and now I see no network ports at all. Bonjour browser shows nothing either. IOW, now also ESP8266 has this problem.

Is there any working solution to have the network ports visible without rebooting the ESPs first?

This Problem exist more that a year and is til today not solved! Crazy

i have also teh same problem i do not get i a IP port

arduino.cc 1.8.12 on a win 10 PC, also installed pyton 3.9.2

try this https://lastminuteengineers.com/esp8266-ota-updates-arduino-ide/

but no ip port at arduino.cc , but it has given a IP at my router

What am i missing /doing wrong

by the way , when i unplug the nodeMCU board i cannot select a port at arduino anymore

after reading thousands of treads (and numerous solutions) of the OTA issue, I finally managed it to work. The most frustrating thing was that OTA worked just fine on the old PC, however, new one was not picking up the ports.
While I cannot confirm 100% which step/solution helped (since I’ve tried them all), the Port has only appeared after disabling IPv6 in the network properties.

I had a similar issues:

  1. Network Port not visible, and
  2. No Response from Device

On Arduino IDE 1.8.10 and Windows 10

I tried everything listed by folks here including disabling / enabling WiFi Adapter, various firewall settings, create inbount/outbound firewall rules. I figured that the moment I would disable the Windows Firewall for Public domain, all things would work.

This is what I think worked:

  1. Installed Bonjour service - did not reboot
  2. Edited registry but did not reboot ( so not sure if this had any effect )
    Computer\HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows NT\DNSClient. If the key does not exist, create it.
    -Add the value EnableMulticast as a REG_DWORD, with the value 0.
  3. I noticed that my WiFi Network profile was set to Public. I made that Private everything magically started working. To change the profile Network and Internet Settings -> Status-> Properties (of your wifi or LAN ) -> Network Profile = Private

I am not sure if the registry edit had anything to do with the solution but too maxed out to now delete it and retry..

Hope this helps.

Best
Zen80

Same problem on a PC with Arduino IDE 1.8.15 and OS Linux Debian, Release 11 (bullseye) 64-bit.
After programming via serial an ESP8266 from a sketch that includes arduinoOTA, it does not show as network connection in the IDE.
The ESP8266 is announcing itself sending UDP packets to 224.0.0.251 port 5353.
Looking at where Arduino IDE is listening for these packets I noticed, using the command 'netstat -ulnp' as root on the PC, that two java applications are listening on port 5353, but only under ipv6 (udp6). For udp (ipv4) nothing is listening on port 5353. Perhaps an error in the jmdns package or the way it is called from Arduino IDE? Or is OTA updating only supposed to work when ipv6 is fully supported?