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

Share the web workflow MDNS object with the user #7445

Merged
merged 3 commits into from Jan 17, 2023

Conversation

tannewt
Copy link
Member

@tannewt tannewt commented Jan 12, 2023

Fixes #7369

@anecdata Mind testing and reviewing?

@tannewt tannewt requested a review from anecdata January 12, 2023 00:06
Copy link
Member

@anecdata anecdata left a comment

Choose a reason for hiding this comment

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

Adafruit CircuitPython 8.0.0-beta.6-36-gc93d6d5e6 on 2023-01-12; Adafruit QT Py ESP32S2 with ESP32S2

🟢 ESP32-S2 (QT Py) - Web Workflow ENABLED

Code from #7326 runs, and finds other CircuitPython mDNS devices

🔴 ESP32-S2 (QT Py) - Web Workflow NOT ENABLED

Code from #7326 starts to run, but board enters Safe Mode early, timing doesn't seem exactly consistent:

[tio 21:16:34] Connected
=========================
Starting mDNS server...
Connecting to wifi AP... IPv4=192.168.6.161
-------------------------
Finding mDNS hosts from 192.168.6.161...

[tio 21:16:52] Disconnected
[tio 21:16:54] Connected
Auto-reload is off.
Running in safe mode! Not running saved code.

You are in safe mode because:
CircuitPython core code crashed hard. Whoops!
Crash into the HardFault_Handler.
Please file an issue with the contents of your CIRCUITPY drive at 
https://github.com/adafruit/circuitpython/issues

Press any key to enter the REPL. Use CTRL-D to reload.

Adafruit CircuitPython 8.0.0-beta.6-36-gc93d6d5e6 on 2023-01-12; Adafruit QT Py ESP32S2 with ESP32S2

or

[tio 21:17:54] Connected
Auto-reload is off.
Running in safe mode! Not running saved code.

You are in safe mode because:
CircuitPython core code crashed hard. Whoops!
Crash into the HardFault_Handler.
Please file an issue with the contents of your CIRCUITPY drive at 
https://github.com/adafruit/circuitpython/issues

or

[tio 21:18:35] Connected
=========================
Starting mDNS server...
Connecting to wifi AP... IPv4=192.168.6.161
-------------------------
[tio 21:18:54] Disconnected
Adafruit CircuitPython 8.0.0-beta.6-36-gc93d6d5e6 on 2023-01-12; Raspberry Pi Pico W with rp2040

🟢 Pico W - Web Workflow ENABLED

Code from #7326 runs, and finds other CircuitPython mDNS devices

🔴 Pico W - Web Workflow NOT ENABLED

Code from #7326 starts to run, but board hangs early, no exception, no safe mode, and no control-C, but timing doesn't seem exactly consistent:

[tio 21:11:53] Connected
=========================
Starting mDNS server...
Connecting to wifi AP.... IPv4=192.168.6.201
-------------------------
Finding mDNS hosts from 192.168.6.201...
[tio 21:12:52] Disconnected

hang... power cycle...

[tio 21:13:00] Connected
=========================
Starting mDNS server...
Connecting to wifi AP.... IPv4=192.168.6.201
-------------------------
Finding mDNS hosts from 192.168.6.201...
[tio 21:23:47] Disconnected

hang... power cycle...

[tio 21:23:54] Connected
=========================
Starting mDNS server...
Connecting to wifi AP... IPv4=192.168.6.201
-------------------------

@anecdata
Copy link
Member

Went back to a recent pre-PR version and re-verified that:
Adafruit CircuitPython 8.0.0-beta.6-25-gbb3a1c0a2 on 2023-01-04; Adafruit QT Py ESP32S2 with ESP32S2
will find mDNS devices whether Web Workflow is enabled or not.

Similarly:
Adafruit CircuitPython 8.0.0-beta.6-25-gbb3a1c0a2 on 2023-01-04; Raspberry Pi Pico W with rp2040
will find mDNS devices when Web Workflow is not enabled.

@tannewt
Copy link
Member Author

tannewt commented Jan 12, 2023

Thank you so much for the testing! Sounds like I forgot to handle the case where web workflow is compiled in but not enabled.

@tannewt
Copy link
Member Author

tannewt commented Jan 12, 2023

@anecdata Thanks for the thorough testing. I've fixed it and tested on ESP32-S3 so far. Will find my Pico W now and follow up once I test it.

@tannewt
Copy link
Member Author

tannewt commented Jan 12, 2023

Doesn't look like its fully working on Pico W so don't bother reviewing yet. Thanks!

@tannewt
Copy link
Member Author

tannewt commented Jan 12, 2023

Ok, should be good now. 🤞

@tannewt tannewt requested a review from anecdata January 12, 2023 22:57
Copy link
Member

@jepler jepler left a comment

Choose a reason for hiding this comment

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

There's one part of this that is confusing to me and may merit a comment if it's intended. No testing performed.

ports/espressif/common-hal/mdns/Server.c Show resolved Hide resolved
ports/espressif/common-hal/mdns/Server.h Show resolved Hide resolved
Copy link
Member

@anecdata anecdata left a comment

Choose a reason for hiding this comment

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

Tested the artifacts. mdns.Server finds other CircuitPython mDNS devices on both espressif and raspberrypi, with and without web workflow enabled, after reset and after reload. ✓, ✓, ✓, and ✓... LGTM.

@tannewt tannewt requested review from jepler and dhalbert and removed request for jepler January 13, 2023 18:33
Copy link
Collaborator

@dhalbert dhalbert left a comment

Choose a reason for hiding this comment

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

Thanks! Didn't test; grateful to @anecdata for testing.

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.

mdns.Server behavior differs across reloads between raspberrypi & espressif
4 participants