Idiots Guide Using Docker to install BrewPi on Spark3


#21

Did you include --privileged when you created the container?


#22

Yes. But did docker run -d --name brewpi -p 80:80 -p 81:81 -v ~/brewpi-data:/data -v /etc/timezone:/etc/timezone -v /etc/localtime:/etc/localtime --restart always brewpi/brewpi-raspbian first.


#23

So I tried skipped the step docker run -d --name brewpi -p 80:80 -p 81:81 -v ~/brewpi-data:/data -v /etc/timezone:/etc/timezone -v /etc/localtime:/etc/localtime --restart always brewpi/brewpi-raspbian

and only did

docker run -d --name brewpi -p 80:80 -p 81:81 --privileged -v ~/brewpi-data:/data -v /etc/timezone:/etc/timezone -v /etc/localtime:/etc/localtime --restart always brewpi/brewpi-raspbian

after I created the container with
docker pull brewpi/brewpi-raspbian

and it still can’t connect using USB


#24

Thanks for the bug report. I have identified the issue.

For some reason the serial ports inside the container are not owned by the dialout group.

I will update the container to run the scripts as the root user and not the brewpi user.
There is no need for the brewpi user inside the docker container, because it is isolated anyway.

As a fix until I have updated the container:

enter your containter from the pi command line:

docker exec -it brewpi bash

edit watcher.sh:

nano /watcher.sh

remove sudo -u brewpi from the commands.
The script will then run as root. Restart the container to use the changes.

I’ll try to push a new container ASAP, but don’t have time in the next few hours.


#25

I edited the watcher.sh and still have the same problem. I guess I have to wait until you you push a New Container out.


#26

Done. Go to the container in portainer and click ‘recreate’.
Leave ‘Pull the latest image.’ enabled.


#27

I hate to say this but It’s still not connecting to USB.


#28

Can you check for erros the log file? You can view in with the web interface.
And can you set the port to auto in the maintenance panel?

If it doesn’t work, can you show the output of running these 3 commands on the pi:

ls -ahl /dev/ttyA*
docker exec brewpi ls -ahl /dev/ttyA*
docker exec brewpi git log

The first lists serial ports on the pi, the second serial ports inside the container and the third shows the latest commit in the script dir, which should be 00957ff58df74a82e0d25420d006c26c08cb3950.


#29

There is no setting for AUTO in the maintenance panel. Just SERIAL PORT & IP ADDRESS.
Here’s the output from the 3 commands:
pi@raspberrypi:~ $ ls -ahl /dev/ttyA*
crw-rw---- 1 root dialout 166, 0 Mar 18 11:29 /dev/ttyACM0
crw-rw---- 1 root dialout 204, 64 Mar 18 11:29 /dev/ttyAMA0
pi@raspberrypi:~ $ docker exec brewpi ls -ahl /dev/ttyA*
crw-rw---- 1 root root 166, 0 Mar 18 11:40 /dev/ttyACM0
crw-rw---- 1 root root 204, 64 Mar 18 11:40 /dev/ttyAMA0
pi@raspberrypi:~ $ docker exec brewpi git log
commit 00957ff58df74a82e0d25420d006c26c08cb3950
Author: Elco Jacobs elco@brewpi.com
Date: Sun Mar 18 15:03:27 2018 +0100

print errors once when opening serial

#30

and here is the LOG:

