Advertisement
Guest User

Untitled

a guest
Apr 21st, 2018
178
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.49 KB | None | 0 0
  1. def connectupwifi():
  2.     print('starting to connect to WiFi')
  3.     pycom.rgbled(0x800080)
  4.     wlan = WLAN(mode=WLAN.STA)
  5.     nets = wlan.scan()
  6.     for net in nets:
  7.         if net.ssid == 'Verizon-MiFi7730L-B9B9':
  8.             print('Network found!')
  9.             wlan.connect(net.ssid, auth=(net.sec, 'Pass'), timeout=5000)
  10.             while not wlan.isconnected():
  11.                 time.sleep(1)
  12.             print('WLAN connection succeeded!')
  13.         pass
  14.     pycom.rgbled(0x007f00)
  15.     main()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement