a quick update. I was trying to do this all in the arduino, but it seems it's really not up to the task of slurping in all of the metrics, parsing for the right data and then spitting out the right bit.. So... I decided to write a python script to do that part and output to a file, then will have the arduino connect and FTP the files to get the data and then display it. Should be way easier on the ardiuno side that way. Then it's a matter of finding a case and figuring out how I want to power it long term.. Fun stuff!!
On the positive side, this will make the gadget portable. Will not be tied to the tank. Just will need to plug it in somewhere and instant stats!
so far, this is the python code.
import requests
URL = "
http://10.167.15.10/x/metrics"
tankTemp = "tank_temp_reading"
sumpTemp = "sump_temp_reading"
boxTemp = "box_temp_reading"
def listToString(s):
#initialize an empty string
string = " "
#return string
return (string.join(s))
def getTemp(t):
from urllib.request import urlopen
response = urlopen(URL)
html = response.read()
html = html.decode()
text = html.split('\n') # split everything into lines.
for line in text:
if not line.startswith(t) :
# do nothing
pass
else :
text = line.split(' ') # split everything into lines.
text.pop(0)
temp = (listToString(text))
return temp
print(getTemp(tankTemp))
print(getTemp(sumpTemp))
print(getTemp(boxTemp))