kegbot / kegberry Goto Github PK
View Code? Open in Web Editor NEWKegbot on Raspberry Pi.
Home Page: https://kegberry.com
License: MIT License
Kegbot on Raspberry Pi.
Home Page: https://kegberry.com
License: MIT License
I purchased the single tap Kegbot kit and used a raspberry pi to host the server. I have tried building it from scratch (doing every step manually) and by using the Wheezy Raspbian image from kegberry.com. Both times I was able to host the server successfully, but the Kegboard would never register as a controller. All the lights come on and the flow meter appears to work correctly according to the board, however, it will not communicate with my pi which it is directly plugged into via USB. Any ideas?
I did a fresh install of Raspbian, and afterwards used used the install script to install Kegberry. I did not watch the install so I do not know if there were any errors during the install.
After the install was finished I setup the Kegbot Server, but it looks like there are issues getting data from the kegboard to the web server. I did some checking in the logs and the kegboard_daemon is receiving temperature and flow data from the kegboard.
The kegbot_core keeps throwing the following error:
ERROR (watchdog-thread) Thread eventhub-thread died unexpectedly
At the top of the kegbot_core log file are 2 exceptions:
2014-03-12 11:54:42,694 ERROR (net-thread) Uncaught exception in thread net-thread. Stack trace:
2014-03-12 11:54:42,737 ERROR (net-thread) File "/usr/local/lib/python2.7/dist-packages/kegbot/util/util.py", line 109, in run
2014-03-12 11:54:42,830 ERROR (net-thread) self.ThreadMain()
2014-03-12 11:54:42,835 ERROR (net-thread)
2014-03-12 11:54:42,915 ERROR (net-thread) File "/usr/local/lib/python2.7/dist-packages/kegbot/pycore/kb_threads.py", line 95, in ThreadMain
2014-03-12 11:54:42,924 ERROR (net-thread) c.Listen()
2014-03-12 11:54:42,955 ERROR (net-thread)
2014-03-12 11:54:42,975 ERROR (net-thread) File "/usr/local/lib/python2.7/dist-packages/kegbot/pycore/kegnet.py", line 114, in Listen
2014-03-12 11:54:42,976 ERROR (net-thread) self.onConnectionError(e)
2014-03-12 11:54:42,978 ERROR (net-thread)
2014-03-12 11:54:42,979 ERROR (net-thread) File "/usr/local/lib/python2.7/dist-packages/kegbot/pycore/kegnet.py", line 118, in onConnectionError
2014-03-12 11:54:42,981 ERROR (net-thread) self._logger.warning('Connection error: %s' % e)
2014-03-12 11:54:42,983 ERROR (net-thread)
2014-03-12 11:54:43,086 ERROR (net-thread) Error was: <type 'exceptions.NameError'>: global name 'e' is not defined
2014-03-12 11:54:43,088 ERROR (net-thread) Exiting thread.
2014-03-12 11:54:43,279 INFO (requests.packages.urllib3.connectionpool) Starting new HTTP connection (1): localhost
2014-03-12 11:54:43,335 ERROR (watchdog-thread) Thread net-thread died unexpectedly
2014-03-12 11:54:43,395 ERROR (TapManager) Kegbot backend was unreachable due to socket error: HTTPConnectionPool(host='localhost', port=80): Max retries exceeded with url: /api/taps (Caused by <class 'socket.error'>: [Errno 97] Address family not supported by protocol)
2014-03-12 11:54:43,397 ERROR (TapManager) Could not sync taps. Is --api_url correct? (current=http://localhost/api/)
2014-03-12 11:54:43,399 INFO (eventhub-thread) got quit event, quitting
2014-03-12 11:54:43,401 INFO (net-thread) got quit event, quitting
2014-03-12 11:54:43,402 INFO (heartbeat-thread) got quit event, quitting
2014-03-12 11:54:43,445 INFO (watchdog-thread) got quit event, quitting
2014-03-12 11:54:43,852 ERROR (main) Watchdog thread exited, quitting
2014-03-12 11:55:42,333 INFO (requests.packages.urllib3.connectionpool) Starting new HTTP connection (1): localhost
2014-03-12 11:55:42,481 ERROR (eventhub-thread) Uncaught exception in thread eventhub-thread. Stack trace:
2014-03-12 11:55:42,608 ERROR (eventhub-thread) File "/usr/local/lib/python2.7/dist-packages/kegbot/util/util.py", line 109, in run
2014-03-12 11:55:42,617 ERROR (eventhub-thread) self.ThreadMain()
2014-03-12 11:55:42,627 ERROR (eventhub-thread)
2014-03-12 11:55:42,637 ERROR (eventhub-thread) File "/usr/local/lib/python2.7/dist-packages/kegbot/pycore/kb_threads.py", line 61, in ThreadMain
2014-03-12 11:55:42,653 ERROR (eventhub-thread) hub.DispatchNextEvent(timeout=0.5)
2014-03-12 11:55:42,686 ERROR (eventhub-thread)
2014-03-12 11:55:42,692 ERROR (eventhub-thread) File "/usr/local/lib/python2.7/dist-packages/kegbot/pycore/kbevent.py", line 192, in DispatchNextEvent
2014-03-12 11:55:42,707 ERROR (eventhub-thread) self._Dispatch(ev)
2014-03-12 11:55:42,709 ERROR (eventhub-thread)
2014-03-12 11:55:42,711 ERROR (eventhub-thread) File "/usr/local/lib/python2.7/dist-packages/kegbot/pycore/kbevent.py", line 199, in _Dispatch
2014-03-12 11:55:42,713 ERROR (eventhub-thread) cb(ev)
2014-03-12 11:55:42,715 ERROR (eventhub-thread)
2014-03-12 11:55:42,777 ERROR (eventhub-thread) File "/usr/local/lib/python2.7/dist-packages/kegbot/pycore/manager.py", line 152, in _HandleHeartbeat
2014-03-12 11:55:42,782 ERROR (eventhub-thread) taps = self._backend.GetAllTaps()
2014-03-12 11:55:42,787 ERROR (eventhub-thread)
2014-03-12 11:55:42,789 ERROR (eventhub-thread) File "/usr/local/lib/python2.7/dist-packages/kegbot/pycore/backend.py", line 50, in GetAllTaps
2014-03-12 11:55:42,791 ERROR (eventhub-thread) return self._client.TapStatus()
2014-03-12 11:55:42,793 ERROR (eventhub-thread)
2014-03-12 11:55:42,795 ERROR (eventhub-thread) File "/usr/local/lib/python2.7/dist-packages/kegbot/api/kbapi.py", line 234, in TapStatus
2014-03-12 11:55:42,847 ERROR (eventhub-thread) return self.DoGET('taps').objects
2014-03-12 11:55:42,867 ERROR (eventhub-thread)
2014-03-12 11:55:42,887 ERROR (eventhub-thread) File "/usr/local/lib/python2.7/dist-packages/kegbot/api/kbapi.py", line 162, in DoGET
2014-03-12 11:55:42,892 ERROR (eventhub-thread) return self._FetchResponse(endpoint, params=params)
2014-03-12 11:55:42,916 ERROR (eventhub-thread)
2014-03-12 11:55:42,937 ERROR (eventhub-thread) File "/usr/local/lib/python2.7/dist-packages/kegbot/api/kbapi.py", line 190, in _FetchResponse
2014-03-12 11:55:42,942 ERROR (eventhub-thread) return decode_response(r)
2014-03-12 11:55:42,944 ERROR (eventhub-thread)
2014-03-12 11:55:42,978 ERROR (eventhub-thread) File "/usr/local/lib/python2.7/dist-packages/kegbot/api/kbapi.py", line 105, in decode_response
2014-03-12 11:55:42,980 ERROR (eventhub-thread) response_dict = kbjson.loads(response.text)
2014-03-12 11:55:42,982 ERROR (eventhub-thread)
2014-03-12 11:55:42,984 ERROR (eventhub-thread) File "/usr/local/lib/python2.7/dist-packages/kegbot/util/kbjson.py", line 73, in loads
2014-03-12 11:55:43,021 ERROR (eventhub-thread) return json.loads(data, object_hook=_ToAttrDict)
2014-03-12 11:55:43,037 ERROR (eventhub-thread)
2014-03-12 11:55:43,047 ERROR (eventhub-thread) File "/usr/lib/python2.7/json/__init__.py", line 339, in loads
2014-03-12 11:55:43,060 ERROR (eventhub-thread) return cls(encoding=encoding, **kw).decode(s)
2014-03-12 11:55:43,062 ERROR (eventhub-thread)
2014-03-12 11:55:43,064 ERROR (eventhub-thread) File "/usr/lib/python2.7/json/decoder.py", line 365, in decode
2014-03-12 11:55:43,066 ERROR (eventhub-thread) obj, end = self.raw_decode(s, idx=_w(s, 0).end())
2014-03-12 11:55:43,137 ERROR (eventhub-thread)
2014-03-12 11:55:43,145 ERROR (eventhub-thread) File "/usr/lib/python2.7/json/decoder.py", line 383, in raw_decode
2014-03-12 11:55:43,158 ERROR (eventhub-thread) raise ValueError("No JSON object could be decoded")
2014-03-12 11:55:43,164 ERROR (eventhub-thread)
2014-03-12 11:55:43,177 ERROR (eventhub-thread) Error was: <type 'exceptions.ValueError'>: No JSON object could be decoded
2014-03-12 11:55:43,187 ERROR (eventhub-thread) Exiting thread.
2014-03-12 11:55:43,697 ERROR (watchdog-thread) Thread eventhub-thread died unexpectedly
Verified that redis-server
is installed and properly working.
I'm not entirely sure what can be done about this. Whenever a user runs kegbot upgrade
or kb_regen_stats
, the CPU burns at 100% for as long as the stats are regenerated. For my 189-drink database, the upgrade process took over 30 minutes.
The script currently installs into the global site packages dir. Instead, install into a virtualenv (as is already recommended for most users).
Use a separate virtualenv for server
and pycore
so dependency conflicts like Kegbot/kegbot-server#301 can be avoided.
After running the bash script, it gets to installing dependencies
---installing pip...
sudo easy_install-2.7 pip
sudo:easy_install-2.7: command not found.
Kegberry is currently server-only: It runs Kegbot-Server, but requires another device (Android) to monitor sensors and record pours.
Add "monitor mode", which adds automatic monitoring of attached kegboards. In its simplest form, we can just include kegbot-pycore & wrap a nice interface/installer around it. We can also monitor RPi GPIO as additional flow sensors, which would be pretty trivial.
I had an issue with a fresh install today of kegberry server.
bash -c "$(curl -fsSL https://raw.github.com/Kegbot/kegberry/master/install.sh)"
Went through without any issues, and the setup web page went through without issues, however when I went to kegadmin page, I was presented with a 500 error. (Debug was set to False). I then set debug to true, and noticed that the errors were related to redis
init() got an unexpected keyword argument 'socket_connect_timeout'
Searching for that noted that there is an error in redis with celery/
I fixed the error by calling :
pip install -U celery[redis]
in the virtual environment for kegbot-server.
Everything that I have tested after has worked.
Cannot upload beer pictures or mugshots. Beer pictures just dont show up when it says "settings saved" and when trying to add a mugshot to an account it gives a 502 server error.
Fresh install run in debug mode gives some more info instead of just "502 server error" which I pasted here: http://pastebin.com/FYAVENgT
Also, there doesnt seem to be a CACHE folder in the /media directory (dont know if that makes a diff but I notice one in the non-kegberry).
If you want, I left the server up at 135.23.33.3 and made you an account if you want a better look at the error output (try to upload a mugshot).
user: mik3y
pass: beer
I am not normally part of this whole "bug reporting" thing and dont really know the etiquette. My intention is to help you and dont want to seem like I'm trying to get you to solve my problems. The server is working nicely on my laptop :)
Please let me know if I'm not helping.
Dusty
A place to upload images for the README.
Hi, the install docs for Kegberry seem to not exist (broken link?).
the kegberry.com URL on the github landing page takes me to kegberry.kegbot.org, which throws a github 404.
Help?
Thanks!
We should mention that Kegberry installs Kegbot Server utilizing pip (so they know which upgrade path to follow in the future) & MySQL , and when the user is prompted for a MySQL password during the install script, they should leave the MySQL password blank and hit Enter.
pip and friends can fail with ugly error messages (like #7) when there is a network issue.
ValueError at /sessions/
Database returned an invalid value in QuerySet.datetimes(). Are time zone definitions for your database and pytz installed?
Request Method: GET
Request URL: http://kegbot/sessions/
Django Version: 1.6.2
Exception Type: ValueError
Exception Value:
Database returned an invalid value in QuerySet.datetimes(). Are time zone definitions for your database and pytz installed?
To correct this you need to do "sudo mysql_tzinfo_to_sql /usr/share/zoneinfo | mysql -D mysql -u root".
I completed the install navigated to the local ip of my pi and all i get is
Welcome to nginx! on a white black screen
what am i doing wrong
???
When adding RFID tokens on the web server the auth_device
is always set as ``core.rfid`, and when the token was swiped across the reader on the kegboard the following was showing up in the ngix access log:
127.0.0.1 - - [07/Apr/2014:23:05:59 +0000] "GET /api/auth-tokens/kegboard/680096068f HTTP/1.1" 404 159 "-" "python-requests/2.2.1 CPython/2.7.3 Linux/3.10.25+"'''
and the kegbot log stated that the token was not assigned.
I modified the database to change the auth_device
to kegboard
and saw the following in the ngix access log:
127.0.0.1 - - [09/Apr/2014:01:21:59 +0000] "GET /api/auth-tokens/kegboard/680096068f HTTP/1.1" 200 373 "-" "python-requests/2.2.1 CPython/2.7.3 Linux/3.10.25+"
and the kegbot log displayed the following:
2014-04-09 01:21:58,170 INFO (AuthenticationManager) Token attached: [email protected]
2014-04-09 01:21:58,699 INFO (flowmanager) Starting flow: <Flow 0x534344da: meter_name=kegboard.flow1 ticks=0 username=u'Matt' max_idle=0:00:10>
2014-04-09 01:21:58,709 INFO (AuthenticationManager) Token attached: [email protected]
2014-04-09 01:21:59,123 INFO (flowmanager) Starting flow: <Flow 0x534344db: meter_name=kegboard.flow0 ticks=0 username=u'Matt' max_idle=0:00:10>
2014-04-09 01:21:59,139 INFO (AuthenticationManager) Token detached: [email protected]
2014-04-09 01:21:59,156 INFO (flowmanager) Stopping flow: <Flow 0x534344da: meter_name=kegboard.flow1 ticks=0 username=u'Matt' max_idle=0:00:10>
2014-04-09 01:21:59,176 INFO (AuthenticationManager) Token detached: [email protected]
2014-04-09 01:21:59,184 INFO (flowmanager) Stopping flow: <Flow 0x534344db: meter_name=kegboard.flow0 ticks=0 username=u'Matt' max_idle=0:00:10>
2014-04-09 01:21:59,207 INFO (DrinkManager) Flow completed: flow_id=0x534344da
2014-04-09 01:21:59,214 INFO (DrinkManager) Posting 1 pending event(s)
2014-04-09 01:21:59,235 ERROR (eventhub-thread) Uncaught exception in thread eventhub-thread. Stack trace:
2014-04-09 01:21:59,276 ERROR (eventhub-thread) File "/usr/local/lib/python2.7/dist-packages/kegbot/util/util.py", line 109, in run
2014-04-09 01:21:59,283 ERROR (eventhub-thread) self.ThreadMain()
2014-04-09 01:21:59,289 ERROR (eventhub-thread)
2014-04-09 01:21:59,296 ERROR (eventhub-thread) File "/usr/local/lib/python2.7/dist-packages/kegbot/pycore/kb_threads.py", line 59, in ThreadMain
2014-04-09 01:21:59,302 ERROR (eventhub-thread) hub.DispatchNextEvent(timeout=0.5)
2014-04-09 01:21:59,305 ERROR (eventhub-thread)
2014-04-09 01:21:59,311 ERROR (eventhub-thread) File "/usr/local/lib/python2.7/dist-packages/kegbot/pycore/kbevent.py", line 194, in DispatchNextEvent
2014-04-09 01:21:59,313 ERROR (eventhub-thread) self._Dispatch(ev)
2014-04-09 01:21:59,324 ERROR (eventhub-thread)
2014-04-09 01:21:59,330 ERROR (eventhub-thread) File "/usr/local/lib/python2.7/dist-packages/kegbot/pycore/kbevent.py", line 201, in _Dispatch
2014-04-09 01:21:59,336 ERROR (eventhub-thread) cb(ev)
2014-04-09 01:21:59,338 ERROR (eventhub-thread)
2014-04-09 01:21:59,340 ERROR (eventhub-thread) File "/usr/local/lib/python2.7/dist-packages/kegbot/pycore/manager.py", line 311, in HandleFlowUpdateEvent
2014-04-09 01:21:59,349 ERROR (eventhub-thread) self._FlushPending()
2014-04-09 01:21:59,359 ERROR (eventhub-thread)
2014-04-09 01:21:59,377 ERROR (eventhub-thread) File "/usr/local/lib/python2.7/dist-packages/kegbot/pycore/manager.py", line 328, in _FlushPending
2014-04-09 01:21:59,379 ERROR (eventhub-thread) self._PostDrink(event)
2014-04-09 01:21:59,381 ERROR (eventhub-thread)
2014-04-09 01:21:59,383 ERROR (eventhub-thread) File "/usr/local/lib/python2.7/dist-packages/kegbot/pycore/manager.py", line 343, in _PostDrink
2014-04-09 01:21:59,399 ERROR (eventhub-thread) event.flow_id, event.meter_name, volume_ml))
2014-04-09 01:21:59,406 ERROR (eventhub-thread)
2014-04-09 01:21:59,412 ERROR (eventhub-thread) Error was: <type 'exceptions.TypeError'>: %d format: a number is required, not NoneType
2014-04-09 01:21:59,415 ERROR (eventhub-thread) Exiting thread.
2014-04-09 01:21:59,568 ERROR (watchdog-thread) Thread eventhub-thread died unexpectedly
2014-04-09 01:22:00,082 ERROR (main) Watchdog thread exited, quitting
2014-04-09 01:22:00,588 INFO (main) Kegbot stopped.
2014-04-09 01:22:06,750 INFO (main) Kegbot is starting up.
mysql-server installed via install.sh
REQUIRED_PACKAGES="nginx-light supervisor python-setuptools python-dev libsqlite3-dev libmysqlclient-dev mysql-server memcached"
The non-interactive installer setup-kegbot.py --interactive=false
Points to sqllite database:
# Kegbot local settings.
# Auto-generated by /usr/local/bin/setup-kegbot.py version 0.9.17-pre1.
# Safe to edit by hand. See http://kegbot.org/docs/server/ for more info.
# NEVER set DEBUG to `True` in production.
DEBUG = False
TEMPLATE_DEBUG = DEBUG
DATABASES = {'default': {'ENGINE': 'django.db.backends.sqlite3', 'NAME': '/home/pi/kegbot-data/kegbot.sqlite'}}
KEGBOT_ROOT = '/home/pi/kegbot-data'
MEDIA_ROOT = '/home/pi/kegbot-data/media'
STATIC_ROOT = '/home/pi/kegbot-data/static'
CACHES = {'default': {'LOCATION': '127.0.0.1:11211', 'BACKEND': 'django.core.cache.backends.memcached.MemcachedCache'}}
SECRET_KEY = '<removed>'
Hence is mysql-server not taking unnecessary storage, and more importantly CPU cycles from little Raspberry Pi?
When I try to run the bash command to install on a pi, it errors out when it gets to the part and it tries to download from https://nodeload.github.com/Kegbot/kegbot/zip/master
From stabu in IRC
Kegberry takes forever to render pictures. seems like my rpi is actting really slow.
We've not yet profiled/optimized for the pi, offhand I suspect introduction of a sql query cache + static file cache headers on nginx side could be quick wins.
Spawned from issue #3: Monitor mode only listens to kegboards, but we've had some long-standing requests for RPI GPIO support. Add a trivial flow meter daemon for these pins.
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.