Noob in need of help with build


#1

I stumbled across this site and have literally spent hours reading as I’m intrigued. I’m a bit confused. It looks like this is a client/server setup. So you need to run a kegbot server? Here is what I would like to achieve. I would like to have a tablet to view the pour usage and amount of product left in the keg. I have a couple raspberry pi’s. I also have a dedicated media server running windows 10. So would the best setup be for me to install Kegberry on a Raspberry PI? I see terms Kegbot, Kegberry, the use of Raspberry Pi’s, tablets, Digital ocean, arduino, kegboards etc. I also know that what this project started as vs what it is now, has changed some…so I’m having trouble separating what I need to achieve what I would like to achieve. I really did read before posting so bear with me. Thanks in advance!


#2

Quick/basic response based only on my build experience -
Minimum hardware required is:
Flow meters installed in your beer line
Arduino
Tablet

You do not have to run a server, but it gives you lots of additional features.

You could run your kegbot on a pi or inside a Linux server on virtualbox on your Windows server.

Digital Ocean is an online solution to running the server
Kegboards are dedicated boards to run your flow meters. I’m not sure they’re available any more. Alternatively - use an arduino

PM me if have any questions and I’ll try to help.


#3

@crankycowboy, welcome to the Kegbot Forum.

I’m also able to help in any way possible. Checkout my thread Kegberry/Kegbot New Installation for a lot of information on how to get started if you go the Raspberry Pi route.

A couple of very high-level comments:

  • The original architecture of Kegbot consists of:

    1. Android Tablet - this runs the Kegbot Android application
    2. One or More Kegboards - These connect via USB to the tablet, and connect via jumper wires to the sensors like flow meters, temperature sensors, RFID readers, locking solenoids etc. These boards were originally sold by Kegbot but are no longer generally available. They were really just specialized Arduino boards so any standard Arduino (Uno, Nano, Mega) is a perfect replacement
    3. Kegbot Server - This is optional but really completes the system. It’s designed to run on a Linux platform but probably could work on anything that can run Python. It hosts a MySQL Server to store the pour data as well as a web interface to manage pours/users/kegs etc.
  • Kegberry is the same Kegbot Server you would install on a Linux box, but packaged for the Raspberry Pi. One thing that it includes is software called PyCore. This allows the Raspberry Pi to communicate directly with the Kegboards instead of having them connected to the Tablet

  • The Kegbot App appears to have disappeared from the Google Play store probably because it hasn’t been updated in years. Myself or @angrypirate may be able to help with that if you like.

  • I have actually gone away from the Android App and am running my Kegbot directly from the Kegbot Server Web Interface where I’ve made a lot of enhancements.

Really check out that Kegberry/Kegbot New Installation thread, if you follow through that it should get you pretty close to exactly what you’re looking to accomplish.


#4

Johnny, thanks for keeping the lights on here! Really great breakdown. I’m hoping to get some more time to clean up the project & address some things soon. In the meantime, just a small update on this front:

It’s back! Got taken down by some lapse in terms of service or something.


#5

Wow, you guys are awesome! There hasn’t been too much traffic in this forum, so I was worried I wouldn’t get answers. Thank you so much!

@johnnyruz I went through your thread “kegberr/kegbot new install”. I have a raspberry pi 2 B; however, I still just installed stretch. Everything seems to have gone well but I did get some errors. I can’t see too much because right now I am remote logged into my desktop computer and then ssh’d into my Pi connected to my network (talk about working remotely).

. Can you please take a look at the attached image and let me know what else in there stands out to you as a potential issue I should look at? Thank you in advance!


#6

It’s been awhile since I’ve done the install, but I’ll run through it again tomorrow to see if my instructions are still accurate and update if necessary.

In the meantime, make sure you’re following the post about installing on Stretch if you haven’t seen that already. There are some additional steps to perform to get things working on the Stretch OS.


#7

Johnny, thank you so much. It’s amazing the amount of help you lend despite it being a hassle and you really get nothing out of it. I greatly appreciate the help. I did see the instruction for stretch. I realized that with some of the files (like libmysqlclient-dev) I wasn’t doing “sudo nano” to edit it so I wasn’t able to save the changes. After I figured that out, I was able to go through the rest of your instructions. After multiple reboots and installs after each of your steps, I finally went through without errors…so I think I got it. I have ordered the other components you suggested. I have some additional dumb questions. a) you say:

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."

