Kegberry Web Enhancements


#1

In my effort to implement some of the features of the full android interface on my Kegberry setup, I’ve implemented a lot of changes to the Kegberry Server / Pycore implementation so that there’s more functionality on the “Fullscreen” page of the Kegbot Server.

As I mentioned in another post, my goal is to have just a tablet or screen on my bar-top and have all of the wires/sensors/controllers hidden below.

A few of the things I’ve done:

  • Added live pour tracking to the Fullscreen page
  • Enabled RFID (added support for generic MFRC522 readers)
  • Greeting on the fullscreen page when a tag is swiped (or “not authenticated” if invalid)
  • Fixed Pycore issue with opening/closing a relay
  • Attempt to use a magnetic door lock to secure the taps rather than a solenoid (works perfectly but installation looks awful…HELP!)
  • Added some phantom pour prevention
  • Added ability to add comments on drinks (“shouts”) from within the web server
  • Added temperature reading on the Fullscreen page
  • Added a drinker photo on the Fullscreen page rather than the Keg icon

I have a video HERE ON YOUTUBE that shows off the current system that I’m using (with the exception of the tap-locks, again it currently looks awful!)

Would love any comments/suggestion and you can check out all of the code edits on my Github page: https://github.com/johnnyruz/


Kegbot/Kegberry not logging drinks
#2

Hello, i just installed KegBerry and it works fine (it is running), but I’d like to install Web Enhancements. I tried to follow the instructions in README but kegbot runserver finds the port (?) already in use and it makes no changes. Should i stop the running server? Re-install everything? Please advise! Thanks


#3

Hi @mgriva,

Yeah I have not done a great job of making it easy to install the enhancements, but I’m working on it! Right now for the updates to the web interface it unfortunately involves finding the updated files on my github and updating the source files on your Kegbot installation and then either restarting the box (I assume a Raspberry Pi) or using supervisor to restart the kegbot server.

sudo supervisor restart kegbot:*

As for the Node server with the live pour updates, the README file under the node_server directory for my fork of the Kegbot-Server should help get the Node server installed, and it should be running on a port different from the kegbot server. I believe the default is 3000 or 3001.

From the error message you’re getting, it sounds like you’re executing the runserver command while the server is already running. If you’ve got everything installed on a Raspberry Pi, the command above should do a full restart of all the services.


#4

Great ! I copied the updated files in the directories from your fork, then installed Node. Changed fullscreen.htlm to the last version and put my IP address and port 3000.
However now I got an error while launching:

sudo node server.js

listening on *:3000`
/home/kegbot/kegbot-server.venv/node-server/server.js:147
bodyjson.objects.forEach((user) => {
^

TypeError: Cannot read property ‘forEach’ of undefined
at Request._callback (/home/kegbot/kegbot-server.venv/node-server/server.js:147:24)
at Request.self.callback (/home/kegbot/kegbot-server.venv/node-server/node_modules/request/request.js:185:22)
at Request.emit (events.js:189:13)
at Request. (/home/kegbot/kegbot-server.venv/node-server/node_modules/request/request.js:1161:10)
at Request.emit (events.js:189:13)
at IncomingMessage. (/home/kegbot/kegbot-server.venv/node-server/node_modules/request/request.js:1083:12)
at Object.onceWrapper (events.js:277:13)
at IncomingMessage.emit (events.js:194:15)
at endReadableNT (_stream_readable.js:1125:12)
at process._tickCallback (internal/process/next_tick.js:63:19)

Did I miss something? Hope this can help other in fixing similar issues …

Thanks !


#5

Looks like you’re getting an error in the “refreshUsers” method of the server script.

I noticed I did not mention in the README for the server that you need to add your API_KEY to the config.js file in order to successfully connect. That error indicates that the response from the server could not be serialized into a valid JSON response, so either the connection failed because the server was unable to reach your Kegbot server (code assumes it’s running on the same box at localhost) or that the authentication failed since the Users API URL requires the API key to authenticate.


#6

Great many thanks!! Now it is running on port 3000… starting to simulate pours with test_flow.py

Thanks Maurizio


#7

@johnnyruz

I’ve finally got live flow metering up and running on the Kegberry, looks good - still some config on my side to do.

It seems the flow meters have some variance in them and each is different. I realise under the flow meter settings there is a ‘Ticks per mL’ to adjust the measured amount, I have 2 meters live one at 0.2 and one at 0.25 Ticks per mL.

I wondered if rather than continually tweak this number until the poured amount matches close to the measured amount, could a web enhancement be to have a meter training process, something like;

  • Pour 5 x 1l and auto calculate the average ‘Ticks per mL’ or,
  • Pour 5l and take the ‘Ticks per mL’ or
  • When a pour is made, next to the ‘resize’ button, have a ‘calibrate flow meter’ button which calculates the ‘Ticks per mL’ based on a manually entered ‘resize’ value.

Just some thoughts, they may not be practical…?


#8

These sound like awesome ideas!! I’m working on a couple other projects (in addition to my full time job!) but hopefully I’ll get those wrapped up and will be able to get back to Kegbot development.

Although I think my first task is going to be to get my development environment re-configures so that my enhancements and the overall install process can be much easier for new users!


#9

I’ve noticed the flow rate changes as you get through the keg so this would be great.

Also one thing that is a little annoying is when you calibrate the tap it doesn’t come off the keg!


#10

I have the flow sensors and temperature sensor working. I see it in the serial monitor. Haven’t figured out the RFID reader just yet. I did find your modified firmware and flashed it to the Arduino Mega. I assume that I should see something in the monitor when I put a tag on the reader, but I don’t…


#11

I figured out the wiring for connecting the RFID reader to the Mega. Didn’t know about the dedicated SPI inputs, that took a while to figure out. I now see core.rfid and some gibberish behind it. Unfortunately kegbot doesn’t react or add the token automatically. I’m not sure if I need to update any other python files to make that happen. Also not sure, if I should see a decimal number for the token serial. When I was testing out the RFID reader and the connection to the Mega, I used a sketch that did some conversions, so it would print out a human readable number on the serial monitor. I can’t wait until you release a script to automatically pull down your edits. There are quite a few files that you have modified, and I’m not sure I grabbed them all. Since this function doesn’t work, I’m guessing I didn’t.


#12

I have everything up and running. I hosted a going away party a couple weeks ago and was able to get people pouring and registering their drinks. It worked really well, except for the foam. That was a little annoying. I might need to lengthen my hoses, but I just came across a flow sensor that was reccommended in a very old Reddit thread.

They are made for beer, so it should fix the foam issue. With shipping and such they are around $60 each, so I might try a longer hose first.