Advertisement
Pentavus

boot.py

Sep 26th, 2019
325
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. import urequests
  2. import network
  3.  
  4. ssid = "XXXXX"
  5. password = "XXXXXXX"
  6.  
  7. station = network.WLAN(network.STA_IF)
  8.  
  9. station.active(True)
  10. station.connect(ssid, password)
  11.  
  12. while station.isconnected() == False:
  13.   pass
  14.  
  15. print('Connection successful')
  16. print(station.ifconfig())
  17.  
  18. response = urequests.get("http://localhost:8090/esp32/save_data_GET.php?sensor1=6")
  19. print('>>>> Request response:')
  20. print(request.text)
  21. response.close()
Advertisement
RAW Paste Data Copied
Advertisement