Where do I get my api to make sure it’s the correct data in there?

b). This is the really dumb question. Now with kegbot seemingly installed…does it autorun at startup? If not, how do I start it? How do I access it from a web-browser as you mentioned? Thank you again Johnny!


#8

@johnnyruz I should probably clarify my comments above. I believe the kegbot server is installed per your instructions. After the final install I didn’t receive any additional errors, so think we are good there. Next I need to know how to start the server on the Pi. I believe once you initiate the startup, it will also start a “wizard” where you can configure everything? I can handle forwarding my router to look to the PI’s IP address, I am just confused as to how to start the kegbot server running on the PI at this point. Also, how can I configure it to “autostart” upon reboot of the Pi etc? Thanks again!


#9

@crankycowboy

I’m glad you got things installed! I just ran through my install instructions again and I could have made things so much better, I missed some of the steps myself! I’m thinking of ways to improve it but glad things worked out for your installation.

API Key
With regards to the API Key, the Kegbot installation will auto-generate your API key and write it to the flag file, however I’ve found on the Stretch installation when that file gets written there often is some extra text from the console that gets written to that file.

For example in my installation the file looked like this:

Which I then had to update to:

Server Startup
After the installation, the server should already be running on your Pi. You can check this by typing

curl localhost

and you should get the output from the Kegbot Homepage. You can then just open a web-browser (either on another computer on your local network or on the Raspberry Pi desktop if you installed the full version) and navigate to the IP address of your Pi. You should then be greeted by the Kegbot Homepage with the setup wizard.

The Kegbot setup installs a program called Supervisor that manages the startup of all of the required services, and is already configured to auto-start on reboot. If you need to restart the Kegbot services you can type the command:

sudo supervisorctl restart kegbot:*

john


#10

Ok, I seem to be in a “one step forward, two steps back” situation. I verified the api info…ironically…mine only had the 2 lines…so I figured “great, I’ll move to the next step”. I then entered my Pi’s IP address and as you stated…the wizard popped up. I went through it and configured a couple things. I then went to another computer and accessed it and my username and other data I entered was all there…good sign. I figured I would move on to the next step (I don’t have much hardware yet…I literally used your “shopping list” from your new install thread and all will be here tomorrow), but figured I could setup email info etc.I don’t use gmail, but figured I would configure using my regular email info. I copied and pasted your info from your thread and edited my outgoing smtp server info, username, password, and port etc. I saved and exited. I then did a "sudo supervisorctl restart kegbot:* and got some error messages stating it was stopping the processes…but when it went to start them back up I received messages stating several “spawn errors”. I then decided to go back into the local_settings.py file, but I get an error there too. I clearly did somethign wrong. So then I tried to just reinstall using " bash -c /home/pi/mypkgs/install.sh" and it went through the process fine with no errors. But when I enter the IP address into my browser I get a 502 bad gateway. When I restart, I get the same spawn errors. Any idea what I did or what I can do to fix short of redoing the stretch image and starting over? See attached images…thank you.Man, and I thought I was about to start asking you about the arduino board config…IMG_7198 IMG_7200


#11

@johnnyruz…I just went ahead and started form scratch again. I’m at the email dilemma. After that, I have my other hardware showing up tomorrow. Any suggestions? Thank you again.


#12

Take a very close look at your local_settings.py file and make sure the email settings are properly formatted. I tweaked my local_settings file so that it was invalid Python code and got the same error you are seeing.

The text information should be enclosed with a single-quote (aka apostrophe ’ ), the port number is just a number with no enclosing punctuation, and the True/False settings also don’t have any enclosing characters and start with a capital letter.

One other thing that could be helpful is to try to start the server manually so that you can see any debug and/or error information.

1. sudo supervisorctl stop kegbot:*
2. sudo su -l kegbot -c '/home/kegbot/kegbot-server.venv/bin/kegbot runserver'

