Kegberry/Kegbot New Installation

@johnnyruz - Man, I was so excited to get this thing hooked up, but now disappointed. I am having full pints of foam. I’ve tried lowering the PSI, but that isn’t helping much. I used these these flowmeters thinking that the small input/output and size would lead to less foam because there wasn’t as much expansion as the bigger ones, but it is doing a great job of making beer froth for me.

I’m going to try to lengthen lines, move the flowmeter closer to the faucet, etc, but I’m pretty bummed so far.

Fresh Jessie install, but still not able to link pours to drinkers… all the pours register as guest… Not sure what to do… could it be the android device I’m using ?
Pours register, but if i try and do calibration it does not detect flow, so can’t calibrate. Is there a file I can tinker with to do it manually? this is the meter Im using https://docs-emea.rs-online.com/webdocs/1636/0900766b816369c1.pdf. so 1420/L.

I am having a problem with the recommended 2017-07-05-raspbian-jessie.zip booting up on a pi 3B+ any suggestion would be appreciated

Hi @danc,

I’ve also heard that the older jessie images have issues on the new B+ models. Something with a different hardware architecture.

I have a B+ that I have not yet loaded Kegbot on, but I’ll give it a try tonight or tomorrow and see if I can come up with a suggestion or work-around.

Thank you for the response

Alright, so I finally got the installation working on a Raspberry Pi 3 B+ running Raspbian Stretch OS. The instructions are a little crazy and I may try to script this out so it’s easier, but in the meantime here we go!

