Help, my "brewpi" freezes

Hello,
Hi, I’ll explain what my system is installed first.
My system is a temperature controlled fermentation chamber with brewpi with a raspberry pi + arduino one UNOR3 MEGA328P plate. the arduino board is powered by usb through the brewpi.
The system worked well for more than a year. In the last summer I had a problem with the sd card and did not have a backup copy.
I bought a new sd card and reinstalled the system. Due to the new updates, the new system has to work with the legacy mode. I install firmware 0_2_10.hex, I configure the probes and the system works again.
After the first fermentation of the next batch, I leave the system connected but without doing any work. After a few days I notice that the system no longer works. It does not recognize the probes. I’m an idiot and once again I have not backed the SD.
I reinstall the system and this time I do a backup. The equipment works again. but after 10 days of operation approximately (7 days of fermentation plus 3 lowering the temperature to 2º) the problem happens again. I do not understand what happens. Everything seems to be fine, the raspberry works, I can access it through ssh and I can also access the brewpi page by html. I do not receive data from the probes nor does the system find any other device.

If I refresh on the “device configuration” screen, the response is an error message: Error while receiving devide configuration: Syntax Error: Unexpected token C in JSON at position 0 "

I have not been able to reprogram either. I get this error …

My temporary solution has been to restore the backup in the SD. In this way everything comes back to work directly.
The big problem is that this keeps happening in each fermentation. I can only think of one thing. Maybe the problem is that after so many days saving data from the fermentation, the system generates a file too large. It is an idea only. My knowledge of Linux is almost 0 and I do not know how to check it. Can anybody help me?
blau

You’ll get that error when the script is not running. The error is incorrectly interpreted as JSON.
Check the log to see why the script is not starting after is stopped.

And make sure you have a good power supply for the pi. A phone charger is not a good power supply.

Thanks for the reply.
Can you tell me how to check the log, to check it in the next crisis?
I think I have an old PC power supply. I’m going to try to use it to power the system. I read “[SOLVED] Freezing with “scrip running” heater stuck on” and I see that I also had feeding problems. Although in my case the raspberry is still working.

Yes, nothing really froze in your case, but the script just crashed and is not automatically restarted I think. You can run the updateCron.sh script, maybe that helps.
There is a log tab in the web interface and the logs are in /home/brewpi/logs.

Thanks elco, I can see the log files in the web interface and in its own directory.
I can not attach the file “stderr.txt” is too large (1.81M) I copy next the last part of the text, I am not able to interpret it well. If you need the whole file tell me where I sent it to you.
Ramon
Traceback (most recent call last):
File “/home/brewpi/brewpi.py”, line 415, in
startBeer(config[‘beerName’])
File “/home/brewpi/brewpi.py”, line 287, in startBeer
setFiles()
File “/home/brewpi/brewpi.py”, line 273, in setFiles
brewpiJson.newEmptyFile(localJsonFileName)
File “/home/brewpi/brewpiJson.py”, line 109, in newEmptyFile
jsonFile = open(jsonFileName, “w”)
IOError: [Errno 28] No space left on device: '/home/brewpi/data/norauch/norauch-2017-12-06.json’
Exception in thread Thread-1 (most likely raised during interpreter shutdown):
Traceback (most recent call last):
File “/usr/lib/python2.7/threading.py”, line 801, in __bootstrap_inner
File “/usr/lib/python2.7/threading.py”, line 754, in run
File “/home/brewpi/backgroundserial.py”, line 81, in __listenThread
File “/usr/local/lib/python2.7/dist-packages/serial/serialutil.py”, line 590, in inWaiting
File “/usr/local/lib/python2.7/dist-packages/serial/serialposix.py”, line 467, in in_waiting
<type ‘exceptions.AttributeError’>: ‘NoneType’ object has no attribute 'ioctl’
Dec 06 2017 17:52:09 Opening serial port
Dec 06 2017 17:52:09 Notification: Script started for beer 'norauch’
Dec 06 2017 17:52:19 Checking software version on controller…
Dec 06 2017 17:52:19 Found BrewPi v0.2.10 build unknown, running on an Arduino Uno with a revA shield on port /dev/ttyUSB0

