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.

ESP32 1.19.5 Wifi Issue

Hello,

I am having an issue connecting to wifi networks after I update to the latest 1.19.5 firmware. I was previously using verions 1.18. Below you can see an example of the issue.

➜  ~ mos flash mos-esp32-1.18
Fetching https://mongoose-os.com/downloads/mos-esp32-1.18.zip...
Loaded default/esp32 version 1.0 (20171001-162208/1.18@4bbec4b4)
Using port /dev/ttyUSB0
Opening /dev/ttyUSB0 @ 115200...
Connecting to ESP32 ROM, attempt 1 of 10...
Connecting to ESP32 ROM, attempt 2 of 10...
Connecting to ESP32 ROM, attempt 3 of 10...
  Connected
Running flasher @ 460800...
  Flasher is running
Flash size: 4194304, params: 0x0220 (dio,32m,40m)
Deduping...
    18224 @ 0x1000 -> 0
     3072 @ 0x8000 -> 0
    16384 @ 0x9000 -> 8192
  1327056 @ 0x10000 -> 0
   262144 @ 0x190000 -> 0
Writing...
     8192 @ 0x9000
     8192 @ 0xd000
Wrote 16384 bytes in 0.20 seconds (627.91 KBit/sec)
Verifying...
    18224 @ 0x1000
     3072 @ 0x8000
    16384 @ 0x9000
     8192 @ 0xd000
  1327056 @ 0x10000
   262144 @ 0x190000
Booting firmware...
All done!
➜  ~ mos call Wifi.Scan
Using port /dev/ttyUSB0
{
  "results": [
    {
      "ssid": "ATT37wlb6Q",
      "auth": 3,
      "channel": 1,
      "rssi": -63
    },
    {
      "ssid": "The Factory Fiber",
      "auth": 4,
      "channel": 1,
      "rssi": -65
    },
    {
      "ssid": "Factory Friends",
      "auth": 4,
      "channel": 1,
      "rssi": -65
    },
    {
      "ssid": "Tria Guest",
      "auth": 4,
      "channel": 11,
      "rssi": -68
    },
    {
      "ssid": "The Factory Fiber",
      "auth": 4,
      "channel": 11,
      "rssi": -70
    },
    {
      "ssid": "Factory Friends",
      "auth": 4,
      "channel": 11,
      "rssi": -70
    },
    {
      "ssid": "Tria GR",
      "auth": 4,
      "channel": 11,
      "rssi": -72
    },
    {
      "ssid": "ZOOM",
      "auth": 4,
      "channel": 1,
      "rssi": -78
    },
    {
      "ssid": "SmarterServices",
      "auth": 4,
      "channel": 1,
      "rssi": -79
    },
    {
      "ssid": "BrushStudio",
      "auth": 4,
      "channel": 6,
      "rssi": -80
    },
    {
      "ssid": "CodeGreen",
      "auth": 4,
      "channel": 11,
      "rssi": -80
    },
    {
      "ssid": "Trifound-2.4",
      "auth": 4,
      "channel": 11,
      "rssi": -81
    },
    {
      "ssid": "XFINITY",
      "auth": 5,
      "channel": 6,
      "rssi": -83
    },
    {
      "ssid": "xfinitywifi",
      "auth": 0,
      "channel": 6,
      "rssi": -83
    },
    {
      "ssid": "CodeGreen",
      "auth": 4,
      "channel": 1,
      "rssi": -84
    },
    {
      "ssid": "HOME-A5F2",
      "auth": 3,
      "channel": 6,
      "rssi": -84
    },
    {
      "ssid": "BeerBall489",
      "auth": 3,
      "channel": 6,
      "rssi": -85
    },
    {
      "ssid": "GRPublic",
      "auth": 0,
      "channel": 11,
      "rssi": -85
    },
    {
      "ssid": "CityOfGrapids",
      "auth": 5,
      "channel": 11,
      "rssi": -85
    },
    {
      "ssid": "GRDevices",
      "auth": 3,
      "channel": 11,
      "rssi": -85
    },
    {
      "ssid": "GranR-MSFT-MEM",
      "auth": 4,
      "channel": 1,
      "rssi": -86
    },
    {
      "ssid": "2ndFloorAP",
      "auth": 3,
      "channel": 6,
      "rssi": -86
    },
    {
      "ssid": "GRVendor",
      "auth": 3,
      "channel": 11,
      "rssi": -86
    },
    {
      "ssid": "iHeartGuest",
      "auth": 3,
      "channel": 6,
      "rssi": -89
    },
    {
      "ssid": "AMDG",
      "auth": 5,
      "channel": 6,
      "rssi": -89
    },
    {
      "ssid": "XFINITY",
      "auth": 5,
      "channel": 6,
      "rssi": -89
    },
    {
      "ssid": "xfinitywifi",
      "auth": 0,
      "channel": 11,
      "rssi": -90
    },
    {
      "ssid": "management616",
      "auth": 3,
      "channel": 6,
      "rssi": -94
    }
  ]
}
➜  ~ mos flash mos-esp32-1.19.5
Fetching https://mongoose-os.com/downloads/mos-esp32-1.19.5.zip...
Loaded default/esp32 version 1.0 (20171101-110218/1.19.5@92a0b527)
Using port /dev/ttyUSB0
Opening /dev/ttyUSB0 @ 115200...
Connecting to ESP32 ROM, attempt 1 of 10...
Connecting to ESP32 ROM, attempt 2 of 10...
  Connected
