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
641 stars 116 forks source link

MicroWebSrv not started when in AP mode #12

Closed Liberasys closed 6 years ago

Liberasys commented 6 years ago

Hello JC, I have a new issue maybe in side effect of loboris network status improvements. Your server code checks WLAN connection before starting. But in AP mode, the connection is not made, thus not starting the web server.

Maybe you could follow the example of lemariva in his FTP server ?


        self.wlan = network.WLAN(network.AP_IF)
        if self.wlan.active():
            ifconfig = self.wlan.ifconfig()
        else:
            self.wlan = network.WLAN(network.STA_IF)
            if self.wlan.active():
                ifconfig = self.wlan.ifconfig()
            else:
                dbg("No active connection")
jczic commented 6 years ago

​The server code don't checks WLAN connection ..? It doesn't this case in my src.​

2018-02-09 13:44 GMT+01:00 Liberasys notifications@github.com:

Hello JC, I have a new issue maybe in side effect of loboris network status improvements. Your server code checks WLAN connection before starting. But in AP mode, the connection is not made, thus not starting the web server.

Maybe you could follow the example of lemariva in his FTP server ?

    self.wlan = network.WLAN(network.AP_IF)
    if self.wlan.active():
        ifconfig = self.wlan.ifconfig()
    else:
        self.wlan = network.WLAN(network.STA_IF)
        if self.wlan.active():
            ifconfig = self.wlan.ifconfig()
        else:
            dbg("No active connection")

— 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/12, or mute the thread https://github.com/notifications/unsubscribe-auth/AAegLMyubEK1IJKZvnnGAD7a8d00wbJ1ks5tTD3IgaJpZM4R_3sn .

--

Sincèrement,

Liberasys commented 6 years ago

Ok, sorry, it is due to Boris modifications : if not self._started : if not network.WLAN().isconnected(): print("WLAN not connected!") return I will see with him. Sorry for inconvenience. Thank you JC.

jczic commented 6 years ago

Ok no souci, it's possible to check WLAN configuration and not "isconnected" :)

2018-02-12 9:56 GMT+01:00 Liberasys notifications@github.com:

Ok, sorry, it is due to Boris modifications : if not self._started : if not network.WLAN().isconnected(): print("WLAN not connected!") return I will see with him. Sorry for inconvenience. Thank you JC.

— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/jczic/MicroWebSrv/issues/12#issuecomment-364861830, or mute the thread https://github.com/notifications/unsubscribe-auth/AAegLOxy0GVsG6Gi3RjAXq88A211bUDPks5tT_zMgaJpZM4R_3sn .

--

Sincèrement,