Any way to know the name of the SSID and other info with wifisetup?



  • Hello, as the title of this thread says, I need to perform specific actions depending of the SSID name. Any help with wifisetup? Thanks a lot!


  • M5Stack

    @f3rn4nd0d You can get connecting SSID name and PSK on Arduino.

    #include <WiFi.h>
    
    WiFi.SSID()
    WiFi.psk()


  • @salty_good thanks, but I'm developing a little client in python that will connect to several wifi networks. The idea is to publish a different message via MQTT depending of the wifi it has connected to. I need to do it in python, maybe I can import a different library that gives me more options than wifisetup.

    F.



  • @f3rn4nd0d I'm looking at something similar but using RSSI.
    For micropython I have been visiting the micropython forum.
    link text


  • M5Stack

    Hi @f3rn4nd0d there is a wifi scanner script that comes with the uiflow firmware, heres the python code in that file, hope it helps.

    from m5stack import *
    import network
    import utime as time 
    
    lcd.clear()
    
    sta = network.WLAN(network.STA_IF)
    sta.active(True)
    
    while True:
        lcd.clear()
        lcd.setCursor(0, 0)
        lcd.print('wifi scan:')
        wifi_list = sta.scan()
    
        number = 1
        for i in wifi_list:
            lcd.print(i[0].decode(), 20, number*13)
            number += 1
    
        time.sleep(10)

Log in to reply
 

Looks like your connection to M5Stack Community was lost, please wait while we try to reconnect.