Mar 17 2018 22:18:20 Notification: Script started for beer ‘My First BrewPi Run’
Mar 17 2018 22:18:20 Connecting to controller…
Mar 17 2018 22:18:20 Background thread for serial started
Mar 17 2018 22:18:30 Warning: Cannot receive version number from controller. Check your port setting in the Maintenance Panel or in settings/config.cfg.
Mar 17 2018 22:19:18 Socket error(32): Broken pipe
Traceback (most recent call last):
File “/home/brewpi/brewpi.py”, line 682, in
conn.send(“Cannot communicate with BrewPi Spark”)
error: [Errno 32] Broken pipe
Mar 17 2018 22:24:04 Notification: Script started for beer ‘My First BrewPi Run’
Mar 17 2018 22:24:04 Connecting to controller…
Mar 17 2018 22:24:04 Background thread for serial started
Mar 17 2018 22:24:14 Warning: Cannot receive version number from controller. Check your port setting in the Maintenance Panel or in settings/config.cfg.
Mar 17 2018 22:27:12 Notification: Script started for beer ‘My First BrewPi Run’
Mar 17 2018 22:27:12 Connecting to controller…
Mar 17 2018 22:27:12 Background thread for serial started
Mar 17 2018 22:27:22 Warning: Cannot receive version number from controller. Check your port setting in the Maintenance Panel or in settings/config.cfg.
Mar 18 2018 00:00:00 Notification: New day, creating new JSON file.
Mar 18 2018 08:37:11 Notification: Script started for beer ‘My First BrewPi Run’
Mar 18 2018 08:37:11 Connecting to controller…
Mar 18 2018 08:37:11 Background thread for serial started
Mar 18 2018 08:37:21 Warning: Cannot receive version number from controller. Check your port setting in the Maintenance Panel or in settings/config.cfg.
Mar 18 2018 08:39:37 Port setting changed to:
Mar 18 2018 08:39:38 Background thread for serial stopped
Mar 18 2018 08:39:38 Background thread for serial started
Mar 18 2018 08:39:40 Port setting changed to:
Mar 18 2018 08:39:40 Background thread for serial stopped
Mar 18 2018 08:39:40 Background thread for serial started
Mar 18 2018 08:53:05 Notification: Script started for beer ‘My First BrewPi Run’
Mar 18 2018 08:53:05 Connecting to controller…
Mar 18 2018 08:53:05 Background thread for serial started
Mar 18 2018 08:53:15 Warning: Cannot receive version number from controller. Check your port setting in the Maintenance Panel or in settings/config.cfg.
Mar 18 2018 08:56:40 Notification: Script started for beer ‘My First BrewPi Run’
Mar 18 2018 08:56:40 Connecting to controller…
Mar 18 2018 08:56:40 Background thread for serial started
Mar 18 2018 08:56:50 Warning: Cannot receive version number from controller. Check your port setting in the Maintenance Panel or in settings/config.cfg.
Mar 18 2018 08:57:38 Notification: Script started for beer ‘My First BrewPi Run’
Mar 18 2018 08:57:38 Connecting to controller…
Mar 18 2018 08:57:38 Background thread for serial started
Mar 18 2018 08:57:48 Warning: Cannot receive version number from controller. Check your port setting in the Maintenance Panel or in settings/config.cfg.
Mar 18 2018 08:58:47 stopScript message received on socket. Stopping script and writing dontrunfile to prevent automatic restart
Mar 18 2018 08:58:48 Background thread for serial stopped
Mar 18 2018 08:59:19 Notification: Script started for beer ‘My First BrewPi Run’
Mar 18 2018 08:59:19 Connecting to controller…
Mar 18 2018 08:59:19 Background thread for serial started
Mar 18 2018 08:59:29 Warning: Cannot receive version number from controller. Check your port setting in the Maintenance Panel or in settings/config.cfg.
Mar 18 2018 09:11:56 Notification: Script started for beer ‘My First BrewPi Run’
Mar 18 2018 09:11:56 Connecting to controller…
Mar 18 2018 09:11:56 Background thread for serial started
Mar 18 2018 09:12:06 Warning: Cannot receive version number from controller. Check your port setting in the Maintenance Panel or in settings/config.cfg.
Mar 18 2018 11:21:40 Notification: Script started for beer ‘My First BrewPi Run’
Mar 18 2018 11:21:40 Connecting to controller…
Mar 18 2018 11:21:40 Background thread for serial started
Mar 18 2018 11:21:40 Error opening serial: [Errno 2] could not open port : [Errno 2] No such file or directory: ‘’
Mar 18 2018 11:21:50 Warning: Cannot receive version number from controller. Check your port setting in the Maintenance Panel or in settings/config.cfg.
Mar 18 2018 11:22:23 stopScript message received on socket. Stopping script and writing dontrunfile to prevent automatic restart
Mar 18 2018 11:22:23 Background thread for serial stopped
Mar 18 2018 11:25:33 Notification: Script started for beer ‘My First BrewPi Run’
Mar 18 2018 11:25:33 Connecting to controller…
Mar 18 2018 11:25:33 Background thread for serial started
Mar 18 2018 11:25:33 Error opening serial: [Errno 2] could not open port : [Errno 2] No such file or directory: ‘’
Mar 18 2018 11:25:43 Warning: Cannot receive version number from controller. Check your port setting in the Maintenance Panel or in settings/config.cfg.
Mar 18 2018 11:28:32 stopScript message received on socket. Stopping script and writing dontrunfile to prevent automatic restart
Mar 18 2018 11:28:33 Background thread for serial stopped
Mar 18 2018 11:35:05 Notification: Script started for beer ‘My First BrewPi Run’
Mar 18 2018 11:35:05 Connecting to controller…
Mar 18 2018 11:35:05 Background thread for serial started
Mar 18 2018 11:35:05 Error opening serial: [Errno 2] could not open port : [Errno 2] No such file or directory: ‘’
Mar 18 2018 11:35:15 Warning: Cannot receive version number from controller. Check your port setting in the Maintenance Panel or in settings/config.cfg.
Mar 18 2018 11:40:35 Notification: Script started for beer ‘My First BrewPi Run’
Mar 18 2018 11:40:35 Connecting to controller…
Mar 18 2018 11:40:35 Background thread for serial started
Mar 18 2018 11:40:35 Error opening serial: [Errno 2] could not open port : [Errno 2] No such file or directory: ‘’
Mar 18 2018 11:40:45 Warning: Cannot receive version number from controller. Check your port setting in the Maintenance Panel or in settings/config.cfg.
Mar 18 2018 11:51:56 Port setting changed to:
Mar 18 2018 11:51:56 Background thread for serial stopped
Mar 18 2018 11:51:56 Background thread for serial started
Mar 18 2018 11:52:09 Notification: Beer temperature set to 20.0 degrees in web interface
Mar 18 2018 11:52:09 Notification: Beer temperature set to 20.0 degrees in web interface


#31

Select serial and enter auto in the field


#32

OMG! That worked! Thanks you!


#33

I have everything set up and now I get “Error Saving Profile!” when i try to create a new beer profile.
Any suggestions?


#34

I’ve run into this before. One thing that seems to help is using the ‘Tab’ key to switch between cells rather than trying to click in the blank cells I want to edit to select them. This hasn’t helped with saving profiles already experiencing the error, but if I start a new profile and only use the tab key I seem to avoid it.


#35

Still Get the “Error Saving Profile!”

Elco, is this a bug in the software?


#36

As an example, here is an example of a save profile submission that results in the error:

name: us-05
profile: date,temperature,days 2018-03-17T21:41:23,18,0 2018-03-19T21:41:23,18,2 2018-03-21T21:41:23,19,4 2018-03-23T21:41:23,19,6 2018-03-25T21:41:23,20,8 2018-03-29T14:29:22,20,11.7 2018-03-31T21:41:23,12,14

The edit I tried to make was changing the original second to last entry:

2018-03-29T14:29:22,20,12

to

2018-03-29T14:29:22,20,11.7