Traceback (most recent call last):
File “/home/brewpi/brewpi.py”, line 415, in
startBeer(config[‘beerName’])
File “/home/brewpi/brewpi.py”, line 287, in startBeer
setFiles()
File “/home/brewpi/brewpi.py”, line 273, in setFiles
brewpiJson.newEmptyFile(localJsonFileName)
File “/home/brewpi/brewpiJson.py”, line 109, in newEmptyFile
jsonFile = open(jsonFileName, “w”)
IOError: [Errno 28] No space left on device: '/home/brewpi/data/norauch/norauch-2017-12-06.json’
Exception in thread Thread-1 (most likely raised during interpreter shutdown):
Traceback (most recent call last):
File “/usr/lib/python2.7/threading.py”, line 801, in __bootstrap_inner
File “/usr/lib/python2.7/threading.py”, line 754, in run
File “/home/brewpi/backgroundserial.py”, line 81, in __listenThread
File “/usr/local/lib/python2.7/dist-packages/serial/serialutil.py”, line 590, in inWaiting
File “/usr/local/lib/python2.7/dist-packages/serial/serialposix.py”, line 467, in in_waiting
<type ‘exceptions.AttributeError’>: ‘NoneType’ object has no attribute 'ioctl’
Dec 06 2017 17:53:09 Opening serial port
Dec 06 2017 17:53:09 Notification: Script started for beer 'norauch’
Dec 06 2017 17:53:19 Checking software version on controller…
Dec 06 2017 17:53:19 Found BrewPi v0.2.10 build unknown, running on an Arduino Uno with a revA shield on port /dev/ttyUSB0

Traceback (most recent call last):
File “/home/brewpi/brewpi.py”, line 415, in
startBeer(config[‘beerName’])
File “/home/brewpi/brewpi.py”, line 287, in startBeer
setFiles()
File “/home/brewpi/brewpi.py”, line 273, in setFiles
brewpiJson.newEmptyFile(localJsonFileName)
File “/home/brewpi/brewpiJson.py”, line 109, in newEmptyFile
jsonFile = open(jsonFileName, “w”)
IOError: [Errno 28] No space left on device: '/home/brewpi/data/norauch/norauch-2017-12-06.json’
Exception in thread Thread-1 (most likely raised during interpreter shutdown):
Traceback (most recent call last):
FilBrewPi: wifiChecker: Attempt 1 to reach 192.168.0.1 failed (mié dic 6 18:00:12 CET 2017)
BrewPi: wifiChecker: Attempt 2 to reach 192.168.0.1 failed (mié dic 6 18:00:37 CET 2017)
BrewPi: wifiChecker: Unable to reach router. Restarting wlan0 interface… (mié dic 6 18:01:02 CET 2017)
ifdown: interface wlan0 not configured
RTNETLINK answers: File exists
ifup: failed to bring up wlan0
Dec 06 2017 18:01:09 Opening serial port
Dec 06 2017 18:01:09 Notification: Script started for beer 'norauch’
Dec 06 2017 18:01:19 Checking software version on controller…
Dec 06 2017 18:01:20 Found BrewPi v0.2.10 build unknown, running on an Arduino Uno with a revA shield on port /dev/ttyUSB0

