Skip to content

Detect network port for OTA did not work on windows machine #970

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
reaper7 opened this issue Nov 5, 2015 · 5 comments
Closed

Detect network port for OTA did not work on windows machine #970

reaper7 opened this issue Nov 5, 2015 · 5 comments

Comments

@reaper7
Copy link
Contributor

reaper7 commented Nov 5, 2015

Detect network port for OTA did not work on windows machine
without executed tcp server on port 8266.

solution for me (when ArduinoOTA lib is used):

void ArduinoOTA::setup() {
  _udp_ota->begin(_port);
  if (_mdns_host) {
    if (_serial_debug)
      Serial.printf("OTA server at: %s:%u\n",
                    _mdns_host->c_str(),
                    _port);
    MDNS.begin(_mdns_host->c_str());
    MDNS.addService("arduino", "tcp", _port);

    WiFiServer TelnetServer(_port);
    TelnetServer.begin();
    TelnetServer.setNoDelay(true);
  }
}

with this addon inside ArduinoOTA.cpp port is detected and OTA is usable

@webguy16
Copy link

webguy16 commented Nov 5, 2015

Thanks. This fixes it for me as well.

@igrr
Copy link
Member

igrr commented Nov 6, 2015

The original idea was to use UDP to listen for the initial handshake, because TCP pcbs are expensive, and there are only 5 of them. Adding this TelnetServer pretty much defeats the purpose :)
It would be nice to find out why this is necessary on windows. Is it Arduino's 'feature' to check if the port is available, or is it an issue with jmdns library which arduino uses?

@reaper7
Copy link
Contributor Author

reaper7 commented Nov 6, 2015

igrr - true, I know...for that this is a issue, not "ready for use" solution
I don't know where is part of code for port detection, where I can find this code? this is python script, java or something else?

@igrr
Copy link
Member

igrr commented Nov 6, 2015

The reason for this issue is here:
https://github.com/arduino/Arduino/blob/master/arduino-core/src/cc/arduino/packages/discoverers/network/BoardReachabilityFilter.java#L72
This seriously breaks our OTA implementation, together with the fact that IDE initiates SSH uploads regardless of the using_ssh option now.

@mangelajo
Copy link
Contributor

Yikes!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

6 participants