OTA_Mode - No Network port is shown !

The most fun: my 4 ESP on which the OTA is activated appear in the list of network ports while some of them are not running since several hours ^^

I don't know if we have to laugh or cry ... It's going to drive me crazy !!

I had the same problem with 1.8.9 on Win 7. Tried switching to 1.8.5 and got message that python could not be found. I added python to system varialbe Path and 1.8.5 then showed network path. Reinstalled 1.8.9 and it is now showing the network path and I can OTA now. Maybe the 'bug' in 1.8.9 is that the error messages saying that python can't be found has been removed.

I have struggled for two days to be able to load a sketch on NodeMCU via OTA.

After loading Python 2.7 (important: only Python 2.7), following the instructions from the site ESP8266 OTA with Arduino IDE | Random Nerd Tutorials, I could not find the IP port of the NodeMCU board, on the Arduino IDE.

In the end, after so many futile attempts, the solution came after I discovered that the Bonjour Service was not present on my Windows 10.

So, I downloaded from the site https://support.apple.com/kb/DL999?locale=it_IT&viewlocale=it_IT, the file BonjourPSSetup.exe and installed it. After checking on Windows services if it appeared in Automatic start-up and after restarting Windows, finally on the IDE Arduino the IP port of my NodeMCU card, on which I have uploaded BasicOTA sketch, appeared.

After that, I was able to upload another sketch via OTA.

I think that it is important to use the Version 2.5.0 for the NodeMCU board on Arduino IDE, not the newest one.

On the screenshot attached there are the settings on Arduino IDE I used for my NodeMCU board. I do not know if these settings are mandatory or could be changed. In my case, I am been able to load the sketch on the NodeMCU and it works.

Hope this can help.

Yep, restarting router is still solution.

Found same problem at Ubuntu workstation & Arduino IDE 1.8.10:

First, check network: the device sends UDP requests to port 5353 (mDNS / Bonjour / Avahi).
By default at Ubuntu this port was blocked by local firewall - you must open it
iptables -A INPUT -p udp --dport 5353 -j ACCEPT

Second, check with browser:
avahi-browse -a
You must found your device in list. If not - reconnect device to WLAN.

Third, IP-port must showing up in IDE. If not - restart IDE.

That's all? No, wait: you must open ports for connection from device to workstation. And then problem was solved.

I have been following this thread for months in hope the answer would show up. I have had nothing from this discussion fix the problem for me. There are so many different setups here as far as equipment goes that it is hard to blame the problem on anything. The funny thing is that every now and then an external port will show up and I take the time to try and figure out exactly where I am. But when I duplicate that setup, it doesn't work the next time. I guess we aren't donating enough to Arduino to get somebody to take this problem seriously. It would be nice if someone could figure out what is broke in the chain that sends the port presence to the IDE. From my limited knowledge, nothing that works for me really means anything. Pinging the device, access via a browser,etc. All that stuff works for me but the IDE never gets the message.

What's a mother to do????
KentM

Same problems with WIN10 / Arduino 1.8.10
Solution hint was in #20 (and link behind)
You have to enable mDNS within registry. Just copy the content of the Quote to a .bat file. Just run as administrator.
ABSOLUTELY NO WARRANTY FOR PROPPER RESULTS!
... but for me, it helped a lot!

und nochmal in Deutsch:
Hatte die gleichen Probleme mit WIN10 und Arduino IDE 1.8.10
Die Lösung fand ich in #20 und dem darin enthaltenen link.
mDNS mus freigeschaltet werden.
Einfach den Inhalt aus dem Zitatfeld unten in ein bat-File kopieren und dieses als Administrator ausführen. Dann reboot.
ABSOLUT KEINE GARANTIE FÜR ZUVERLÄSSIGE ERGEBNISSE
... aber bei mir hat's geholfen!

REG ADD "HKLM\Software\Policies\Microsoft\Windows NT\DNSClient" /V "EnableMulticast" /D "0" /T REG_DWORD /F