Traceback (most recent call last):
File “/home/brewpi/brewpi.py”, line 415, in
startBeer(config[‘beerName’])
File “/home/brewpi/brewpi.py”, line 287, in startBeer
setFiles()
File “/home/brewpi/brewpi.py”, line 273, in setFiles
brewpiJson.newEmptyFile(localJsonFileName)
File “/home/brewpi/brewpiJson.py”, line 109, in newEmptyFile
jsonFile = open(jsonFileName, “w”)
IOError: [Errno 28] No space left on device: '/home/brewpi/data/norauch/norauch-2017-12-06.json’
Exception in thread Thread-1 (most likely raised during interpreter shutdown):
Traceback (most recent call last):
File “/usr/lib/python2.7/threading.py”, line 801, in __bootstrap_inner
File “/usr/lib/python2.7/threading.py”, line 754, in run
File “/home/brewpi/backgroundserial.py”, line 91, in __listenThread
File “/home/brewpi/backgroundserial.py”, line 114, in __get_line_from_buffer
File “/home/brewpi/expandLogMessage.py”, line 116, in filterOutLogMessages
File “/usr/lib/python2.7/re.py”, line 194, in compile
File “/usr/lib/python2.7/re.py”, line 249, in _compile
File “/usr/lib/python2.7/sre_compile.py”, line 576, in compile
File “/usr/lib/python2.7/sre_compile.py”, line 558, in _code
File “/usr/lib/python2.7/sre_compile.py”, line 437, in _compile_info
File “/usr/lib/python2.7/sre_parse.py”, line 177, in getwidth
File “/usr/lib/python2.7/sre_parse.py”, line 185, in getwidth
<type ‘exceptions.TypeError’>: unsupported operand type(s) for -: ‘NoneType’ and 'int’
Dec 06 2017 18:02:08 Opening serial port
Dec 06 2017 18:02:08 Notification: Script started for beer 'norauch’
Dec 06 2017 18:02:18 Checking software version on controller…
Dec 06 2017 18:02:18 Found BrewPi v0.2.10 build unknown, running on an Arduino Uno with a revA shield on port /dev/ttyUSB0

Traceback (most recent call last):
File “/home/brewpi/brewpi.py”, line 415, in
startBeer(config[‘beerName’])
File “/home/brewpi/brewpi.py”, line 287, in startBeer
setFiles()
File “/home/brewpi/brewpi.py”, line 273, in setFiles
brewpiJson.newEmptyFile(localJsonFileName)
File “/home/brewpi/brewpiJson.py”, line 109, in newEmptyFile
jsonFile = open(jsonFileName, “w”)
IOError: [Errno 28] No space left on device: '/home/brewpi/data/norauch/norauch-2017-12-06.json’
Exception in thread Thread-1 (most likely raised during interpreter shutdown):
Traceback (most recent call last):
File “/usr/lib/python2.7/threading.py”, line 801, in __bootstrap_inner
File “/usr/lib/python2.7/threading.py”, line 754, in run
File “/home/brewpi/backgroundserial.py”, line 81, in __listenThread
File “/usr/local/lib/python2.7/dist-packages/serial/serialutil.py”, line 590, in inWaiting
File “/usr/local/lib/python2.7/dist-packages/serial/serialposix.py”, line 467, in in_waiting
<type ‘exceptions.AttributeError’>: ‘NoneType’ object has no attribute 'ioctl’
Dec 06 2017 18:03:09 Opening serial port
Dec 06 2017 18:03:09 Notification: Script started for beer 'norauch’
Dec 06 2017 18:03:19 Checking software version on controller…
Dec 06 2017 18:03:19 Found BrewPi v0.2.10 build unknown, running on an Arduino Uno with a revA shield on port /dev/ttyUSB0

Traceback (most recent call last):
File “/home/brewpi/brewpi.py”, line 415, in
startBeer(config[‘beerName’])
File “/home/brewpi/brewpi.py”, line 287, in startBeer
setFiles()
FiBrewPi: wifiChecker: Attempt 1 to reach 192.168.0.1 failed (mié dic 6 18:10:12 CET 2017)
BrewPi: wifiChecker: Attempt 2 to reach 192.168.0.1 failed (mié dic 6 18:10:37 CET 2017)
BrewPi: wifiChecker: Unable to reach router. Restarting wlan0 interface… (mié dic 6 18:11:02 CET 2017)
ifdown: interface wlan0 not configured
RTNETLINK answers: File exists
ifup: failed to bring up wlan0
Dec 06 2017 18:11:10 Opening serial port
Dec 06 2017 18:11:10 Notification: Script started for beer 'norauch’
Dec 06 2017 18:11:20 Checking software version on controller…
Dec 06 2017 18:11:20 Found BrewPi v0.2.10 build unknown, running on an Arduino Uno with a revA shield on port /dev/ttyUSB0

Traceback (most recent call last):
File “/home/brewpi/brewpi.py”, line 415, in
startBeer(config[‘beerName’])
File “/home/brewpi/brewpi.py”, line 287, in startBeer
setFiles()
File “/home/brewpi/brewpi.py”, line 273, in setFiles
brewpiJson.newEmptyFile(localJsonFileName)
File “/home/brewpi/brewpiJson.py”, line 109, in newEmptyFile
jsonFile = open(jsonFileName, “w”)
IOError: [Errno 28] No space left on device: '/home/brewpi/data/norauch/norauch-2017-12-06.json’
Exception in thread Thread-1 (most likely raised during interpreter shutdown):
Traceback (most recent call last):
File “/usr/lib/python2.7/threading.py”, line 801, in __bootstrap_inner
File “/usr/lib/python2.7/threading.py”, line 754, in run
File “/home/brewpi/backgroundserial.py”, line 81, in __listenThread
File “/usr/local/lib/python2.7/dist-packages/serial/serialutil.py”, line 590, in inWaiting
File “/usr/local/lib/python2.7/dist-packages/serial/serialposix.py”, line 467, in in_waiting
<type ‘exceptions.AttributeError’>: ‘NoneType’ object has no attribute 'ioctl’
Dec 06 2017 18:12:09 Opening serial port
Dec 06 2017 18:12:09 Notification: Script started for beer 'norauch’
Dec 06 2017 18:12:19 Checking software version on controller…
Dec 06 2017 18:12:19 Found BrewPi v0.2.10 build unknown, running on an Arduino Uno with a revA shield on port /dev/ttyUSB0

Traceback (most recent call last):
File “/home/brewpi/brewpi.py”, line 415, in
startBeer(config[‘beerName’])
File “/home/brewpi/brewpi.py”, line 287, in startBeer
setFiles()
File “/home/brewpi/brewpi.py”, line 273, in setFiles
brewpiJson.newEmptyFile(localJsonFileName)
File “/home/brewpi/brewpiJson.py”, line 109, in newEmptyFile
jsonFile = open(jsonFileName, “w”)
IOError: [Errno 28] No space left on device: '/home/brewpi/data/norauch/norauch-2017-12-06.json’
Exception in thread Thread-1 (most likely raised during interpreter shutdown):
Traceback (most recent call last):
File “/usr/lib/python2.7/threading.py”, line 801, in __bootstrap_inner
File “/usr/lib/python2.7/threading.py”, line 754, in run
File “/home/brewpi/backgroundserial.py”, line 81, in __listenThread
File “/usr/local/lib/python2.7/dist-packages/serial/serialutil.py”, line 590, in inWaiting
File “/usr/local/lib/python2.7/dist-packages/serial/serialposix.py”, line 467, in in_waiting
<type ‘exceptions.AttributeError’>: ‘NoneType’ object has no attribute 'ioctl’
Dec 06 2017 18:13:08 Opening serial port
Dec 06 2017 18:13:08 Notification: Script started for beer 'norauch’
Dec 06 2017 18:13:18 Checking software version on controller…
Dec 06 2017 18:13:19 Found BrewPi v0.2.10 build unknown, running on an Arduino Uno with a revA shield on port /dev/ttyUSB0

Traceback (most recent call last):
File “/home/brewpi/brewpi.py”, line 415, in
startBeer(config[‘beerName’])
File “/home/brewpi/brewpi.py”, line 287, in startBeer
setFiles()
File “/home/brewpi/brewpi.py”, line 273, in setFiles
brewpiJson.newEmptyFile(localJsonFileName)
File “/home/brewpi/brewpiJson.py”, line 109, in newEmptyFile
jsonFile = open(jsonFileName, “w”)
IOError: [Errno 28] No space left on device: '/home/brewpi/data/norauch/norauch-2017-12-06.json’
Exception in thread Thread-1 (most likely raised during interpreter shutdown):
Traceback (most recent call last):
FilBrewPi: wifiChecker: Attempt 1 to reach 192.168.0.1 failed (mié dic 6 18:20:11 CET 2017)
BrewPi: wifiChecker: Attempt 2 to reach 192.168.0.1 failed (mié dic 6 18:20:36 CET 2017)
BrewPi: wifiChecker: Unable to reach router. Restarting wlan0 interface… (mié dic 6 18:21:01 CET 2017)
ifdown: interface wlan0 not configured
RTNETLINK answers: File exists
ifup: failed to bring up wlan0
Dec 06 2017 18:21:09 Opening serial port
Dec 06 2017 18:21:09 Notification: Script started for beer 'norauch’
Dec 06 2017 18:21:19 Checking software version on controller…
Dec 06 2017 18:21:19 Found BrewPi v0.2.10 build unknown, running on an Arduino Uno with a revA shield on port /dev/ttyUSB0

