Connects to WIFI

def _wifi_connect():
    """Connects to WIFI"""
    if not wlan.isconnected():
        wlan.active(True)
        print("NETWORK: connecting to network %s..." % settings.WIFI_SSID)
        wlan.connect(settings.WIFI_SSID, secret)
        while not wlan.isconnected():
            print("NETWORK: waiting for connection...")
            utime.sleep(1)
        print("NETWORK: Connected, network config: %s" % repr(wlan.ifconfig()))