Skip to content
This repository was archived by the owner on Sep 6, 2023. It is now read-only.
This repository was archived by the owner on Sep 6, 2023. It is now read-only.

Connecting to AP that is "out-of-range"  #231

Open

Description

@PikWay

Hi
When I'm trying to connect to AP that is currently out-of-range ESP starts to spin trying to connect (with error: No AP found). Only way to stop it is reboot (until you don't have this in boot.py).
I've made workaround in my code, but can someone check is this expected behavior? Maybe n-attempts and then throw some exception?

Activity

  1. nickzoic commented on Nov 29, 2017

    @nickzoic
    Collaborator
  2. PikWay commented on Nov 29, 2017

    @PikWay
    Author

    Code is just like yours:
    import time,network
    def connectWLAN():
    sta=network.WLAN(network.STA_IF)
    sta.connect('foo','bar')
    while not sta.isconnected():
    time.sleep(1)
    print(sta.ifconfig())

    and after executing connectWLAN() it starts to write to serial console:
    I (118715) wifi: STA_DISCONNECTED, reason:201
    no AP found
    I (121545) wifi: STA_DISCONNECTED, reason:201
    no AP found
    I (124375) wifi: STA_DISCONNECTED, reason:201
    no AP found
    I (127205) wifi: STA_DISCONNECTED, reason:201
    no AP found

    Keyboart interrupt doesnt affect this, because it's trying to connect somewhere in background, meanwhile you cannot issue any commands in console (and sometimes ampy also doesn't work). I think it's related to #165 - I'll check that.

  3. PikWay commented on Nov 29, 2017

    @PikWay
    Author

    Checked dpgeorge fix, but seems like except to logger it prints "no AP found"

    sta.connect('foo','bar')
    no AP found
    no AP found
    no AP found
    no AP found

    no AP found

    no AP found
    no AP found
    no AP found
    no AP found

    no AP found
    no AP found
    no AP found
    no AP found
    no AP found
    no AP found
    no AP found
    no AP found

  4. robert-hh commented on Nov 29, 2017

    @robert-hh
    Contributor

    Don't know if that helps, but you can stop those connect attempts and the related messages with disconnect(), e.g. after your timeout, and try maybe later.

  5. PikWay commented on Nov 29, 2017

    @PikWay
    Author

    I've already made workaround. First scan, then check is essid I want to connect in list and if yes - connect.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions