jczic / MicroWebSrv

A micro HTTP Web server that supports WebSockets, html/python language templating and routing handlers, for MicroPython (used on Pycom modules & ESP32)
https://github.com/jczic/MicroWebSrv
MIT License
640 stars 115 forks source link

ESP32 - mws.IsStarted() problem when threaded #59

Closed xal88 closed 4 years ago

xal88 commented 4 years ago

Hi, when running mws.Start(threaded=True) then mws.IsStarted() always returns false.

mws is working fine, but of course mws.Stop() also fails.

What am I missing ? Thanks for your support Alf ESP32 4MB , micropython version='v1.11-178'

jczic commented 4 years ago

And if you wait a little after the Start call and before the IsStarted ?

Le ven. 26 juil. 2019 à 10:09, Alf notifications@github.com a écrit :

Hi, when running mws.Start(threaded=True) then mws.IsStarted() always returns false.

mws is working fine, but of course mws.Stop() also fails.

What am I missing ? Thanks for your support Alf ESP32 4MB , micropython version='v1.11-178'

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/jczic/MicroWebSrv/issues/59?email_source=notifications&email_token=AAD2ALF2XNZSPC4GX22VRELQBKWMNA5CNFSM4IHBP4Z2YY3PNVWWK3TUL52HS4DFUVEXG43VMWVGG33NNVSW45C7NFSM4HBU6WDQ, or mute the thread https://github.com/notifications/unsubscribe-auth/AAD2ALFICBHQCGBWXGKQRCDQBKWMNANCNFSM4IHBP4ZQ .

--

Sincèrement,

xal88 commented 4 years ago

With a pause this is working fine.

MicroPython v1.11-178-gad0b7cb01 on 2019-07-25; ESP32 module with ESP32
>>> from microWebSrv import MicroWebSrv
>>> mws = MicroWebSrv(webPath="/www")
>>> mws.Start(threaded=True)
>>> utime.sleep(10)
>>> mws.IsStarted()
True

So my 2 seconds wait was too short.
How can I stop/restart the server now ? - wait does not help there.

>>> mws.Stop()
>>> utime.sleep(10)
>>> mws.IsStarted()
True
jczic commented 4 years ago

Hello,

I released a fully new version (v2.0) of my web server here : github.com/jczic/MicroWebSrv2. Open source MIT, fully asynchronous, more robust, more fast and more efficient! It is delivered with a good documentation.

Thank you for your support and feedback. ☺️

Jean-Christophe Bos

Le sam. 27 juil. 2019 à 10:31, Alf notifications@github.com a écrit :

With a pause this is working fine.

MicroPython v1.11-178-gad0b7cb01 on 2019-07-25; ESP32 module with ESP32>>> from microWebSrv import MicroWebSrv>>> mws = MicroWebSrv(webPath="/www")>>> mws.Start(threaded=True)>>> utime.sleep(10)>>> mws.IsStarted()True

So my 2 seconds wait was too short. How can I stop/restart the server now ? - wait does not help there.

mws.Stop()>>> utime.sleep(10)>>> mws.IsStarted()True

— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/jczic/MicroWebSrv/issues/59?email_source=notifications&email_token=AAD2ALG537RVLW7HJQWFRD3QBQBXNA5CNFSM4IHBP4Z2YY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOD26HHFI#issuecomment-515666837, or mute the thread https://github.com/notifications/unsubscribe-auth/AAD2ALFI6JV2VSHCCYYYFWDQBQBXNANCNFSM4IHBP4ZQ .

--

Sincèrement,