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

    Detecting a device's Hotspot

    Scheduled Pinned Locked Moved WiPy 2&3
    8 Posts 2 Posters 2.0k Views 2 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.
    • S Offline
      sk
      last edited by

      Re: wipy as a wifi device sensor
      Can the Sipy or Wipy detect a cellphone when its HotSpot is turned on? When I use WLAN.scan(), it doesn't appear in the list.

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

        @sk said in Detecting a device's Hotspot:

        detect

        what if you manually write ssid of hotspot wfif?
        can you connect? If yes than it is strange that you do not see it on the list..

        think about people first, then computers

        S 1 Reply Last reply Reply Quote 0
        • S Offline
          sk @livius
          last edited by

          @livius How do I do that? My current program is like this:

          import machine
          from network import WLAN
          import pycom
          import time
          
          #WLAN test
          #Doc = https://goo.gl/hHOcbV
          
          #configure the WLAN subsystem in station mode (the default is AP)
          wlan = WLAN(mode=WLAN.STA)      #Setup WLAN as a STAtion
          
          while (True):
          # scan for available networks, returns a tuple of scanned networks
              tup = wlan.scan()     
              for i in range(len(tup)):       #For all scanned networks
                  for j in range (4):
                      print(tup[i:j])     #Print networks ssid, bssid, sec, channel, rssi
              time.sleep_ms(2000)
              print("RESCAN")
          
          L 1 Reply Last reply Reply Quote 0
          • L Offline
            livius @sk
            last edited by

            @sk

            import machine
            from network import WLAN
            
            # configure the WLAN subsystem in station mode (the default is AP)
            wlan = WLAN(mode=WLAN.STA)
            # go for fixed IP settings (IP, Subnet, Gateway, DNS)
            wlan.ifconfig(config=('192.168.0.107', '255.255.255.0', '192.168.0.1', '192.168.0.1'))
            wlan.scan()     # scan for available networks
            wlan.connect(ssid='mynetwork', auth=(WLAN.WPA2, 'my_network_key'))
            while not wlan.isconnected():
                pass
            print(wlan.ifconfig())
            

            think about people first, then computers

            S 1 Reply Last reply Reply Quote 0
            • S Offline
              sk @livius
              last edited by

              @livius No it can't connect to the hotspot, even if i write the SSID and key.

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

                @sk
                Did you use a static IP or DHCP when you try?
                And what is your firmware version?
                Current is 1.6.3

                think about people first, then computers

                S 1 Reply Last reply Reply Quote 0
                • S Offline
                  sk @livius
                  last edited by

                  @livius
                  I used static at first when configuring with wlan.ifconfig(...) and it only picked up the general wifi from my router, NOT the hotspot.
                  I then commented out the ifconfig() but even then it only picked up the general wifi.

                  I reinstalled Pymkr and updated my Sipy last wednesday, so it should all be up to date.

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

                    @sk said in Detecting a device's Hotspot:

                    updated my Sipy last wednesday, so it should all be up to date.

                    check version by calling

                    os.uname()
                    

                    think about people first, then computers

                    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