Running flasher @ 460800...
  Flasher is running
Flash size: 4194304, params: 0x0220 (dio,32m,40m)
Deduping...
     3072 @ 0x8000 -> 0
    16384 @ 0x9000 -> 8192
   262144 @ 0x190000 -> 110592
Writing...
    20480 @ 0x1000
     8192 @ 0x9000
     8192 @ 0xd000
  1384448 @ 0x10000
   110592 @ 0x190000
Wrote 1529408 bytes in 26.48 seconds (451.29 KBit/sec)
Verifying...
    18752 @ 0x1000
     3072 @ 0x8000
    16384 @ 0x9000
     8192 @ 0xd000
  1383680 @ 0x10000
   262144 @ 0x190000
Booting firmware...
All done!
➜  ~ mos call Wifi.Scan        
Using port /dev/ttyUSB0
{
  "results": [
    {
      "ssid": "xfinitywifi",
      "auth": 0,
      "channel": 6,
      "rssi": -82
    },
    {
      "ssid": "XFINITY",
      "auth": 5,
      "channel": 6,
      "rssi": -84
    },
    {
      "ssid": "BrushStudio",
      "auth": 4,
      "channel": 6,
      "rssi": -85
    },
    {
      "ssid": "iHeart",
      "auth": 5,
      "channel": 6,
      "rssi": -87
    },
    {
      "ssid": "xfinitywifi",
      "auth": 0,
      "channel": 6,
      "rssi": -87
    },
    {
      "ssid": "BeerBall489",
      "auth": 3,
      "channel": 6,
      "rssi": -88
    },
    {
      "ssid": "iHeartGuest",
      "auth": 3,
      "channel": 6,
      "rssi": -88
    },
    {
      "ssid": "HOME-A5F2",
      "auth": 3,
      "channel": 6,
      "rssi": -89
    },
    {
      "ssid": "xfinitywifi",
      "auth": 0,
      "channel": 6,
      "rssi": -91
    }
  ]
}

As you can see there are significantly less access points detected in the newer version of the firmware. It does look like it is only picking up on access points that are using Channel 6, and only the ones that have very poor signal. I'm not sure if these are indicators of the problem, or just coincidences.
I have tried connecting to the SSID I need to be able to connect to, and it only works with the 1.18 firmware. When I try with the 1.19.5 version it keeps attempting to connect, and then disconnects with a 201 reason.
Is anyone else seeing this issue?

-siftd106

