Skip to content

Instantly share code, notes, and snippets.

@johnty
Last active January 8, 2021 08:14
Show Gist options
  • Save johnty/0eb1b105737ebe3ab6bc51081d81462c to your computer and use it in GitHub Desktop.
Save johnty/0eb1b105737ebe3ab6bc51081d81462c to your computer and use it in GitHub Desktop.
grabbing temperature (in F) from wifi thermocouple probe
import urllib.request #talks to an ESP32 running this code: https://github.com/johnty/BBQProbe/tree/main/thermocouple_esp32
contents = urllib.request.urlopen("http://192.168.1.65").read().decode() #find IP address and put it here...
f_string = contents.split("/")[2] #first / is for </head>, second / is between the C and F readings ;)
f_vals = f_string.split(); # split again based on spaces, result should be the F value string only.
print(f_vals[0])
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment