How to remove certain previous beers?

My BrewPi has been acting up lately. Among other things, the time it takes to export the current beer to CSV has gone way up. This used to be effectively an immediate download but can now take 1+ minutes and sometimes doesn’t even complete.

In fact I have a pretty solid repro case where if I take an otherwise well-behaved BrewPi and ask for a refreshed main graph and then a CSV download prior to the graph being replotted, the Pi’s web page eventually becomes unresponsive and the IP address no longer returning pings on my home network, forcing me to go and do a cold restart of both Spark and Pi. The Pi can run fine for days prior to becoming unresponsive with these steps, so I can’t believe that it ‘going dark’ is 100% coincidental.

The first thing I want to do in addressing this issue is get rid of old JSON data. What is the location of the logged data, and is it just a case of deleting any files written / touched on some specific dates? I’d rather root out specific beers if that’s possible. Some of my logged beers are less important than others.

p.s. the Pi is on a reserved IP address within my LAN, so I don’t have a reason to suspect this is related to IP routing issues

p.p.s. I have tried to remove entire directories from /home/brewpi/data using “rm -r …”, but this doesn’t seem to cause the data to actually go away. By that I mean that I can still see the deleted beer in the dropdown of previous beers, refreshing the browser page doesn’t cause the line item to disappear from the dropdown, and I can still download the relevant CSV data.


The data is copied to the web directory, you’ll have to remove it there too.

Do you start a new data set for each beer? (By clicking on the beer name under the logo).

You might also want to reduce the data logging interval to limit the amount of data you are generating.

Yes, I do start a new data set that way for each new fermentation. Is there a change I should make to my workflow which would decrease the likelihood of this (theoretic) problem?

Actually, now that I think about it: downloading the CSV file should be almost instant. It is already on sitting on the web server, it only needs to be downloaded.

if you run top, what is reported as the load average?

Also check if our file system is not full:

df -h

Also try updating your packages:

sudo apt-get update
sudo apt-get dist-upgrade

And do a reboot.

Here is the output from “top”

top - 19:58:55 up 12:38, 1 user, load average: 0.09, 0.14, 0.13
Tasks: 77 total, 2 running, 75 sleeping, 0 stopped, 0 zombie
%Cpu(s): 4.8 us, 2.4 sy, 0.0 ni, 92.8 id, 0.0 wa, 0.0 hi, 0.0 si, 0.0 st
KiB Mem: 445772 total, 187944 used, 257828 free, 81880 buffers
KiB Swap: 102396 total, 0 used, 102396 free, 61264 cached

Here is the output from “df -h”

Filesystem Size Used Avail Use% Mounted on
rootfs 5.6G 3.8G 1.6G 72% /
/dev/root 5.6G 3.8G 1.6G 72% /
devtmpfs 214M 0 214M 0% /dev
tmpfs 44M 248K 44M 1% /run
tmpfs 5.0M 0 5.0M 0% /run/lock
tmpfs 88M 0 88M 0% /run/shm
/dev/mmcblk0p5 60M 19M 41M 33% /boot

Nothing strange in there…


+1 to the set of issues & weird behavior caused by a substandard source of AC power. Today I noticed that the Spark’s touchscreen UI seemed to be flickering ever so slightly, which I’ve not seen before. Given that the Spark currently gets its power over USB cable from one of the Pi’s USB ports, I decided to start from the AC outlet and replace cables.

I reverted to the 2A Universal power supply which came in my original BrewPi store order, which I abandoned a while back because of its inconvenient girth & shape. But sure enough, with the 2A supply the system seems a lot more stable.

Another observation: occasionally when rebooting the Pi, the Spark would flash intermittently and otherwise do nothing, instead of going quickly through its power-up sequence. I had always put this down to quirky board behavior. If others see this kind of power-up in their Spark then you should consider AC power as the root cause.

:slight_smile: Thanks for clearing this up.
Bad Raspberry Pi power supply strikes again!

A reminder to all: phone chargers and Chinese chargers are generally crap!

Any plans to add a web interface to delete unwanted logs?

No, we’re working on an entirely new web interface and will focus our efforts there.
You can cd into /var/www/data to remove the files.

In the next version, we will probably log sensor data continuously and a brew will just be a subset of the data between two dates.

The logging of my brewpi has also been acting up (load same (stopped) beer log upon reboot) and I tried removing both logged data and beer profiles in the hope that it would resolve it.

Cd to proper folders first (cd /home/brewpi/data ; cd /var/www/html/data; cd /var/www/html/data/profiles) then remove data with rm -rf folder_name. Files are owned by brewpi or www-data. I run brewpi 0.4.4 with tilt integration.

However, as soon as I reboot the system, all of the data pops back into place. Sudo’ing the command does not help, as well as stopping the script, removing files and rebooting. What can I do more?

Also remove them from /home/pi/brewpi/data, the files are stored by python there and copied to the web dir. If I remember it correctly, it has been 5 years since I worked on or used the Arduino version.

Hi Elco, thanks for the quick reply! I see that I don’t have a folder /home/pi/brewpi/data; I think I installed the files one folder above so that the files are in /home/brewpi/data. Is there another location I could find a possible source files?

In case of completeness, all the files/folders in /home/pi are: .AppleDB, .AppleDesktop, .AppleDouble, .Xauthority, .asoundrc, .bash_history, .bash_logout, .bashrc, .cache, .config, .dbus, .gconf, .gstreamer-0.10, .local, .pki, .profile, .selected_editor, .themes, .viminfo, .xsession-errors, .xsession-errors.old, Desktop, Documents, Downloads, Music, Network Trash Folder, Pictures, Public, Templates, Temporary Items, Videos, beer-chart.js, brewpi-tools, install.log, installfilesbrewometer, python_games

That’s it. You should see the same files as the ones you deleted from the web directory.

I indeed see the same files as in the web directory, but even if I delete them, and I do a reboot, I see the same files appear. Does this mean that the removal itself is not really working (sudo rm -rf folder_name)? I don’t see the folders anymore if I run the command and run ls -la, but they reappear after reboot. Or would this mean something is wrong with the SD card (as a source online tells me)?

Remove the files you don’t want from both directories (home and www data). And always start a new beer from the web UI for each brew.

Thanks again for the quick answer! That’s what I’ve been doing, but they reappear in both folders, oddly! I’ve started each new brew from the web interface.

Perhaps my latest finding helps someone else: by updating to brewblox yesterday I found out that the SD card was corrupted and that I could not install / write anything. So that’s what prevented my to start something really new!

1 Like

Exhausted SD cards go in read only mode to prevent data loss. This can make it harder to pinpoint that they need to b replaced.

1 Like