Comments

  • rojerrojer Dublin, Ireland

    this is interesting. between 1.18 and 1.19 there was an SDK update, which included changes to wifi libs.
    channel 6 is the default channel we use for AP, so that may have something to do with that. i'll take a look.

  • siftd106siftd106 United States

    Thanks for looking in to this @rojer. Let me know if you need any additional information.

  • rojerrojer Dublin, Ireland
    edited November 2017

    it looks like this was a regression in ESP-IDF. i was going to report it, but i tried with latest master and seems to be back to normal. there are a few changes that need to be addressed before we can update our build image, but you can expect that to happen soon.
    in other words, this should be fixed in 1.20 and come to -latest build in the next few days.

  • siftd106siftd106 United States

    That's great news. Thanks!

  • rojerrojer Dublin, Ireland

    this is still in progress - i need to get an IDF change in, because otherwise some projects cease to work. once this is merged, i'll push a new build image that include new wifi libs.

  • rojerrojer Dublin, Ireland

    a new image with an updated SDK has been pushed.

  • I may be observing a related issue. I have a simple project from about June (I think) which is a simple demonstration of C based RPC.
    All it does is send a command to toggle an LED connected to a GPIO of an ESP32. This worked great.
    So I return to it and try to resurrect it. I think I am doing all correctly, but of course a mistake on my part is still possible.
    I can get the command line invocation of RPC.List and it works and shows my RPC handler listed.
    Calling the RPC handler at the command line (I'm using Ubuntu Linux) works perfectly:

    mos --port /dev/ttyUSB0 call ledtoggle '{"state":1, "led": 17}'

    That turns the LED on, and then again with state 0 turns it off.
    Now I'm more interested in using Websocket, so the command line is:

    mos --port ws://192.168.1.12/rpc call ledtoggle '{"state":1, "led": 17}'

    where I used mos console to check that the ESP32 is connected to my router and the IP address is correct.
    My router confirms solid connection to ESPRESSIF device.

    What I get back when attempting to use Websocket/RPC:

    E1117 07:44:51.378713    4359 reconnect_wrapper.go:93] [reconnectWrapperCodec to ws://192.168.1.12/rpc; connect in 2.00s] connection error: net.DialTCP: dial tcp 192.168.1.12:80: getsockopt: connection refused
    dial tcp 192.168.1.12:80: getsockopt: connection refused
    /build/mos-iKanOg/mos-1.20+cf08387~xenial0/obj-x86_64-linux-gnu/src/cesanta.com/common/go/mgrpc/mgrpc.go:140: net.DialTCP
    /build/mos-iKanOg/mos-1.20+cf08387~xenial0/obj-x86_64-linux-gnu/src/cesanta.com/common/go/mgrpc/mgrpc.go:173: 
    /build/mos-iKanOg/mos-1.20+cf08387~xenial0/obj-x86_64-linux-gnu/src/cesanta.com/common/go/mgrpc/mgrpc.go:219:

    The above repeats several times and ends with

    Error: context deadline exceeded

    I installed mos 1.20 and re-built the project with it, starting with a fresh

    mos init --platform=esp32

    And copied my code into the new main.c. It looks like mos.yml did not require anything more than the default.
    I note when building this morning, that mos 1.20.1 is available (a note at conclusion of build).
    I updated mos to 1.20.1 and re-built, still observing the same behavior.

    Any suggestions?

    Regards,
    Greg

  • rojerrojer Dublin, Ireland

    no, this must be different. it seems that you don't have http server in your firmware, or at least it's not enabled. since june, a lot of functionality has been mover to libraries, so you need to add https://github.com/mongoose-os-libs/http-server explicitly

  • Thanks Rojer, that resolved the issue.

    That has been a source of confusion, what exactly you need to have to get certain functionality.
    Also, when you include a library, do you also need a #include in the source file, or not?
    It seems the trend is to not requiring a #include.

    I note the wifi library is now included by default in mos.yml. I don't think that was true in the past.

    Thank you for the very quick response, had just enough time to check it before running off to work.

    Regards,
    Greg

Sign In or Register to comment.