This network port is a most frustrating issue ... my experience is a little different to most here but maybe of interest or add another piece to the puzzle.

My configuration is Win10, Arduino IDE 1.8.10, ESP8266 core 2.6.3, ESP-01 module.

OTA works fine with the BasicOTA example ... flash via serial and the network port pops right up.

I disconnect the serial connection and I can do OTA multiple updates just fine. Rock solid and repeatable. This makes me think that all the necessary bits are working: router, IDE, MDNS, etc.

So what's the problem?

I copy the OTA code to a more complex sketch (~750 lines of code) and the network port no longer appears. Restarting IDE / Win10 / ESP-01, regedit hack, do not help. Also plenty of space for OTA.

Now if I open both sketches and load BasicOTA via serial (network port pops up straight away), then switch to my sketch, I can see the network port and I can upload multiple times to the same module. (also repeatable)

If I shut down both sketches and open just my sketch, the network port is no longer there. (repeatable)

Digging into the OTA / MDNS libraries is of little help. ArduinoOTA.begin() calls MDNS.begin() as it should. ArduinoOTA.handle() calls MDNS.update() as it should. Note: if your "security" for OTA involves not running the OTA handler unless some flag/switch is turned on, you will need to insert your own MDNS.update() in the loop.

Frustrating!

Update: 22/1/2020 - understand behavior now

My code runs WiFi mode WIFI_AP_STA at startup.

After more digging in the MDNS library, looks like if both AP and STA are connected and no IP address is passed in the call to MDNS.begin(), the library will preference AP's address (and subnet). This is verified by logging on to the local AP from my iPad and typing "hostname".local. The name is resolved OK. My Arduino IDE is on the sta subnet!

Modified my code to be WIFI_STA only and network port pops up (note: the registry hack to stop LLMNR multicast makes no difference for me).

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);

And in the loop() I've added:

MDNS.update();

You still need to let ArduinoOTA.begin(true) start so it can advertise to the IDE on port 8266.

NOTE: People who were looking for a way to "force" and IP address for the network port ... this is an possible way to do it.

I, like many, have also had problems with missing network addresses for OTA software updates.
After using OTA on many devices for some years, suddenly I couldn’t use the system any more.

I spent some time with Wireshark monitoring port 5353, and after some playing around I realized that a 8266 must send out some 5353 packets just after booting, to advise the development system that it is present.

These packages was missing on the newly compiled units, despite nothing had been changed in the software, since the last update of the source code.

I started investigating and after a lot of trial and error, I found that the code line:

ArduinoOTA.begin();

had to be moved so that it is executed AFTER the WiFi is completely up and running, typically just after:

WiFi.begin();

I have not investigated the libraries, but I assume that some recent changes behind the scene, has made the new location of the OTA begin necessary.

Item:
While I was at it, I also saw that the OTA example code included these two files:

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

They are not needed for the OTA system alone, it works fine without them.
If you need .local names, you will need mDNS though.

Hope that can be of help to someone.

I was able to fix my issue. I have a Fritz!Box router with 2.4Ghz and 5Ghz. The ESP8266 seems to connect on 2.4Ghz.

I first created a guest account but that didn't work for some reason. The module connected but Arduino IDE couldn't see it. I then connected to the Fritz!Box 2.4 network and it worked fine. My PC is on the 5Ghz network. I do have the firwall turned off for private networks.

A few days ago, I had a problem, but all I had to do was restart the router (not via software) and the IP address appeared in the IDE again.

I am just having the same problem on macOS with the Arduino IDE 1.8.12 (but I have tried 1.8.5 and 1.6.something with the same results).

The Arduino IDE shows nothing as "Network ports" in its Tool menu after I have selected "Arduino Uno WiFi" board, even though my ESP8266-01 is up and running, and properly advertises an _arduino._tcp service.

