Kegberry and BrewPi on same Pi?

Hi Everyone,
I sent this to Mike and he suggested I post it here:

I was wiondering how I can run both kegberry and brewpi on the same RasberryPi. I spent a bunch of time this weekend trying to get kegberry to run on a unit that already had brewpi install. I could not get it to work so I downloaded the rasbian image you offer. My Pi would not boot that image. I tried using Win32Img in windows and again with Pifiller on OSX. I then gave up and started with a fresh wheezy install and got kegbot running. I was able to flash my Photon and the beta android app can see it. Awesome!! Then i tried to install brewpi and I get an error when I browse to http://my.ip/brewpi which is where I told it to install. The error is:

Request Method: GET Request URL: http://my.ip/brewpi

Using the URLconf defined in pykeg.web.urls, Django tried these URL patterns, in this order:

^api/(v1/)?
^account/
^accounts/
^kegadmin/
^link/?$
^setup/
^static\/(?P<path>.*)$
^media/(?P<path>.*)$
^ ^$ [name='kb-home']
^ ^stats/$ [name='kb-stats']
^ ^kegs/$ [name='kb-kegs']
^ ^kegs/(?P<keg_id>\d+)/?$ [name='kb-keg']
^ ^kegs/(?P<keg_id>\d+)/sessions/?$ [name='kb-keg-sessions']
^ ^fullscreen/?$ [name='kb-fullscreen']
^ ^drinkers/(?P<username>[\w@\.+\-_]+)/?$ [name='kb-drinker']
^ ^drinkers/(?P<username>[\w@\.+\-_]+)/sessions/?$ [name='kb-drinker-sessions']
^ ^drinks/(?P<drink_id>\d+)/?$ [name='kb-drink']
^ ^drink/(?P<drink_id>\d+)/?$
^ ^d/(?P<drink_id>\d+)/?$ [name='kb-drink-short']
^ ^session/(?P<session_id>\d+)/?$
^ ^s/(?P<session_id>\d+)/?$ [name='kb-session-short']
^ ^sessions/$ [name='kb-sessions']
^ ^sessions/(?P<year>\d{4})/$ [name='kb-sessions-year']
^ ^sessions/(?P<year>\d{4})/(?P<month>\d+)/$ [name='kb-sessions-month']
^ ^sessions/(?P<year>\d{4})/(?P<month>\d+)/(?P<day>\d+)/$ [name='kb-sessions-day']
^ ^sessions/(?P<year>\d+)/(?P<month>\d+)/(?P<day>\d+)/(?P<pk>\d+)/?$ [name='kb-session-detail']

The current URL, brewpi, didn’t match any of these.

I’ve looked for pykeg.web.urls and can’t find it at all. I found some old kegbot articles, but I don’t think they apply because I installed kegberry via the kegberry script.The paths in the articles I found do not exist in my installation.

Thank so so much for any help you can provide!!

I’ve managed to answer my own question(s) and create what I think is an awesome little beer related Pi. I’ve got Kegbot server running on the Pi, a Photon talking to my sensors and a tablet for display. I also have BrewPi talking to an esp-8266 wirelessly for fermentation control and have it talking to my Tilt Hydrometer. Used a Pi2a and Edimax WiFi / Bluetooth USB adapter.

The simple answer to my initial question is to simply reconfigure apache to listen on a different port. Install Kegberry first, BrewPi second. Reboot and Kegbot / Kegberry will bind to port 80, the Brewpi will bind to your new apache port and all will be well. Of course getting it all to run correctly took a LOT of trial and error. Anyone interested in a deeper explanation is free to ask.

Cheers!

1 Like

@cripplecreek I used your post as inspiration for a combined Kegbot/BrewPi server, but after weeks of troubleshooting I abandoned it. This is more of a cautionary post to anyone who attempts to do the same.

I noticed in your setup description that you have no physical connection to the server (no USB connections), only wifi/bluetooth. That is key. In my setup, I initially used some wifi and some USB connections to my RaspberryPi (because of sensor proximity, mounting, etc). The legacy BrewPi software does not have any sort of serial protocol error-checking or fault tolerance. As a result, if any serial data is transmitted on a serial line, BrewPi tries to read it – so when KegBoard data is sent over serial, BrewPi chokes randomly.

It took me weeks to determine why there were random failures with BrewPi. I suspected bad USB cables, underpowered hubs, faulty sensors… everything. Until I removed KegBot, and then everything worked perfectly.

Bottom line, if KegBot and BrewPi are physically on the same machine and there is a connection to the serial port, you cannot run both at the same time (or you do so at your own peril). If you implement a combined setup, it must be wireless with no physical serial connection. I learned this the hard way.

Thats pretty cool, are you using brewpiless on the esp modules?