rastabrew

git clone https://git.tarina.org/rastabrew
Log | Files | Refs | README

commit 19c06cf061c044f7f058fe2f25c0f44a877d4423
parent 63952699f0b4684299064399a8b9d7274cc4de26
Author: rob <rob@tarina.org>
Date:   Sun, 28 Aug 2022 13:36:31 +0300

tryying to figure out this db things

Diffstat:
AREADME.md | 7+++++++
Abrew1 | 0
Abrew2 | 0
Mride_on.py | 12++++++------
4 files changed, 13 insertions(+), 6 deletions(-)

diff --git a/README.md b/README.md @@ -0,0 +1,7 @@ +# Rastabrew + +### How to build givarna.c +## setup pin in givarna.c +gcc -Wall -o brew1 givarna.c -lwiringPi +## setup pin in givarna.c +gcc -Wall -o brew2 givarna.c -lwiringPi diff --git a/brew1 b/brew1 Binary files differ. diff --git a/brew2 b/brew2 Binary files differ. diff --git a/ride_on.py b/ride_on.py @@ -71,12 +71,12 @@ def send_offline_data(tablename): od = db.select(tablename, what='id,tid,pir,humidity,temp1,temp2,brew1,brew2,brew1_name,brew2_name') for i in od: print(i) - #try: - db2.insert(tablename, tid=i.tid, pir=bool(i.pir), humidity=i.humidity, temp1=i.temp1, temp2=i.temp2, brew1=i.brew1, brew2=i.brew2, brew1_name=i.brew1_name, brew2_name=i.brew2_name ) - db.query("delete from "+tablename+" where id="+str(i.id)+";") - #except: - # print('shit! not offline again!') - # return + try: + db2.insert(tablename, tid=i.tid, pir=bool(i.pir), humidity=i.humidity, temp1=i.temp1, temp2=i.temp2, brew1=i.brew1, brew2=i.brew2, brew1_name=i.brew1_name, brew2_name=i.brew2_name ) + db.query("delete from "+tablename+" where id="+str(i.id)+";") + except: + print('shit! not offline again!') + return GPIO.setmode(GPIO.BCM) GPIO.setup(17, GPIO.OUT) #LAMP RELAY