LoPy use WIFI to communicate with Computer



  • Hello
    i am a beginner of LoPy, i am now trying do to a project that use LoPy connect to the same WiFi as my computer.
    i want to achieve that both device using TCP/IP or any other
    methon to communicate, when my LoPy receive any message from my computer, i can send it using LoRa to another LoPy.
    Any source code i can using to try out
    Thanks for help and reply!!



  • @stroggo thanks, i am able to connect my LoPy with the WiFi, i am thinking how to make it communicate with my computer in the same WiFi environment.



  • I cannot supply a complete solution to you, but I just started tinkering around with with wifi on the LoPy the other night. I'm learning one step at a time and this is what I learned so far.

    SSID = 'yourwifiSSID'
    AUTH = 'yourWPA2password'
    wlan = WLAN(mode=WLAN.STA) #Set wlan mode to station
    wlan.mode() #Check what mode is running on wlan.
    nets = wlan.scan() # Scan for networks and list them in
    print(nets) #Print available networks

    wlan.connect(SSID, auth=(WLAN.WPA2, AUTH), timeout=5000) #Connect
    if (wlan.isconnected()): #Returns true
    print("Connected to wifi")



Pycom on Twitter