I have been looking on the Internet for 2-3h without making any change to the Arduino or the ESP8266 and, all of a sudden, the Arduino IDE finally shows the ESP's address in the Tool menu!

Windows 10 though, but same problem :
I don't know if this will help you. I have tried a lot of things and with Arduino IDE 1.8.12 I could not connect with my nodeMcu units.

Untill I did the following (and before that most of the tips in this thread):

  • Added firewall inbound opening (port 5353) for python.exe (located at %USERPROFILE%\AppData\Local\Arduino15\packages\esp8266\tools\python3\3.7.2-post1\python.exe)
  • Disabled my network adapter.
  • Enabled my network adapter.
  • Started Arduino IDE

Ports filled with my units!!

I have already done the registry fix (turn off EnableMulticast)
Installed Bonjour service by extracting it from iTunes.exe (used 7-zip to open and extract Bonjour64.msi)
I might have forgotten something along the way due to all different stuff I have tested.

Link to the post that seemed to fix it for me

Seems like you always have to disable/enable network to make it work.

Small price to pay. :slight_smile:

Hi, just want to add my experience, once it is SOLVED for me!
Even if I am not sure, what was the right step to solve this, this is the working setup I have:

  • Windows 10 Pro N
  • Arduino IDE 1.8.12
  • Apple Bonjour Service for Windows installed (downloaded here from Apple), Bonjour service started
  • Bonjour Browser (downloaded here from Hobbyist)
  • #20 done (the registry entry according to this article)
  • Chrome mDNS Browser is false positive, shows responses from _arduino._tcp.local, even if Bonjour Browser does not and neither does Arduino IDE
  • #31 not needed
  • lots of Windows reboots and several router reboots :slight_smile:

Hope it helps.

Thank you for this, had all but given up on this. I had exactly this problem and your solution makes perfect sense and works perfectly.

blynkuser:
This network port is a most frustrating issue ... my experience is a little different to most here but maybe of interest or add another piece to the puzzle.

My configuration is Win10, Arduino IDE 1.8.10, ESP8266 core 2.6.3, ESP-01 module.

OTA works fine with the BasicOTA example ... flash via serial and the network port pops right up.

I disconnect the serial connection and I can do OTA multiple updates just fine. Rock solid and repeatable. This makes me think that all the necessary bits are working: router, IDE, MDNS, etc.

So what's the problem?

I copy the OTA code to a more complex sketch (~750 lines of code) and the network port no longer appears. Restarting IDE / Win10 / ESP-01, regedit hack, do not help. Also plenty of space for OTA.

Now if I open both sketches and load BasicOTA via serial (network port pops up straight away), then switch to my sketch, I can see the network port and I can upload multiple times to the same module. (also repeatable)

If I shut down both sketches and open just my sketch, the network port is no longer there. (repeatable)

Digging into the OTA / MDNS libraries is of little help. ArduinoOTA.begin() calls MDNS.begin() as it should. ArduinoOTA.handle() calls MDNS.update() as it should. Note: if your "security" for OTA involves not running the OTA handler unless some flag/switch is turned on, you will need to insert your own MDNS.update() in the loop.

Frustrating!

Update: 22/1/2020 - understand behavior now

My code runs WiFi mode WIFI_AP_STA at startup.

After more digging in the MDNS library, looks like if both AP and STA are connected and no IP address is passed in the call to MDNS.begin(), the library will preference AP's address (and subnet). This is verified by logging on to the local AP from my iPad and typing "hostname".local. The name is resolved OK. My Arduino IDE is on the sta subnet!

Modified my code to be WIFI_STA only and network port pops up (note: the registry hack to stop LLMNR multicast makes no difference for me).

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);




And in the loop() I've added:


MDNS.update();




You still need to let ArduinoOTA.begin(true) start so it can advertise to the IDE on port 8266.


NOTE: People who were looking for a way to "force" and IP address for the network port ... this is an possible way to do it.

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. :slight_smile:

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.