bgulla / boozer Goto Github PK
View Code? Open in Web Editor NEWKegerator Monitoring Platform. RPi + Docker + Beer + Metrics + Slack. k3s kubernetes friendly.
Home Page: https://twitter.com/ibuiltabar
License: MIT License
Kegerator Monitoring Platform. RPi + Docker + Beer + Metrics + Slack. k3s kubernetes friendly.
Home Page: https://twitter.com/ibuiltabar
License: MIT License
Hello,
There seems to be something missing to add more than 4 taps. I tried to modify the beer_db.py to add it there but I still get the following error:
2020-04-12 20:16:07,530 root INFO Tap 1: Setting capacity to 5
2020-04-12 20:16:07,537 bar_mqtt INFO mqtt topic updated: topic: bar/tap1/value | value: 100.0
2020-04-12 20:16:07,542 bar_mqtt INFO mqtt topic updated: topic: bar/tap1/beverage | value: Cidre
2020-04-12 20:16:07,544 root INFO Tap 2: Setting capacity to 5
2020-04-12 20:16:07,550 bar_mqtt INFO mqtt topic updated: topic: bar/tap2/value | value: 100.0
2020-04-12 20:16:07,556 bar_mqtt INFO mqtt topic updated: topic: bar/tap2/beverage | value: Blanche
2020-04-12 20:16:07,558 root INFO Tap 3: Setting capacity to 5
2020-04-12 20:16:07,563 bar_mqtt INFO mqtt topic updated: topic: bar/tap3/value | value: 100.0
2020-04-12 20:16:07,569 bar_mqtt INFO mqtt topic updated: topic: bar/tap3/beverage | value: Erable
2020-04-12 20:16:07,571 root INFO Tap 4: Setting capacity to 5
2020-04-12 20:16:07,577 bar_mqtt INFO mqtt topic updated: topic: bar/tap4/value | value: 99.015
2020-04-12 20:16:07,582 bar_mqtt INFO mqtt topic updated: topic: bar/tap4/beverage | value: NEIPA
2020-04-12 20:16:07,584 root INFO Tap 5: Setting capacity to 5
Traceback (most recent call last):
File "boozer.py", line 525, in
main()
File "boozer.py", line 520, in main
boozer = Boozer()
File "boozer.py", line 259, in init
self.update_mqtt(tap, beverage_name=new_tap.get_beverage_name())
File "boozer.py", line 286, in update_mqtt
percent = self.db.get_percentage100(tap_id)
File "/boozer/beer_db.py", line 61, in get_percentage100
return self.get_percentage(tap_id) * 100
File "/boozer/beer_db.py", line 50, in get_percentage
volume_expelled = self.get_tap(tap_id)
File "/boozer/beer_db.py", line 111, in get_tap
return volume
UnboundLocalError: local variable 'volume' referenced before assignment
Currently I use x86 dockers for these infrastructure platforms but I need to provide ARMH-based dockerfiles so people do not have an external dependency.
Seems like a constant loop and it recycles itself when trying to send topic
Also there is no spot for a username/password option
As of right now, boozer expects 4 taps to be present. I need to make it where it iterates the entries in the config file and dynamically builds the expected tap structure.
level of effort: low.
see title.
When trying to create the docker image, i get no such file or directory for config.ini, what am i doing wrong?
copied both config.ini and db.sqlite to /opt/boozer
ran as
sudo docker run --rm -d --name="boozer" \
--privileged \
-v /config.ini:/boozer/config.ini \
-v /db.sqlite:/boozer/db.sqlite \
-t bgulla/boozer
now when i do sudo docker ps, nothing is showing, no image for bgulla/boozer :(
How do i know what tap1 is?
Would it be possible to add a option to the config.ini to select either imperial or metric units. I'd rather have it in celcius and maybe liters for volume.
Currently, the volume poured per pint is hardcoded, have this user configurable and documented in the README
Hello,
Nice work! It would be really nice to have a configuration variable for the calibration per tap. For now I modified the number of pulses according to my flow meter but it would be nice to have it in the configuration file and per tap to support different flow meter and to calibrate them individually.
Thanks!
Fred
Hello,
I have kept (and reverted to default configuration) to 4 taps. Each pour is detected to be coming from tap 4. I know that I used the right GPIO (as now that I reverted to default configuration and files the 5 taps is not triggering the counter anymore). So there seems to be something in the flow_meter.py.
Anyone can help me?
Thanks!
Fred
2020-04-13 13:22:23,885 flowmeter INFO --- REGISTERING-FULL-POUR 0.848888888889 vs 0.075
2020-04-13 13:22:23,888 flowmeter INFO POUR this pour was 0.0 pints (thisPour=0.0 vs totalPour=0.848888888889
Record: Tap 4 Volume 9.144 Percentage: 77.14
2020-04-13 13:22:23,926 flowmeter INFO Database updated: 4 1.794.
2020-04-13 13:22:23,937 bar_mqtt INFO mqtt topic updated: topic: bar/tap4/value | value: 77.14
2020-04-13 13:22:23,945 bar_mqtt INFO mqtt topic updated: topic: bar/tap4/beverage | value: NEIPA
2020-04-13 13:22:23,948 flowmeter INFO Pour processing complete. Reseting pour of tap 4 amount to 0.0
2020-04-13 13:23:13,071 influxdb_client INFO Influx update pushed. temperature = 73.7366
2020-04-13 13:24:14,910 influxdb_client INFO Influx update pushed. temperature = 73.625
2020-04-13 13:25:16,750 influxdb_client INFO Influx update pushed. temperature = 73.625
git will currently attempt to override the database on pull.
Hello,
I have re-installed everything and still each time last tap is registering the pour. So it will always come from tap 5 as I have 5 taps.
I have modified the code as I am not good with python and objects. So it's a bit ugly but it works for 5 taps. So there's something with the GPIO.add_event_detect that refers always to the last object initialized. I tried both in the docker container and running it from the PI outside the docker container.
There is still little things with the toolkit with hardcoded number of tap to 4 but that's an easy fix.
I replaced this:
By this for 5 taps. But it's not really clean and I do not know how to fix previous function.
tap=self.taps[0]
GPIO.add_event_detect(tap.get_pin(), GPIO.RISING, callback=lambda a: self.register_tap(self.taps[0]), bouncetime=20)
tap=self.taps[1]
GPIO.add_event_detect(tap.get_pin(), GPIO.RISING, callback=lambda a: self.register_tap(self.taps[1]), bouncetime=20)
tap=self.taps[2]
GPIO.add_event_detect(tap.get_pin(), GPIO.RISING, callback=lambda a: self.register_tap(self.taps[2]), bouncetime=20)
tap=self.taps[3]
GPIO.add_event_detect(tap.get_pin(), GPIO.RISING, callback=lambda a: self.register_tap(self.taps[3]), bouncetime=20)
tap=self.taps[4]
GPIO.add_event_detect(tap.get_pin(), GPIO.RISING, callback=lambda a: self.register_tap(self.taps[4]), bouncetime=20)
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.