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

    WiFi AP

    Scheduled Pinned Locked Moved GPy
    7 Posts 4 Posters 95 Views 4 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.
    • N Offline
      nadvorvo
      last edited by

      Hi everyone,
      I am following this tutorial:
      https://docs.pycom.io/tutorials/networks/wlan/#connecting-to-the-device
      But I can not see created AP from NTB.

      When Connecting to a Router everything alright (ftp, ssh, ping).
      https://docs.pycom.io/tutorials/networks/wlan/#connecting-to-a-router

      Thank you in advance for your assistance.
      Regards, Vojtech

      Test script:

      from network import WLAN
      wlan = WLAN(mode=WLAN.AP, ssid='hello world')
      wlan.init()
      print(wlan.ifconfig(id=1)) #id =1 signifies the AP interface
      while True:
          print("isconnected:",wlan.isconnected(), wlan.ifconfig(id=1))
      

      output:

      ('192.168.4.1', '255.255.255.0', '192.168.4.1', '0.0.0.0')
      isconnected: False ('192.168.4.1', '255.255.255.0', '192.168.4.1', '0.0.0.0')
      isconnected: False ('192.168.4.1', '255.255.255.0', '192.168.4.1', '0.0.0.0')
      

      I am getting wlan.antenna() = 2 ?

      >>> wlan.antenna()
      2
      >>> WLAN.EXT_ANT
      1
      >>> WLAN.INT_ANT
      0
      

      system version:
      (sysname='GPy', nodename='GPy', release='1.20.2.r4', version='v1.11-ffb0e1c on 2021-01-12', machine='GPy with ESP32', pybytes='1.6.1')

      robert-hhR 1 Reply Last reply Reply Quote 0
      • robert-hhR Offline
        robert-hh @nadvorvo
        last edited by

        @nadvorvo You could try to deactivate pybytes, for instance with:

        import pycom
        pycom.pybytes_on_boot(False)

        N 1 Reply Last reply Reply Quote 1
        • N Offline
          nadvorvo @robert-hh
          last edited by

          @robert-hh said in WiFi AP:

          You could try to deactivate pybytes, for instance with:
          import pycom
          pycom.pybytes_on_boot(False)

          Hi @robert-hh,
          Thank you for your reply.

          I have deactivated pybytes, but I can not see created AP from NTB.

          pycom.pybytes_on_boot()
          False
          

          Then I tried to activate wifi_on_boot

          import pycom
          from network import WLAN
          pycom.pybytes_on_boot(False) #we do not want Pybytes using the WLAN
          pycom.smart_config_on_boot(False) #we also do not want smart config
          pycom.wifi_on_boot(True)
          pycom.wifi_mode_on_boot(WLAN.AP)
          pycom.wifi_ssid_ap('ssid')
          

          I can see wifi AP now.

          Then I tried to deactivate wifi_on_boot

          pycom.wifi_on_boot(False)
          

          no wifi AP now.

          1 Reply Last reply Reply Quote 0
          • L Offline
            livius
            last edited by

            @nadvorvo said in WiFi AP:

            while True:
            print("isconnected:",wlan.isconnected(), wlan.ifconfig(id=1))

            remove this lines as they are not relevant to AP mode - and this code never ending

            think about people first, then computers

            1 Reply Last reply Reply Quote 2
            • G Offline
              Gijs
              last edited by

              @nadvorvo said in WiFi AP:

              I am getting wlan.antenna() = 2 ?

              This is WLAN.MAN_ANT, as you're not explicitly setting the antenna. MAN_ANT refers to manual antenna, and defaults to the internal antenna selected. In this mode, you can manually change P12 to reflect the antenna setting, and is used for the OEM modules, as they do not have an antenna switch.

              I looked at this for a long time, but then figured it out. There is a slight mistake in the example. If you remove the line wlan.init(), or transfer the arguments from wlan = WLAN() to wlan.init() it will work. What is happening is that wlan.init() overrides the settings in wlan = WLAN().
              I will change the example
              Sorry for the inconvenience,
              Gijs

              robert-hhR N 2 Replies Last reply Reply Quote 1
              • robert-hhR Offline
                robert-hh @Gijs
                last edited by

                @Gijs this is a common trap. The init() calls of a device have to carry all parameters that are different from the default, since it usually sets all parameters.

                1 Reply Last reply Reply Quote 1
                • N Offline
                  nadvorvo @Gijs
                  last edited by

                  @Gijs said in WiFi AP:

                  I looked at this for a long time, but then figured it out

                  Hi @Gijs
                  I really appreciate the support you’ve given me. I have testes, everything all right.
                  Regards, Vojtech

                  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