Kegberry/Kegbot New Installation


I shut off the pi when i turned it on this morning I typed in localhost i got this message

502 Bad Gateway


Hmm, I usually get this if I haven’t waited long enough after a reboot for the Kegbot Server services to start up, but I’m sure there are many possible causes.

A few commands you can run to check things:

Check the status of the nginx (web server) configuration:

sudo nginx -t

Check if nginx is running:

sudo service nginx status

Check if the Kegbot Server host is running:

curl localhost:8000

With this last command you should get the HTML output for the homepage of the Kegbot server.


the “bad gateway” error comes after i add gmail using the old instructions


So it looks like more typo errors on my part due to copy/paste from a terminal window into the forum post.

If you copy and paste my email configuration from above, you’ll get some incorrect apostrophes around the setting values, and this makes the configuration file invalid causing the server to not start.

Check your file and make sure you have the correct apostrophe characters enclosing each string. I’ve also attache a picture for reference.


I got the flow meter working everything is logging in as guest, if i would like to log in under different names do i need to go wit the Android tablet and if so what software do i need to load to it. do you have any recommendations for a brand.

once again thank you for all your help


Yeah unfortunately really the only “real-time” way to log a pour to someone other than Guest is to go to the Edit Drink screen and assign it to a specific user. This is how I currently manage logging pours to different users on my setup.

You can absolutely use the tablet app, but I would suggest if you’re going that route you plug the Arduino directly into the tablet and have it manage the pours so you’ll get the full functionality of user assignment and pictures taken when a pour is triggered.

As far as recommendation, I have an old Acer A210. It’s nice because it has a full-sized USB port and charges via a dedicated DC input vs. some of the more modern ones that only have micro-usb and may not be able to connect to a controller and charge at the same time. However, performance-wise it is definitely showing it’s age, and even with minimal software installed it sometimes hangs up.

All that being said, I am trying to develop a solution that will make it easier to assign pours from the web interface. My goal is to be able to have a tablet on my bar that only displays the pretty “fullscreen” page of the web server, with an easy workflow for tagging a pour to a user. Currently a work in progress but hope to have something in the next couple weeks.


I picked up an RCA android with continuous power and (usb reg and mini)
What application do I need to down load to have it communicate with the raspberry pi running as the server


You should just be able to grab the Kegbot app from the Google Play Store. As part of the setup of the App you will “link” your Tablet with the server so that pours triggered from the Tablet will save to the server.

You should connect your Arduino that’s managing the flow meters/temp sensors directly to the tablet so that the Android tablet manages the process.

As an Overview:

  1. Pour starts, triggers flow meter, sends pulse from Arduino to Android via USB
  2. Android will change to the “Pour” screen and start counting the amount of the pour, take a picture (if enabled), capture a comment about the pour (optional), and allow you to choose the user that is pouring
  3. After a timeout period, or the user tapping “Done Pouring”, the details of the drink are posted to the Raspberry Pi running Kegbot Web Server.
  4. After a short period of time, the Android tablet refreshes from the Kegbot Server and the pour appears in the “History” list in the Kegbot Android interface


Thank you very much, all works as you described it. I am looking forward for your new update.


Hello From S.A
This page have helped me so much…Thanks

I just have 2 Questions maybe stupid one’s and not sure if the right place to ask,but hope someone can help.
1: Had 2 Taps on flow meters on Arduino Uno, worked fine but wanting to add all 5 my taps, I have the Arduino mega, is there a diagram somewhere with pin layout? Im not sure on what pins I can connect the flow meters, and Temp sensor on , Im sure its in the sketch somewhere, but know very little of what actually goes on there code wise… and is it just plug and play or do I need to change anything in the sketch?

2: I know this is long shot, but is it at all possible to use a usb RFID reader ? it works fine connected to the tablet and outputs number of token, but does not seem to register/work with Kegbot app, it always just selects the highlighted user.

Thanks alot !


Hi @YeastWhisperer77,

  1. For the Arduino Mega, the pin definitions can be found in the kegboard_config.h file in the Arduino Code, but here’s the default pin assignments for flow meters and temperature sensor on the Mega:

Flow Meter 1: Pin 2
Flow Meter 2: Pin 3
Flow Meter 3: Pin 21
Flow Meter 4: Pin 20
Flow Meter 5: Pin 19
Flow Meter 6: Pin 18
Temp Sensor: Pin 7

  1. I have not done anything with RFID so someone else can maybe help with that, but I would assume there would have to be some changes to the Android code in order to change where it is looking for the source of the RFID messages. Do you have a link to the USB RFID reader you’re using?


Thanks for the reply and pin layout.
This is the USB RFID reader I have, suppose its easier to just buy the correct one. (any suggestions?)


Thanks for this guide. Love your work.
Worked to get kegberry on my old banana pi pro using armbian 5.59 (stretch).
I can confirm I had to correct /home/kegbot/.kegbot/pycore-flags.txt and also had to add the user kegbot to the dialout group to be able to use /dev/ttyACM0.

Would like to implement all the changes you have made in your post “web improvements”. What is the best way to do this? Can I simply copy the files you changed over the old ones or do I have to follow the install instructions on GitHub?


Hey @johnnyruz do you have any pics of your tablet setup? curious to see it, thanks again for all of your help on the forums!


Hey @moad,

If you check my thread for Kegberry Web Enhancements, you should see a link to a YouTube video that shows my tablet/bar setup. Let me know if you want any more pictures/videos and I’ll be happy to share!



For any of the Kegbot server UI or Pycore changes, the easiest way would be to copy the file changes over to replace the existing files on the server.

With most changes, you will have to restart the kegbot server and services with the command

sudo supervisorctl restart kegbot:*

For the NODE server that enables real-time pouring, it’s best to follow the instructions in that folder on Github to get Node installed, and then create that new directory under kegbot-server.venv that specifically holds the node server files.

I admit, the installation is messy and I started to script out an install package but got side-tracked. I’ll try to get that going at some point soon.



I’m have a problem in this line:

return this:

+ sudo bash -c ‘DEBIAN_FRONTEND=noninteractive apt-get -yq install python-setuptools’
sudo: /usr/bin/sudo must be owned by uid 0 and have the setuid

I search a lot how to fix this but I didin’t find the answer.

Please, help me!!!


hi @mvrinaldi,

I haven’t come across that error, but a quick google looks like somehow the permissions for sudo have gotten seriously messed up! What hardware/os are you attempting this installation?


I saw that info but I installed a new Raspbian Streatch in a Raspberry Pi 3 B.It’s strange.



Very strange! If you’re running a Raspberry Pi 3 B instead of a B+, I may recommend following my initial instructions for installing Raspbian Jessie. The B+ doesn’t support a Jessie install (without a ton of work-arounds and crazy effort) which is why I came up with some instructions for setup for Stretch on a B+. I don’t see why those wouldn’t work on a regular B with the Stretch image, but for the Model B it’s just easier and more straightforward to start with a Jessie install.