Copyright © https://mongoose-os.com

Mongoose OS Forum

frame
ATTENTION! This forum has moved to:

https://community.mongoose-os.com

Do not post any new messages.

Cannot connect to my Wi-Fi

BetterAutomationsBetterAutomations Jacksonville, FL
edited January 2017 in Mongoose OS

Both of my NodeMCU 0.9 do this. Both are successfully connecting using ESP8266 Arduino code. I'm using the Wi-Fi on my laptop to type this message. So I'm not sure what's up.

My SSID has an exclamation point in it, so I encapsulated the string in single quotes on the Cygwin command line; however when I change it to a nonexistent SSID I get a different error message, so I know the boards are connecting to the right SSID.

`Christopher@HP6005 /cygdrive/e/Mongoose_IOT
$ mos config-set wifi.ap.enable=false wifi.sta.enable=true wifi.sta.ssid='XXXXXXX!XXXXX' wifi.sta.pass='XXXXXXXXXXXXXXXXXXX'
Getting configuration...
Setting new configuration...
Saving and rebooting...

Christopher@HP6005 /cygdrive/e/Mongoose_IOT
$ mos console
state: 0 -> 2 (b0)
state: 2 -> 3 (0)
state: 3 -> 5 (10)
add 0
aid 4
cnt
state: 5 -> 2 (fc0)
rm 0
mgos_wifi_on_change_cb Wifi: disconnected
reconnect
state: 2 -> 0 (0)
scandone
state: 0 -> 2 (b0)
state: 2 -> 3 (0)
state: 3 -> 5 (10)
add 0
aid 4
cnt
state: 5 -> 2 (fc0)
rm 0
mgos_wifi_on_change_cb Wifi: disconnected
reconnect
state: 2 -> 0 (0)
scandone
state: 0 -> 2 (b0)
state: 2 -> 3 (0)
state: 3 -> 5 (10)
add 0
aid 4
cnt

Christopher@HP6005 /cygdrive/e/Mongoose_IOT
$ mos config-set wifi.ap.enable=false wifi.sta.enable=true wifi.sta.ssid='WRONG_SSID' wifi.sta.pass='XXXXXXXX'
Getting configuration...
Setting new configuration...
Saving and rebooting...

Christopher@HP6005 /cygdrive/e/Mongoose_IOT
$ mos console
scandone
no WRONG_SSID found, reconnect after 1s
mgos_wifi_on_change_cb Wifi: disconnected
reconnect
scandone
no WRONG_SSID found, reconnect after 1s
mgos_wifi_on_change_cb Wifi: disconnected
reconnect
scandone
no WRONG_SSID found, reconnect after 1s
mgos_wifi_on_change_cb Wifi: disconnected
reconnect

Christopher@HP6005 /cygdrive/e/Mongoose_IOT`

Comments

  • rojerrojer Dublin, Ireland

    you seem to be doing everything right. however, i just tried connecting to a network with password that has an exclamation mark and it works for me.

    my suspicion is quoting by cygwin.
    can you run mos get conf.json to see what password actually ends up being used? i suspect it might have quotes there (other than json quotes, that is).

  • BetterAutomationsBetterAutomations Jacksonville, FL
    edited January 2017

    Ok that was very helpful thank you. The problem is not the SSID but the password. I have an ampersand in my password but it converts it to \u0026. Escaping it turns it into \\\u0026. Thoughts?

  • BetterAutomationsBetterAutomations Jacksonville, FL

    Ok I was able to do the following to fix. How can I submit a bug report for this? Potentially critical problem for me, as I won't be able to predict what password my customers use.

    $ mos get conf.json > conf.json
    $ vi conf.json # Changed the \u0026 to &
    $ mos put conf.json
    Unplugged/re-plugged the device

  • rojerrojer Dublin, Ireland

    ok, so there are two problems here: (1) is that our JSON parser does not handle unicode escape sequences and (2) the JSON serializer used by Go escapes the ampersand, which is not necessary. it is actually documented, but i wasn't aware of it. (2) is easier to fix, so i'll start with that. thanks for reporting!

  • BetterAutomationsBetterAutomations Jacksonville, FL

    Wowsers, you rock. How can I track the status of this bug?

  • rojerrojer Dublin, Ireland

    fix for (2) has been committed, pending push of mos tool.
    i'm not sure about timeline for (1).

  • BetterAutomationsBetterAutomations Jacksonville, FL

    Is it essentially, for my purposes, resolved then with the push?

  • rojerrojer Dublin, Ireland

    yes, once new mos tool is pushed (probably tomorrow), your problem will be fixed.

  • BetterAutomationsBetterAutomations Jacksonville, FL

    You rock. I'll try to remember to let you know how it's working.

  • rojerrojer Dublin, Ireland

    new mos tool has been pushed, should work for you now.

  • BetterAutomationsBetterAutomations Jacksonville, FL

    Works beautifully.

Sign In or Register to comment.