Skip to content

Commit d26b246

Browse files
Add files via upload
1 parent 8587d20 commit d26b246

File tree

1 file changed

+8
-3
lines changed

1 file changed

+8
-3
lines changed

solar2.py

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -94,7 +94,7 @@ def timer10s():
9494
print(">" + str(it))
9595

9696
if (it == 6*timer_interval): # 6 = 1min / 60 = 10min
97-
print("ok ---- 10 min")
97+
print("ok ------------------- 10 min")
9898
solar_adc()
9999
show_temp()
100100
it = 0
@@ -131,7 +131,7 @@ def on_press_top_button():
131131
idb = config.get("influx_db")
132132
iusr = config.get("influx_usr")
133133
ipsw = config.get("influx_psw")
134-
influx = InfluxDB(iurl, idb, iusr, ipsw)
134+
influx = InfluxDB(iurl, idb, iusr, ipsw, "solar2", place="lab")
135135
print("influx: ", iurl, idb)
136136
except Exception as e:
137137
print("config Exception: {0}".format(e))
@@ -157,17 +157,22 @@ def on_press_top_button():
157157
temp = show_temp()
158158
press = bmp.pressure
159159

160+
w()
160161
try:
161-
w()
162162
print("test influx.write: ", temp, press)
163163
influx.write("octopuslab", temperature = temp, pressure= press, solar20 = 123, solar21 = 123, solarBar = 0)
164164
except Exception as e:
165165
print("influx test Exception: {0}".format(e))
166166

167167

168+
post_url="https://parallelgarden.surikata.info:8086/write?db=octopuslab&u=octopus&p=chobotni4ky"
169+
post_data="solar,place=octopuslab,id=1 keepalive={0},solarVolt={1}"
170+
171+
168172
# rtc = RTC() # real time
169173
tim1 = Timer(0) # for main 10 sec timer
170174
timer_init()
171175

176+
172177
# --- run ---
173178
print("--- run --- RAM free: " + str(mem_free()))

0 commit comments

Comments
 (0)