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

Force MDNS restart after connection (NONBlockling) #1622

Open
Shumatic opened this issue Jun 7, 2023 · 10 comments
Open

Force MDNS restart after connection (NONBlockling) #1622

Shumatic opened this issue Jun 7, 2023 · 10 comments
Labels
bug Validated BUG

Comments

@Shumatic
Copy link

Shumatic commented Jun 7, 2023

Basic Infos

Hardware

WiFimanager Branch/Release: Master 2.0.16-rc.2

Esp8266:

Hardware: ESP-12e

Core Version: 2.4.0, staging

Description

Is there a callback function to indicate that a connection is made?
When using NONblocking and MDNS, it connects fine, but MDNS takes a long time to initialize,
so i would like to force a MDNS restart.

Settings in IDE 1.8.13

Module: Generic

@tablatronix
Copy link
Collaborator

hmm on esp8266 you have to explicitly run mdns, maybe there is a problem there.

@Shumatic
Copy link
Author

Shumatic commented Jun 9, 2023

hmm on esp8266 you have to explicitly run mdns, maybe there is a problem there.

No, i am aware of this, and i have MDNS.begin ( "name" ) ) in setup.
If ESP dosnt have a WiFi connection when booted, it still setup MDNS, and when i configure WiFi through the WiFimaneger it connects, but it isn't possile to reach from "name" only ip. It takes more then an hour before it works.

@tablatronix
Copy link
Collaborator

tablatronix commented Jun 9, 2023

If you use WM non blocking it handles this for you.

Otherwise I think you are suppose to call this in loop
'MDNS.update();'

Maybe this is outdated, I will have to check the docs and code for esp mdns.

But give that a try in case its not working?

I will investigate this for a bug, sounds like it might be, or not starting mdns when no connection

Also confirm there is no delays in loop and you are calling wm.process() often enough

@tablatronix tablatronix added the bug Validated BUG label Jun 9, 2023
@Shumatic
Copy link
Author

Shumatic commented Jun 10, 2023

Thanks
When i reboot after i have set WiFi, it works fine.
I have tried to force both MDNS.update() and MDNS.begin(xxx) with a botton, but it dosnt work.
Shouldnt the ESP restart automatically after WiFi have been set?
i think that would solve it.

@tablatronix
Copy link
Collaborator

mdns stop start?

@Shumatic
Copy link
Author

Hi Thers no Start stop mdns....

@tablatronix
Copy link
Collaborator

.end() sorry

@Shumatic
Copy link
Author

I havent tested properly...
when i set WiFi throug WiFimanager, and it reboots, i cant connect to it with IP either, i need to restart. so it isnt a MDNS problem

@tablatronix
Copy link
Collaborator

Thats strange, esp lib up to date?

@Shumatic
Copy link
Author

Shumatic commented Jul 4, 2023

Thats strange, esp lib up to date?

Hi, Thanks for still helping me out.....
Tested some more, and it is the same, when i put in credentials, it connect and get NTPsync, but i cant connect, even throug IP .
Another thing, if I put in a wrong password, and connect fails, it reboot portal, and i can correct PW, but it still dosnt work, i have to go in portal and ERASE WiFIconfig, then i can set theright PW.
All libs and esp updated and IDE is 2.1.1

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

No branches or pull requests

2 participants