Guest User

Untitled

a guest
Dec 10th, 2018
124
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.68 KB | None | 0 0
  1. """
  2. Setup development environment
  3. """
  4.  
  5. import time
  6. import network
  7. import machine
  8. import gc
  9.  
  10. try:
  11. import appconfig
  12. except:
  13. class AppConfig(object):
  14. def __init__(self, ssid:str, password:str) -> None:
  15. self.wifi_ssid = ssid
  16. self.wifi_password = password
  17. ssid = input('Input Wi-Fi SSID: ')
  18. password = input('Input Wi-Fi password: ')
  19. appconfig = AppConfig(ssid, password)
  20.  
  21. # Start Wi-Fi
  22. w = network.WLAN()
  23. w.active(True)
  24. w.connect(appconfig.wifi_ssid, appconfig.wifi_password)
  25. while not w.isconnected():
  26. time.sleep(1)
  27. print(w.ifconfig())
  28.  
  29. # Start FTP server to upload source codes.
  30. network.ftp.start(user='esp32', password='esp32')
  31. gc.collect()
Add Comment
Please, Sign In to add comment