Welcome to the Pycom forum Forum
    • \[\[global:header.categories\]\]
    • \[\[global:header.recent\]\]
    • \[\[global:header.tags\]\]
    • \[\[global:header.popular\]\]
    • Login

    Explore Pybytes | Official Documentation | Report a Firmware Bug/Issue | GitHub

    Crash on calling WLAN API?

    Scheduled Pinned Locked Moved WiPy 2&3
    3 Posts 2 Posters 1.3k Views 3 Watching
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • P Offline
      Pete
      last edited by

      Ok, next problem :-)

      I haven't modified boot.py or main.py, but I wanted to get familiar with the WLAN API via the REPL.

      The docs say that:

      The WLAN constructor is special in the sense that if no arguments besides the id are given, it will return the already existing WLAN instance without re-configuring it.

      Great - let's call that and see what's currently configured:

      losed by foreign host.
      [pete@Panorama:~]$ telnet 192.168.4.1
      Trying 192.168.4.1...
      Connected to 192.168.4.1.
      Escape character is '^]'.
      MicroPython v1.8.6-422-g516b861 on 2017-02-07; WiPy with ESP32
      Login as: micro
      Password: 
      Login succeeded!
      Type "help()" for more information.
      
      >>> from network import WLAN
      >>> wlan = WLAN(id=1)
      Traceback (most recent call last):
        File "<stdin>", line 1, in <module>
      OSError: resource not available
      

      Hmm, ok. The docs say that:

      When id is 0, the configuration will be get/set on the Station interface. When id is 1 the configuration will be done for the AP interface.

      and I'm connected to the WiPy as an access point, so it ought to be id=1. But let's go ahead and try id=0 and see what happens:

      >>> wlan = WLAN(id=0)
      Connection closed by foreign host.
      [pete@Panorama:~]$ telnet 192.168.4.1
      Trying 192.168.4.1...
      telnet: connect to address 192.168.4.1: Operation timed out
      telnet: Unable to connect to remote host
      [pete@Panorama:~]$ 
      

      I get kicked out of the REPL (which I could understand if it's changing the wifi config, though I didn't actually ask for a change in this case) - and more significantly I can't log back in without a power-cycle.

      Is this just happening because I'm trying to do it interactively using the telnet REPL, and modifying boot.py would work, or is the WLAN API generally flakey?

      Firmware 1.5.1.b1 flashed today.

      Pete

      P 1 Reply Last reply Reply Quote 0
      • R Offline
        rskoniec
        last edited by

        This post is deleted!
        1 Reply Last reply Reply Quote 0
        • P Offline
          Pete @Pete
          last edited by

          Bump - anyone else seen this, or something similar?

          Pete

          1 Reply Last reply Reply Quote 0

          Hello! It looks like you're interested in this conversation, but you don't have an account yet.

          Getting fed up of having to scroll through the same posts each visit? When you register for an account, you'll always come back to exactly where you were before, and choose to be notified of new replies (either via email, or push notification). You'll also be able to save bookmarks and upvote posts to show your appreciation to other community members.

          With your input, this post could be even better 💗

          Register Login
          • 1 / 1
          • First post
            Last post

          Pycom on Twitter

          Pycom