Standard Pi Setup Stuff

  1. Flash the latest Raspbian Stretch, either Lite or with Desktop will work
  2. Boot the PI+
  3. Resize will Happen Automatically and then reboot
  4. Pi will then start up
  5. Login with pi/raspberry
  6. Run: sudo raspi-config
  7. Reset your password (optional)
  8. Turn on SSH under Interfacing Options
  9. Change keyboard layout if necessary (defaults to English UK)
  10. Connect to WiFi by selecting country, entering SSID, and password (not required if using a network cable)
  11. Run ifconfig to get the IP Address of your Pi (either eth0 interface (wired) or wlan0 (WiFi)
  12. Exit raspi-config
  13. Run sudo apt-get update
  14. Run sudo apt-get upgrade

The rest of these steps can either be performed via the attached keyboard/mouse or over SSH. I prefer SSH so you can scroll up/down to see historical messages.

Get My Updated Kegbot Packages and Scripts

  1. Download my packages into your home directory by running:
    wget https://github.com/johnnyruz/kegbot-server/raw/add_my_pkgs_to_github/my_kegbot_packages.zip
  2. You should have a file my_kegbot_packages.zip in the folder /home/pi/
  3. Unzip by running unzip my_kegbot_packages.zip
  4. You should now have a folder at /home/pi/mypkgs
  5. Execute the command: bash -c /home/pi/mypkgs/install.sh

Fix issue with missing Six module and libmysqlclient-dev

  1. After running the install script for the first time, the installer should fail with message

ImportError: no module named six

  1. Run the command sudo pip install six
  2. Next, open the file located at /usr/local/lib/python2.7/dist-packages/kegberry/app.py
  3. Find the section for REQUIRED_PACKAGES, and change the entry for libmysqlclient-dev to default-libmysqlclient-dev
  4. Execute the command bash -c /home/pi/mypkgs/install.sh

Fix issue with MySQL/MariaDB Permissions & Index

  1. After running the install script for the second time, the installer should fail with message

Permission denied for user ‘root’@‘localhost’

  1. Open the file /etc/mysql/mariadb.conf.d/50-server.cnf
  2. In the [mysqld] section at the top of the file, find the line that says “skip-external-locking” and add the line skip-grant-tables directly below that
  3. Scroll down and find the two lines for character-set-server and collation-server
  4. Change these lines to the following:

character-set-server = utf8
collation-server = utf8_general_ci

  1. Reboot your Raspberry Pi
  2. After the reboot, execute the command bash -c /home/pi/mypkgs/install.sh

Fix issue with SSL Package Repository

  1. After running the install script for the 3rd time, the installer should fail with message

HTTP Error 403: SSL is required

  1. Execute the command bash -c /home/pi/mypkgs/install_part2.sh
  2. After this finishes, again run bash -c /home/pi/mypkgs/install.sh

Wrapping Up

On my Pi, this final step took a long time, but I have a very slow internet connection which may impact things. But once it completes you should have a fully functioning Kegberry installation.

Kegboard Controller Issue

User @danc discovered an issue with the Kegbot Server’s auto-discovery of controllers when connected via USB to the Raspberry Pi. I tracked this down to an issue with the pycore-flags.txt file located at /home/kegbot/.kegbot/pycore-flags.txt

You will need to make sure that the contents of this file look exactly like the following, but with your own API key:

–api_url=http://localhost/api
–api_key=2a54012341ba932a264182d45d35fe69

You should only have these two lines (including the double-dashes in front) with no additional text in the file.

Wrapping Up

Please let me know if this works for you, and if any linux masters out there can turn this into a stand-alone script that would be awesome for future users.

2 Likes

After step 5 in get my updated keg bot packages and scripts I get a message permission denied

@danc,

Are you getting a permission error trying to download the packages from Github, or in step 5 in that section where you’re running that install script for the second time?

Feel free to copy and paste the error message/screenshot and I’ll try to help out!

pi@raspberrypi:~ $ bash -c /home/pi/mypkgs/install.sh
bash: /home/pi/mypkgs/install.sh: No such file or directory
pi@raspberrypi:~ $ bash -c /home/pi/my_kegbot_packages/mypkgs/install.sh
bash: /home/pi/my_kegbot_packages/mypkgs/install.sh: Permission denied
pi@raspberrypi:~ $

this is a copy of the message i get
thanks for the help
Dan

@danc,

Alright so it looks like I had a mistake in how I created the ZIP file, and also it looks like Github doesn’t carry over permissions for the files in the ZIP.

I’ve corrected the ZIP file, so hopefully now when you run the UNZIP command you get the mypkgs folder rather than having it embedded in another my_kegbot_packages folder.

I suggest you delete all of your files in the /home/pi directory, and then pick back up from step #1 under Get My Updated Kegbot Packages and Scripts, I’ve updated the instructions with 2 additional commands to enable execution of the install scripts.
EDIT: I figured out how to have the zip file hosted on Github with the correct permissions, so I’ve removed the extra steps as they are no longer required.

Otherwise, since you’ve already got the files, you can just run the sudo chmod 777 command on the install.sh and install_part2.sh files within your /home/pi/my_kegbot_packages/mypkgs/ directory and then proceed with running the scripts.

error messages after step 5 from Get My Kegbot Packages and Scripts
i know that some were expected
Package libmysqlclient-dev is not available, but is referred to by another package.
This may mean that the package is missing, has been obsoleted, or
is only available from another source

E: Package ‘libmysqlclient-dev’ has no installation candidate

ERROR : Command returned error:
ERROR : Command: sudo bash -c "DEBIAN_FRONTEND=noninteractive apt-get -yq install build-essential nginx-light libjpeg-dev supervisor python-setuptools python-dev libmysqlclient-dev mysql-server redis-server"
ERROR : Return code: 100
Traceback (most recent call last):
File “/usr/local/bin/kegberry”, line 7, in
app.run()
File “/usr/local/lib/python2.7/dist-packages/kegberry/app.py”, line 210, in run
command_fn(*args)
File “/usr/local/lib/python2.7/dist-packages/kegberry/app.py”, line 242, in install
self._update_packages()
File “/usr/local/lib/python2.7/dist-packages/kegberry/app.py”, line 235, in _update_packages
’ '.join(REQUIRED_PACKAGES)))
File “/usr/local/lib/python2.7/dist-packages/kegberry/app.py”, line 142, in run_command
raise e
subprocess.CalledProcessError: Command ‘sudo bash -c “DEBIAN_FRONTEND=noninteractive apt-get -yq install build-essential nginx-light libjpeg-dev supervisor python-setuptools python-dev libmysqlclient-dev mysql-server redis-server”’ returned non-zero exit status 100
pi@raspberrypi:~ $
Thanks again
Dan

see step #4 under “Fix issue with missing Six module and libmysqlclient-dev”

Updating the app.py file with “default-libmysqlclient-dev” should resolve that error.

FYI: I also discovered an error in my install_part2.sh script. This has been corrected and an updated file is available on Github, so you will just need to run the “wget” command from step 1 above and unzip to get the latest files

i am getting the same error message as previous, after continuing to : “Open the file /etc/mysql/mariadb.conf.d/50-server.cnf”

mysql file is not in etc
once again time and help

Thank you for your time and help
dan

@danc,

No problem at all.

Did you successfully the execution of the install script successfully get past the run in Fix issue with missing Six module and libmysqlclient-dev?

This piece of the installation script should install the mysql client and create the directories in the /etc/ folder. It will then hit the error I mentioned about permissions for ‘root’@‘localhost’. Is that the error you’re seeing now?

I’m trying to put together a YouTube video of the complete installation but may not be ready for a couple days.

when i change the entry for libmysqlclient-dev to default-libmysqlclient-dev
and try and save the change it says "looks like this file or folder is not writable"
This may be where i am getting messed up i cant save the file , i made the change before but didnt try to save the change

try using the “nano” program as a test editor and opening with sudo.

sudo nano /usr/local/lib/python2.7/dist-packages/kegberry/app.py

Once you’ve updated the libmysqlclient-dev to default-libmysqlclient-dev, use CTRL + X to close Nano and it will ask you whether or not you wish to save. Enter ‘Y’ and press ENTER to commit your changes.

You’ll need sudo nano multiple times to edit files that require elevated permissions to edit.

Thank you for your write ups they were a great help I am up and running now moving on to flow meters and temp

Once again THANK YOU
dan

i have at this point two problems
1)seting up mail i can not locate /home/kegbot/.kegbot/local_settings.py
all i have is
/home/kegbot There is no local_settings.py
2) in setting up the arduino you refered to “Controllers” screen. I cant locate that

Thanks Dan

The ‘.’ in front of the kegbot folder means it’s hidden so running a regular ‘ls’ command will not show that folder. If you run the command

ls -lah

That will list all folders in the directory, including the hidden folders and you can also cd into that directory. In there you will find your local_settings.py file.

The “Controllers” screen can be found on the Admin tab if you have enabled Flow Sensing. If you did not choose the option to enable flow sensing on your initial setup, you can turn it on from the Admin > General screen.