Traceback (most recent call last):
File “/home/brewpi/brewpi.py”, line 415, in
startBeer(config[‘beerName’])
File “/home/brewpi/brewpi.py”, line 287, in startBeer
setFiles()
File “/home/brewpi/brewpi.py”, line 273, in setFiles
brewpiJson.newEmptyFile(localJsonFileName)
File “/home/brewpi/brewpiJson.py”, line 109, in newEmptyFile
jsonFile = open(jsonFileName, “w”)
IOError: [Errno 28] No space left on device: '/home/brewpi/data/norauch/norauch-2017-12-06.json’
Exception in thread Thread-1 (most likely raised during interpreter shutdown):
Traceback (most recent call last):
File “/usr/lib/python2.7/threading.py”, line 801, in __bootstrap_inner
File “/usr/lib/python2.7/threading.py”, line 754, in run
File “/home/brewpi/backgroundserial.py”, line 81, in __listenThread
File “/usr/local/lib/python2.7/dist-packages/serial/serialutil.py”, line 590, in inWaiting
File “/usr/local/lib/python2.7/dist-packages/serial/serialposix.py”, line 467, in in_waiting
<type ‘exceptions.AttributeError’>: ‘NoneType’ object has no attribute 'ioctl’
Dec 06 2017 18:22:08 Opening serial port
Dec 06 2017 18:22:08 Notification: Script started for beer 'norauch’
Dec 06 2017 18:22:18 Checking software version on controller…
Dec 06 2017 18:22:18 Found BrewPi v0.2.10 build unknown, running on an Arduino Uno with a revA shield on port /dev/ttyUSB0

Traceback (most recent call last):
File “/home/brewpi/brewpi.py”, line 415, in
startBeer(config[‘beerName’])
File “/home/brewpi/brewpi.py”, line 287, in startBeer
setFiles()
File “/home/brewpi/brewpi.py”, line 273, in setFiles
brewpiJson.newEmptyFile(localJsonFileName)
File “/home/brewpi/brewpiJson.py”, line 109, in newEmptyFile
jsonFile = open(jsonFileName, “w”)
IOError: [Errno 28] No space left on device: '/home/brewpi/data/norauch/norauch-2017-12-06.json’
Exception in thread Thread-1 (most likely raised during interpreter shutdown):
Traceback (most recent call last):
File “/usr/lib/python2.7/threading.py”, line 801, in __bootstrap_inner
File “/usr/lib/python2.7/threading.py”, line 754, in run
File “/home/brewpi/backgroundserial.py”, line 81, in __listenThread
File “/usr/local/lib/python2.7/dist-packages/serial/serialutil.py”, line 590, in inWaiting
File “/usr/local/lib/python2.7/dist-packages/serial/serialposix.py”, line 467, in in_waiting
<type ‘exceptions.AttributeError’>: ‘NoneType’ object has no attribute 'ioctl’
Dec 06 2017 18:23:08 Opening serial port
Dec 06 2017 18:23:08 Notification: Script started for beer 'norauch’
Dec 06 2017 18:23:18 Checking software version on controller…
Dec 06 2017 18:23:18 Found BrewPi v0.2.10 build unknown, running on an Arduino Uno with a revA shield on port /dev/ttyUSB0

