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

[WIFI] Fix mDNS startup for log levels below LOG_LEVEL_INFO #1980

Closed
wants to merge 1 commit into from

Conversation

3cky
Copy link
Contributor

@3cky 3cky commented Oct 30, 2018

It seems #959 is almost here (still not enabled though), except small bug that prevents mDNS startup when log level is below LOG_LEVEL_INFO. This PR fixes this behaviour and also adds HTTP service to mDNS-SD registry.

@TD-er
Copy link
Member

TD-er commented Oct 30, 2018

Can anyone test this?
Do you have some idea already of how much the compiled image will grow with mDNS enabled?

It would be a great addition but since I'm also struggling for 1MB builds to get them 2-step OTA again, it would be nice to know if the define to enable this should be 'common' or only on builds for larger flash chips.

@3cky
Copy link
Contributor Author

3cky commented Oct 31, 2018

Hi @TD-er,

I have checked patched mega-20181029 and it worked well, but now I applied patch to mega-20181031 and it doesn't work. :( I'm observing wdt reset just after AP connection is established.

INIT : Booting version:  (ESP82xx Core 2_4_2, NONOS SDK 2.2.1(cfd48f3), LWIP: 2.0.3)
110 : INIT : Warm boot #45 - Restart Reason: Hardware Watchdog
112 : FS   : Mounting...
137 : FS   : Mount successful, used 75802 bytes of 957314
515 : CRC  : program checksum       ...OK
526 : CRC  : SecuritySettings CRC   ...OK 
527 : CRC  : binary has changed since last save of Settings
634 : INIT : Free RAM:25104
635 : INIT : I2C
635 : INIT : SPI not enabled
651 : INFO : Plugins: 75 [Normal] [Testing] [Development] (ESP82xx Core 2_4_2, NONOS SDK 2.2.1(cfd48f3), LWIP: 2.0.3)
653 : WIFI : Set WiFi to STA
685 : WIFI : Connecting MyAP attempt #0
2020 : WD   : Uptime 0 ConnectFailures 0 FreeMem 22992
4455 : WIFI : Connected! AP: MyAP (...) Ch: 6 Duration: 3768 ms

 ets Jan  8 2013,rst cause:4, boot mode:(3,7)

wdt reset

I'll investigate it further.

@uzi18
Copy link
Contributor

uzi18 commented Oct 31, 2018

try to run task clean and rebuild one more time

@3cky
Copy link
Contributor Author

3cky commented Nov 1, 2018

Tried clean/build, and it didn't help. But it looks like wdt resets are gone after I reverted back change from lwip (PIO_FRAMEWORK_ARDUINO_LWIP_HIGHER_BANDWIDTH) to lwip2 (PIO_FRAMEWORK_ARDUINO_LWIP2_HIGHER_BANDWIDTH) introduced in e3591ac.

@3cky
Copy link
Contributor Author

3cky commented Nov 1, 2018

Probably could be related to esp8266/Arduino#4028, but it seem it should be already fixed in esp8266/Arduino#4105.

@TD-er
Copy link
Member

TD-er commented Nov 1, 2018

@3cky It is still before my first coffee of today, so it may be more obvious ;)

Just to be sure, your problem was fixed when changing back from LWIP2/HB to LWIP1.4/HB?
Could you also check if LWIP2/low memory?

@3cky
Copy link
Contributor Author

3cky commented Nov 1, 2018

@TD-er exactly :) LWIP2/HB doesn't work, but LWIP1.4/HB works. I tried also LWIP2/low memory, it doesn't work either.

@3cky
Copy link
Contributor Author

3cky commented Nov 1, 2018

Just tried to replace ESP8266mDNS library bundled with 2.4.2 by its previous versions. It seem last version of ESP8266mDNS library working with ESPEasy when LWIP2 is enabled is one bundled with 2.3.0, while 2.4.0 and later versions are crashing.

@TD-er
Copy link
Member

TD-er commented Nov 7, 2018

Is there any update on this?
There should be somebody running mDNS on 2.4.x out there I guess.

@3cky
Copy link
Contributor Author

3cky commented Nov 7, 2018

Hi @TD-er,

Sorry for the delay, still can't figure out why mDNS isn't working with 2.4.x for ESPEasy. I tried to build latest Sonoff-Tasmota (which also uses mDNS) with 2.4.2 and it seem to work fine. :(

So I'm closing this PR for now and will open the new PR when this issue will be resolved.

@3cky 3cky closed this Nov 7, 2018
if (loglevelActiveFor(LOG_LEVEL_INFO)) {
String log = F("WIFI : ");
if (MDNS.begin(WifiGetHostname().c_str(), WiFi.localIP())) {
Copy link
Contributor

@uzi18 uzi18 Nov 12, 2018

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

related to #2048 ??
it will not start if loglevel < INFO

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No is not related to that issue, but indeed looks like a bug to me.

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

Successfully merging this pull request may close these issues.

3 participants