Doodle3D / doodle3d-firmware

The API of the Doodle3D WiFi box. This can for example talk to print3d, save settings, update the firmware etc.
www.doodle3d.com
GNU General Public License v2.0
13 stars 9 forks source link

Sign-in failed doesn't trigger connecting failed #38

Open peteruithoven opened 9 years ago

peteruithoven commented 9 years ago

After the WiFi-Box attempts to connect to a wifi network, and it receives a ip and ssid it attempts to signin to our connect.doodle3d.com page. (which enable us to forward users to their box.) But when this signing in fails it still says it's connected.

Bottom of the netconf associateSsid function:

    -- signin to connect.doodle3d.com
    local success, output = signin.signin()
    if success then
        log:info("Signed in")
    else 
        log:info("Signing in failed")
    end

    -- report we are connected after signin attempt
    M.setStatus(M.CONNECTED,"Connected");

    return true

This is problematic when we'd like to start a accesspoint when connecting fails (which we haven't implemented yet)

arneboon commented 9 years ago

here is the logs for a successful update from 10.5 to 10.6 with successful signin:

06-17 12:28:32 (info)     signin:setStatus: 2 | signing in
06-17 12:28:33 (debug)     signin attempt 0/20
06-17 12:28:33 (debug)     getSubstitutedSsid unformattedSsid:'Doodle3D-%%MAC_ADDR_TAIL%%' baseApSsid:'Doodle3D-%%MAC_ADDR_TAIL%%' cachedApSsid:'Doodle3D-4CC28C
06-17 12:28:33 (debug)       signin response: 
{"status":"success","data":{"remoteip":"217.149.135.12","localip":"10.0.0.167","wifiboxid":"Doodle3D-4CC28C","timestamp":1435739814}}

06-17 12:28:33 (debug)       success: "status":"success"
06-17 12:28:33 (info)     signin:setStatus: 1 | idle
06-17 12:28:33 (info)     Signed in
06-17 12:28:33 (info)     =======rest api (api debugging)=======
06-17 12:28:33 (info)     network:setStatus: 2 | Connected
06-17 12:28:33 (info)     autowifi setup done (autowifi: associated -- client mode with ssid 'Vechtclub XL F1.19')
peteruithoven commented 9 years ago

Logs after failed sign-in:

06-17 12:29:12 (warn)     signin failed request failed (response: wget: bad address 'connect.doodle3d.com')
06-17 12:29:12 (info)     signin:setStatus: 1 | idle
06-17 12:29:12 (info)     Signing in failed
06-17 12:29:12 (info)     network:setStatus: 2 | Connected
06-17 12:29:12 (info)     autowifi setup done (autowifi: associated -- client mode with ssid 'Vechtclub XL F1.19')