Traceback (most recent call last):
File “/home/brewpi/brewpi.py”, line 415, in
startBeer(config[‘beerName’])
File “/home/brewpi/brewpi.py”, line 287, in startBeer
setFiles()
File “/home/brewpi/brewpi.py”, line 273, in setFiles
brewpiJson.newEmptyFile(localJsonFileName)
File “/home/brewpi/brewpiJson.py”, line 109, in newEmptyFile
jsonFile = open(jsonFileName, “w”)
IOError: [Errno 28] No space left on device: '/home/brewpi/data/norauch/norauch-2017-12-06.json’
Exception in thread Thread-1 (most likely raised during interpreter shutdown):
Traceback (most recent call last):
FilBrewPi: wifiChecker: Attempt 1 to reach 192.168.0.1 failed (mié dic 6 18:20:12 CET 2017)

I saw “no space left on device” somewhere in the logs. If your SD card is full, then you’ll have all kinds of problems.
You have a too small SD card or you didn’t expand the root partition, which you can do with the rpi-config menu.

I think that is the problem. with the command df -h, the console returns a space in the folder “/ dev / root” of 5.6G used 4.6G 82%. My sd is 8G. I’m going to expand the space. sure there will be the problem.
Next week I will make a batch and after the fermentation I will link this batch with another to take advantage of the yeast. This will need to have working the brewpi more days. After this test I report if the correction has worked. Maybe it’s useful for someone else.
Thank you.

hello, I tried to expand the partition of my sd, but rpi-config says it is already expanded. Is this possible? my sd is 8Gb but I see that what the system indicates is that the space is 5.9Gb. I can buy a new larger sd, it’s not a problem, but if the partition is still small I do not solve the problem.
Attached photos.
Thank you.df-hconfig

There could be something wrong with your SD card or there could be some file system corruption, I think trying another bigger one will be good idea anyways.

ok, I will buy a new sd of 16Gb. Can I restore the backup I have now? It is from the SD of 8GB. or reinstall everything in it again?

I would re-install, because we might suspect data corruption.

Hi, finally I can work again on my brewpi.
I summarize the state of my process.
I bought a new sd and I installed everything again with a noobs 2.4.2 with different problems that I could save thanks to forums and other partners. Finally I am at the point of programming my arduino. As here I already had problems in the past, I know I have to put my arduino in legacy mode. It is here that I have the problem. I execute the command “sudo ~ / brewpi-tools / updater.py --ask” this starts to work but finally returns an error and I can not choose the legacy mode. I add a capture.
Can you shed light on this problem?
Thank you.

It cannot reach GitHub.

Make sure the pi has internet access.
Also run:

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

For these commands, you need Internet too. Fix that first. But GitHub changed their SSL protocol and older versions of python have trouble with it.

Ok, I’ll try what you tell me, I can not do it until tomorrow. I’m sure there’s access to the internet, I can use the raspberry browser on different websites.
I am seeing a difference in the command that I have entered … and the same command referenced in other pages that address the issue.
I write: “sudo ~ / brewpi-tools / updater.py --ask” but I see some other reference using: “sudo ~ / brewpi-tools / updater.py -ask” "a single -"
Do the two commands work or maybe there may be a problem here?
Thanks again for the help, I do not get tired of thanking you for always being attentive to the problems.

A double -- is commonly used in front of whole words and a single dash - in front of abbreviations in command line applications.

For example:

git --branch new_branch_name
git -b new_branch_name

I think the single dash here is the result of the forum removing one or it is actually 2 so close together that it looks like one. The correct syntax is thus --ask.

Hello Elco,
Finally I am already in legacy mode. although your instructions were not effective at first, but they made me think.
I will explain something more about my installation so you can understand what I have done. remember that I have no knowledge of linux and programming. Unfortunately I can follow instructions but often I can not do what I execute.
As I said before, I installed from the beginning with my usual command routine but I had problems with the php5 part. I managed to solve it by modifying the file “sources.list” as indicated by the partner poltorak in this post: Automatic Installer Not working
That way, I got the installation completed until the problem I reported in this post. When the commands that you indicated to me did not work, I thought that maybe the problem could be in the change of the file "sources.list"
I have returned to this file its original content and then if I could put the system in legacy mode.
Once explained this, I have some questions:
1- This change in the file “sources.list” to avoid problems with the php version, is it well done?
2 Could I not have something properly installed? Can I check it in some way?
Thanks again.
Ramon