Detecting a device's Hotspot



  • 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.



  • @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()
    


  • @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.



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



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



  • @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())
    


  • @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")


  • @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..


Log in to reply
 

Pycom on Twitter