Skip to content
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

hostname will not be resolved at upload #1639

Open
aber68 opened this issue Mar 17, 2024 · 8 comments
Open

hostname will not be resolved at upload #1639

aber68 opened this issue Mar 17, 2024 · 8 comments

Comments

@aber68
Copy link

aber68 commented Mar 17, 2024

hello,

using last sloeber version, ESP32 and OTA for upload ...

.......s\esp32\hardware\esp32\2.0.14/tools/espota.exe -r -i BEwecker.local -p 3232 .....

the above hostname will not be recognized from sloeber, but from arduino IDE 2.x

whats wrong?

code snippet:

ArduinoOTA.setPassword("1234");
ArduinoOTA.setPort(3232);
ArduinoOTA.setHostname("BEwecker");
ArduinoOTA.setMdnsEnabled(true);
ArduinoOTA.begin();

best regards
andreas

@jantje
Copy link
Member

jantje commented Mar 17, 2024

The hostname resolution happens at the os level.
In other words for Sloeber "BEwecker.local" is only a string that is put in the command.
The command is run at the os level and the os needs to resolve "BEwecker.local" to a IP address

@aber68
Copy link
Author

aber68 commented Mar 17, 2024

thanks for reply, but where does sloeber take this string? i want to have the command -i set with the local IP eg 192.168.0.x

@jantje
Copy link
Member

jantje commented Mar 17, 2024

project properties->sloeber?

@aber68
Copy link
Author

aber68 commented Mar 18, 2024

not really, the port shows the address of the ESP device. if you change the line to the IP only, espota will then switch to a local port, which is obviously not available, eg changing "BEwecker.local 192.168.0.50" to "192.168.0.50" will fail ...

but "BEwecker.local" does exist, bcs this can be entered in a browser and will be resolved to "192.168.0.50", which is correct

@jantje
Copy link
Member

jantje commented Mar 18, 2024

Have you tried "192.168.0.50 192.168.0.50" in case of ip adress it is a 2 field one is the name one is the ip I don't recall the order.

@aber68
Copy link
Author

aber68 commented Mar 18, 2024

i think yes, but i will double check in the eve

@aber68
Copy link
Author

aber68 commented Mar 18, 2024

your tip did it, thanks!

yesterday i tried ArduinoOTA.setHostname("192.168.0.50") which failed. but the following line is still needed: ArduinoOTA.setPort(3232) otherwise sloeber will use port 8266 as default in spite of ESP32 is choosen as plattform.

btw after changing any of the project properties this error comes up: "...\Release/file_opts: No such file or directory" (this can only be cleared after creating a "file_opts" file in the release directoray by hand - why is that?

br

@jantje
Copy link
Member

jantje commented Mar 18, 2024

file_opts is a way ESP32 uses to provide the user to add build options to the build command. Something you can do in Sloeber as well.
Using the hooks the file_opts file should be created but Sloeber does not support all hook types and mutch more.
I prefer to remove the file_opts from the command line by modifying the platform.txt file
For more info see see #1582

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

No branches or pull requests

2 participants