If there is a problem in the file, the server will fail to start and you’ll get an error message that should point you in the right direction.

Once you resolve that and the server starts, you can kill it (CTRL + C) and then restart through Supervisor.

john


#13

@johnnyruz Thank you again John. Ok, progress. I figured out what my problem was. I was using putty for windows to ssh into my Pi. For some reason when copy/pasting into a terminal window via putty…it was changing a couple characters…and when I would try to edit them, it wouldn’t let me edit correct (for example, it was putting a - instead of = in some places. In any case, I have that fixed now and it seems to have taken all the settings. When I run a sudo supervisorctl restart kegbot:* everything checks out; however, I am still getting a error on the following line on restart: kegbot:kegbot_core: ERROR (spawn error) however everythign else checks out and even with that error I can access everything via my browser. So here are the next set of questions:

  • should I be concerned with that error? If so, what should I do to check?

  • in order to access my kegbot server from outside of my network, where to I access the setting to set the port the server is running on?

-I ordered all the supplies in your “shopping list”. What is a good resource to read up on how to get the arduino talking to the PI, how to assemble/configure the breadboard, flash the arduino and all that jazz?

Thanks again!


#14

Again, take a close look at your pycore-flags.txt file to make sure it’s properly formatted. I was able to get the SPAWN error if I messed up the formatting of the text in that file. Take a close look at my screenshot in a previous post and make sure it looks just like that, although you should have your own unique value after the ‘api_key’ variable.

The issue with characters changing through Putty is usually a keyboard configuration issue on the Pi. It defaults to the UK keyboard, so if you run sudo raspi-config you can update the Keyboard to English (US) and it should then correctly map the keystrokes.

The Kegbot Server itself is running locally on port 8000, but is accessible outside of the Pi via the installed Nginx proxy on the default HTTP port 80. You will need to setup port-forwarding on your router to enable incoming connections from the outside world to hit the server. If you want to change the port you can update the file /etc/nginx/sites-available/default and change the listen 80; line to a different port number. You’ll have to either reboot or run sudo service nginx restart for the change to take effect.

Finally, YouTube is the absolute best place for help with flashing an Arduino and working with the Arduino IDE. To connect with your Raspberry Pi, you just plug in via USB. This link https://kegbot.org/docs/kegboard/wiring/ shows the appropriate pin locations on the Arduino to connect your temperature/flow sensors etc.

john


#15

John…you are the kegbot Jedi. Thank you! My pycore-flags.txt file didn’t have the double slashes. I added those and it fixed that issue. I also changed the keyboard as suggested and that fixed that issues as well. I went into the nginx file and changed the listen port. I also forwarded that port to the Pi in my router. I have a no-ip hostname and was able to access the pi/kegbot from outside my network. I can’t thank you enough.

Now, I just have to read up on the Arduino, watch videos as you suggest and figure out how to wire in the flow sensor, temp sensor, flash it etc. I’ll try to quit bugging you. You’ve been so helpful!


#16

@johnnyruz I’ve got the arduino flashed and about to get everything connected. I saw in your instructions that you connected your two flow meters to pins d2 and d3. Based off of the pin map you linked me to, would d7 be where I wanted to connect the temp sensor? Thank you in advance (again)


#17

Pin 7 is perfect if you got the DS18b20 sensors. Make sure to use the 4.7k resistor for proper operation.

If you look in the kegboard_config.h file in the Arduino project the full pinout is listed there as well and you can re-assign pins if you like, but shouldn’t be necessary as the defaults should work fine.


#18

Right now in config.h it has #7 listed as "thermo onewir bus (1-wire, input/output) which seemed like the pin that would recognize the thermo, but I wasn’t sure…does that sound like the correct pre-configured pin?

I’ve got a 4.7k I’ll use. Thank you!


#19

Yep, the DS18b20 uses the 1-Wire protocol to report temperature to the Arduino


#20

Ok great, thank you. One other question (sick of me yet?). I’m trying to connect via my tablet. One initiating via the kegbot app, it prompts me to go to http://ipaddress/port/link which I do and I get a 404 error…so I can’t get any further in setting things up via the app. Any suggestions what I may need to do to proceed?