logo elektroda
logo elektroda
X
logo elektroda

[Solved] How to upload software to ESP8266 via OTA? Windows Defender problem.

pier 834 14
ADVERTISEMENT
Treść została przetłumaczona polish » english Zobacz oryginalną wersję tematu
  • #1 17766394
    pier
    Level 24  
    Hello.
    Colleagues how do I deal with uploading software to ESP8266 via OTA on WIN10?
    The culprit of all the confusion is Windows Defender I believe.
    Is it possible to somehow force it not to block the connection to ESP?
    After manually disabling Defender and restarting the computer, I can choose to connect to ESP via OTA, but I can't program it because Defender seems to be turning on at the time.
    How do I deal with this?
  • ADVERTISEMENT
  • #2 17766810
    Anonymous
    Level 1  
  • #3 17766928
    pier
    Level 24  
    Tomequ123 wrote:
    Disable all services associated with Defender.

    To make it that simple. I turn it off and after a reboot Defender is working again. I even tried some way with the registry but the result is the same.
  • ADVERTISEMENT
  • #4 17766944
    Anonymous
    Level 1  
  • #5 17767014
    pier
    Level 24  
    Tomequ123 wrote:
    Link .

    Link

    This doesn't work either?


    Neither way works.
    Even if I manage to disable it and after a reboot I have the OTA connection to ESP visible in the IDE, when I try to upload the sketch it gives an error and the connection disappears and Defender becomes active in an unknown way.

    Any advice?
  • #6 17767161
    Vinnic
    Level 16  
    Maybe you just need to disable the firewall and not all of Defender, or set exceptions.
  • #7 17767792
    pier
    Level 24  
    I don't think it's Defender's fault after all.
    IDE already sees the connection but sketch cannot be uploaded. I keep getting an error:
    selected serial port
    does not exist or your board is not connected
  • ADVERTISEMENT
  • #8 17768737
    Vinnic
    Level 16  
    It is necessary to select the COM to which the ESP is connected.
  • ADVERTISEMENT
  • #9 17768816
    pier
    Level 24  
    Vinnic wrote:
    This needs to select the COM to which the ESP is connected.
    .
    Heh ESP is not connected to any port. OTA is programming over WiFi.
  • #10 17769418
    Vinnic
    Level 16  
    Right, sorry, my oversight.
  • #11 17769426
    starob
    Level 29  
    Are we talking about the Arduino IDE?
    The problem is not with the defender but with the Bonjour service.
    The boards with OTA through it "present" themselves.
    If you install https://hobbyistsoftware.com/bonjourbrowser which also detects ESP with OTA it will mean that the service is working properly. Then the IDE will also detect the OTA.
    I struggled with this for a couple of days and did not achieve a reproducible result. Occasionally turning on a printer that presents itself in Bonjour helped.
    The final 100% working solution that applies is the program
    https://1st.bitbumper.de/ota-firmware-update-tool-for-esp8266/.
    I place the program in the project directory and fire it up in parallel with the IDE.
    I do an export of the compiled program (Ctr+Alt+S) and "flash" in BitBumper.
    This is not a cumbersome solution, is hardly different from uploading from the IDE and always works. If this method does not work, it means If it does not work this way, it means that there is something wrong with the program itself.
  • #12 17769620
    pier
    Level 24  
    starob wrote:
    We are talking about the Arduino IDE?
    The problem is not with the defender but with the Bonjour service.
    Boards with OTAs through it "present" themselves.
    If you install https://hobbyistsoftware.com/bonjourbrowser which also detects ESP with OTA it will mean that the service is working properly. Then the IDE will also detect the OTA.
    I struggled with this for a couple of days and did not achieve a reproducible result. Occasionally turning on a printer that presents itself in Bonjour helped.
    The final 100% working solution that applies is the program
    https://1st.bitbumper.de/ota-firmware-update-tool-for-esp8266/.
    I place the program in the project directory and fire it up in parallel with the IDE.
    I do an export of the compiled program (Ctr+Alt+S) and "flash" in BitBumper.
    This is not a cumbersome solution, is hardly different from uploading from the IDE and always works. If this method does not work, it means If this way doesn't work it means that there is something wrong in the program itself.
    .
    Yes Arduino IDE.
    I no longer have a problem with the network connection. Bonjour browser sees my ESP the problem is that it doesn't want to program. I get errors as I wrote above either: ERROR not answer.
    I am still wondering what about the gpio0 during OTA programming?

    I found here interesting information:

    Before you begin, please make sure that you have the following installed:
    Arduino IDE 1.6.5 and 1.6.5-947-g39819f0 version of platform package,
    Python 2.7 ( do not install Python 3.5 that is not supported ).

    Maybe it's the python version that's the problem? When installing I didn't think about it, I just downloaded the latest 3.7.2.
  • #13 17769695
    starob
    Level 29  
    In the OTA gpio0 is Hi.
    Upload the BasicOTA sketch if it works then you have something wrong in the loop() function - something that stops the loop.
    Here's the slightly corrected parts of loop() and setup(), you need to write loop() so that you periodically call ArduinoOTA.handle() and only it executes when you start programming.

    Code: C / C++
    Log in, to see the code
    .

    Added after 3 [minutes]:

    pier wrote:
    Maybe it's the python version that's the problem? When installing I didn't think about it but just downloaded the latest 3.7.2.


    ..yes this is the problem
  • #14 17770275
    pier
    Level 24  
    Do you have any suitable version of Python?

    I've been looking but some strange versions are downloading for me.
    I even managed to install one but it wouldn't fire up from the console.

    The next version 2.7.15 was able to be installed but does not fire from the console....
  • #15 17770860
    pier
    Level 24  
    Do you have any suitable version of Python?

    I've been looking but some strange versions are downloading for me.
    I even managed to install one but it wouldn't fire up from the console.

    The next version 2.7.15 was able to be installed but does not fire from the console....

    Added after 3 [hours] 58 [minutes]: .

    Eh, as usual, what turned out differently.
    Nodemcu programs via OTA with no problem.
    In the previous board I have esp8266 -07 and in it not enough memory....
    What's different is that the network connection disappears for no reason when it wants to.

Topic summary

The discussion revolves around issues faced when uploading software to the ESP8266 via Over-The-Air (OTA) on Windows 10, particularly due to conflicts with Windows Defender. The user experiences difficulties with Defender blocking the connection, even after attempts to disable it. Suggestions include disabling the firewall instead of the entire Defender, setting exceptions, and ensuring the correct COM port is selected. It is noted that the Arduino IDE may not be the issue, but rather the Bonjour service, which is essential for OTA functionality. A recommended solution involves using the BitBumper OTA firmware update tool alongside the IDE. Additionally, the importance of using the correct version of Python (2.7) for compatibility is highlighted, as well as ensuring GPIO0 is high during OTA programming.
Summary generated by the language model.
ADVERTISEMENT