I have my cooler and brewpi out in the garage for the moment. It was kind of working with the EDIMAX EW-7811UN dongle, but the Wifi dropped after some hours. No matter what I tried like configuring the chron-job to check the wifi status, didn’t work in the end.
So today I decided to go for a cable network instead. The Raspberry Pi fires up again and connects to the network, but there seems to be an issue between the Spark and the web page. Besides commenting out the wlan0-stuff in the /etc/network/interfaces file, is there anything else I should be aware of?
BTW - I can reach the RPi from other computers in my network. I use a static IP assigned to the eth0 via the router. I have just turned off the wifiChecker according to Set up ethernet connection rather than wifi
The log after I tried to disable wifiChecker looks like this:
wpa_supplicant: /sbin/wpa_supplicant daemon failed to start
run-parts: /etc/network/if-pre-up.d/wpasupplicant exited with return code 1
Cannot find device "wlan0"
May 31 2015 21:53:50 Notification: Script started for beer 'Cooler Test 1’
May 31 2015 21:54:00 Checking software version on controller…
May 31 2015 21:54:10 Warning: Cannot receive version number from controller. Your controller is either not programmed or running a very old version of BrewPi. Please upload a new version of BrewPi to your controller.
ping: unknown iface wlan0
BrewPi: wifiChecker: Attempt 1 to reach 192.168.1.1 failed (s?. 31. mai 22:00:02 +0200 2015)
ping: unknown iface wlan0
BrewPi: wifiChecker: Attempt 2 to reach 192.168.1.1 failed (s?. 31. mai 22:00:17 +0200 2015)
ping: unknown iface wlan0
BrewPi: wifiChecker: Unable to reach router. Restarting wlan0 interface… (s?. 31. mai 22:00:32 +0200 2015)
/sbin/ifdown: interface wlan0 not configured
Ignoring unknown interface wlan0=wlan0.
May 31 2015 22:06:39 Another instance of BrewPi is already running, which will conflict with this instance. This instance will exit
May 31 2015 22:06:47 Another instance of BrewPi is already running, which will conflict with this instance. This instance will exit
May 31 2015 22:06:53 Notification: Script started for beer 'Cooler Test 1’
May 31 2015 22:07:03 Checking software version on controller…
May 31 2015 22:07:13 Warning: Cannot receive version number from controller. Your controller is either not programmed or running a very old version of BrewPi. Please upload a new version of BrewPi to your controller.
ping: unknown iface wlan0
BrewPi: wifiChecker: Attempt 1 to reach 192.168.1.1 failed (s?. 31. mai 22:10:01 +0200 2015)
ping: unknown iface wlan0
BrewPi: wifiChecker: Attempt 2 to reach 192.168.1.1 failed (s?. 31. mai 22:10:16 +0200 2015)
ping: unknown iface wlan0
BrewPi: wifiChecker: Unable to reach router. Restarting wlan0 interface… (s?. 31. mai 22:10:32 +0200 2015)
/sbin/ifdown: interface wlan0 not configured
Ignoring unknown interface wlan0=wlan0.
ping: unknown iface wlan0
BrewPi: wifiChecker: Attempt 1 to reach 192.168.1.1 failed (s?. 31. mai 22:20:02 +0200 2015)
ping: unknown iface wlan0
BrewPi: wifiChecker: Attempt 2 to reach 192.168.1.1 failed (s?. 31. mai 22:20:17 +0200 2015)
ping: unknown iface wlan0
BrewPi: wifiChecker: Unable to reach router. Restarting wlan0 interface… (s?. 31. mai 22:20:32 +0200 2015)
/sbin/ifdown: interface wlan0 not configured
Ignoring unknown interface wlan0=wlan0.
ping: unknown iface wlan0
BrewPi: wifiChecker: Attempt 1 to reach 192.168.1.1 failed (s?. 31. mai 22:30:02 +0200 2015)
ping: unknown iface wlan0
BrewPi: wifiChecker: Attempt 2 to reach 192.168.1.1 failed (s?. 31. mai 22:30:18 +0200 2015)
ping: unknown iface wlan0
BrewPi: wifiChecker: Unable to reach router. Restarting wlan0 interface… (s?. 31. mai 22:30:33 +0200 2015)
/sbin/ifdown: interface wlan0 not configured
Ignoring unknown interface wlan0=wlan0.
ping: unknown iface wlan0
BrewPi: wifiChecker: Attempt 1 to reach 192.168.1.1 failed (s?. 31. mai 22:40:12 +0200 2015)
ping: unknown iface wlan0
BrewPi: wifiChecker: Attempt 2 to reach 192.168.1.1 failed (s?. 31. mai 22:40:27 +0200 2015)
ping: unknown iface wlan0
BrewPi: wifiChecker: Unable to reach router. Restarting wlan0 interface… (s?. 31. mai 22:40:42 +0200 2015)
/sbin/ifdown: interface wlan0 not configured
Ignoring unknown interface wlan0=wlan0.
ping: unknown iface wlan0
BrewPi: wifiChecker: Attempt 1 to reach 192.168.1.1 failed (s?. 31. mai 22:50:02 +0200 2015)
ping: unknown iface wlan0
BrewPi: wifiChecker: Attempt 2 to reach 192.168.1.1 failed (s?. 31. mai 22:50:17 +0200 2015)
ping: unknown iface wlan0
BrewPi: wifiChecker: Unable to reach router. Restarting wlan0 interface… (s?. 31. mai 22:50:32 +0200 2015)
/sbin/ifdown: interface wlan0 not configured
Ignoring unknown interface wlan0=wlan0.
May 31 2015 22:52:41 Notification: Script started for beer 'Cooler Test 1’
May 31 2015 22:52:51 Checking software version on controller…
May 31 2015 22:53:01 Warning: Cannot receive version number from controller. Your controller is either not programmed or running a very old version of BrewPi. Please upload a new version of BrewPi to your controller.
ping: unknown iface wlan0
BrewPi: wifiChecker: Attempt 1 to reach 192.168.1.1 failed (s?. 31. mai 23:00:02 +0200 2015)
ping: unknown iface wlan0
BrewPi: wifiChecker: Attempt 2 to reach 192.168.1.1 failed (s?. 31. mai 23:00:17 +0200 2015)
ping: unknown iface wlan0
BrewPi: wifiChecker: Unable to reach router. Restarting wlan0 interface… (s?. 31. mai 23:00:32 +0200 2015)
/sbin/ifdown: interface wlan0 not configured
Ignoring unknown interface wlan0=wlan0.
May 31 2015 23:04:42 Notification: Script started for beer 'Cooler Test 1’
May 31 2015 23:04:53 Checking software version on controller…
May 31 2015 23:05:03 Warning: Cannot receive version number from controller. Your controller is either not programmed or running a very old version of BrewPi. Please upload a new version of BrewPi to your controller.
ping: unknown iface wlan0
BrewPi: wifiChecker: Attempt 1 to reach 192.168.1.1 failed (s?. 31. mai 23:10:02 +0200 2015)
ping: unknown iface wlan0
BrewPi: wifiChecker: Attempt 2 to reach 192.168.1.1 failed (s?. 31. mai 23:10:18 +0200 2015)
May 31 2015 23:10:19 quit message received on socket. Stopping script.
ping: unknown iface wlan0
BrewPi: wifiChecker: Unable to reach router. Restarting wlan0 interface… (s?. 31. mai 23:10:33 +0200 2015)
/sbin/ifdown: interface wlan0 not configured
Ignoring unknown interface wlan0=wlan0.
May 31 2015 23:11:05 Notification: Script started for beer 'Cooler Test 1’
May 31 2015 23:11:15 Checking software version on controller…
May 31 2015 23:11:25 Warning: Cannot receive version number from controller. Your controller is either not programmed or running a very old version of BrewPi. Please upload a new version of BrewPi to your controller.
ping: unknown iface wlan0
BrewPi: wifiChecker: Attempt 1 to reach 192.168.1.1 failed (s?. 31. mai 23:20:36 +0200 2015)
May 31 2015 23:20:40 Notification: Script started for beer 'Cooler Test 1’
May 31 2015 23:20:50 Checking software version on controller…
ping: unknown iface wlan0
BrewPi: wifiChecker: Attempt 2 to reach 192.168.1.1 failed (s?. 31. mai 23:20:51 +0200 2015)
May 31 2015 23:21:00 Warning: Cannot receive version number from controller. Your controller is either not programmed or running a very old version of BrewPi. Please upload a new version of BrewPi to your controller.
ping: unknown iface wlan0
BrewPi: wifiChecker: Unable to reach router. Restarting wlan0 interface… (s?. 31. mai 23:21:06 +0200 2015)
/sbin/ifdown: interface wlan0 not configured
Ignoring unknown interface wlan0=wlan0.
My /etc/network/interfaces look like this:
auto lo
iface lo inet loopback
iface eth0 inet dhcp
… and now it works… For what reason I don’t know. I have restarted the Pi and Spark many (MANY) times, and every time I got the “Warning: Cannot receive version number from controller”. This morning I decided to have a fresh start with the logs, and erased them via the Maintenance panel. Tada!! The LCD-display suddenly showed info again!!
I still get these messages:
BrewPi: wifiChecker: Attempt 1 to reach 192.168.1.1 failed (ma. 01. juni 08:30:02 +0200 2015)
ping: unknown iface wlan0
BrewPi: wifiChecker: Attempt 2 to reach 192.168.1.1 failed (ma. 01. juni 08:30:17 +0200 2015)
ping: unknown iface wlan0
BrewPi: wifiChecker: Unable to reach router. Restarting wlan0 interface… (ma. 01. juni 08:30:32 +0200 2015)
/sbin/ifdown: interface wlan0 not configured
Ignoring unknown interface wlan0=wlan0.
I hope I can turn off the wifiChecker somehow
In /etc/cron.d/brewpi, change:
# entry:wifichecker
# entry:~wifichecker
Then run:
sudo /home/brewpi/utils/updateCron.sh
Hi again, seems like the wifiChecker is still in progress:
Jun 01 2015 13:03:12 controller debug message: INFO MESSAGE 18: Negative peak detected: 7.4, estimated: 9.5. Previous cool estimator: 0.156, New cool estimator: 0.197.
ping: unknown iface wlan0
BrewPi: wifiChecker: Attempt 1 to reach 192.168.1.1 failed (ma. 01. juni 13:10:02 +0200 2015)
ping: unknown iface wlan0
BrewPi: wifiChecker: Attempt 2 to reach 192.168.1.1 failed (ma. 01. juni 13:10:17 +0200 2015)
ping: unknown iface wlan0
BrewPi: wifiChecker: Unable to reach router. Restarting wlan0 interface… (ma. 01. juni 13:10:32 +0200 2015)
/sbin/ifdown: interface wlan0 not configured
Ignoring unknown interface wlan0=wlan0.
I have updated the /etc/cron.d/brewpi like shown below and ran the updateCron.sh.
Is there any other places triggering the wifiChecker?
The script works like this:
It looks for # entry: wifichecker, a commented out line, to know that the line below it is the wifi checker cron entry.
If wifichecker is not found, it will install it. That is why we chose ~ to mean: do not install it.
So having ~wifichecker and removing the line below should not run it and prevent it from being enabled again.
Hmmm, I understand. As you see from my screen shot, I do have the ~wifichecker set at both “entries” and “# entry”-lines. But still I get the messages in my log as shown below:
ping: unknown iface wlan0
BrewPi: wifiChecker: Attempt 1 to reach 192.168.1.1 failed (ma. 01. juni 14:40:02 +0200 2015)
ping: unknown iface wlan0
BrewPi: wifiChecker: Attempt 2 to reach 192.168.1.1 failed (ma. 01. juni 14:40:17 +0200 2015)
ping: unknown iface wlan0
BrewPi: wifiChecker: Unable to reach router. Restarting wlan0 interface… (ma. 01. juni 14:40:32 +0200 2015)
/sbin/ifdown: interface wlan0 not configured
Ignoring unknown interface wlan0=wlan0.
Is there some way to “ask cron” what entries it has on Raspberry Pi?
Learning something new every day. crontab -e reveals nothing resembling wifi-checker right now:
crontab -e edits the current user crontab.
The scripts in /etc/cron.d/ are separate from those.
So you would just edit them with: sudo nano /etc/cron.d/brewpi
I gave you wrong instructions earlier, sorry.
You will have to edit the line entries="brewpi ~wifichecker"
. The ~wifichecker is just to prevent the update script from installing the entry.
And then manually remove the cron entries for the wifi checker. The result should look like this:
pi@raspberrypi /home/brewpi/logs $ cat /etc/cron.d/brewpi
stderrpath="/home/brewpi/logs/stderr.txt"
stdoutpath="/home/brewpi/logs/stdout.txt"
scriptpath="/home/brewpi"
entries="brewpi ~wifichecker"
# entry:brewpi
* * * * * brewpi python $scriptpath/brewpi.py --checkstartuponly --dontrunfile $scriptpath/brewpi.py 1>/dev/null 2>>$stderrpath; [ $? != 0 ] && python -u $scriptpath/brewpi.py 1>$stdoutpath 2>>$stderrpath &
Thanks again @Elco ! And please forgive my noob-level of knowledge on Raspberry Pi too! Learning something new every day here
Hi Elco.
I have followed this advice and after doing so i can’t restart the script, below is the script as edited:
beard@beardpi /home/brewpi/logs $ cat /etc/cron.d/brewpi
stderrpath="/home/brewpi/logs/stderr.txt"
stdoutpath="/home/brewpi/logs/stdout.txt"
scriptpath="/home/brewpi"
entries="brewpi ~wifichecker"
# entry:brewpi
* * * * * brewpi python $scriptpath/brewpi.py --checkstartuponly --dontrunfile $scriptpath/brewpi.py 1>/dev/null 2>>$stderrpath; [ $? != 0 ] && python -u $scriptpath/brewpi.py 1>$stdoutpath 2>>$stderrpath &
The stderr log is showing:
wpa_supplicant: /sbin/wpa_supplicant daemon failed to start
run-parts: /etc/network/if-pre-up.d/wpasupplicant exited with return code 1
and the stdout log is showing:
Oct 02 2015 08:51:33
{"BeerTemp":null,"BeerSet": 23.00,"BeerAnn":null,"FridgeTemp":null,"FridgeSet": 23.00,"FridgeAnn":null,"State":0}
Failed to bring up wlan0.
Failed to bring up wlan0.
The time it is showing is strange, i have been working on these changes and restarted the system within the last few minutes (current time (09:30). Seems like it can’t connect by ethernet either now?
Any ideas?
If it helps to determine what is causing this i have found that by running:
sudo -u brewpi python /home/brewpi/brewpi.py
I can get the script started again but if stopped it will not re-start through the web interface.
I think the wifi checker script runs as root and wrote to a log file, which is now owned by root. The script cannot write to it now and crashes.
Please check by running:
ls -ahl /home/brewpi/logs
Fix by running:
sudo /home/brewpi/utils/fixPermissions.sh
This is a bug I think.
Hi Elco. I think that the wifi checker is not relevant to the problem, it i was just a coincidence that i made the change to the wifi checker then stopped the script. becasue i could not then restart it i assumed it was the change that i had just made. I then swapped the sd card for a clone i had made of a working version which was set up just following your instructions. It works fine. The problem that i have starts when i follow the instructions to give remote access to an admin and a public web interface. It all seems to work until i stop the script and then it cannot be re-started. I think that im doing something wrong with the /etc/apache2/sites-available/000-default.conf script? After doing some reading i thought that i had to do the install to /var/www/html so there may be something that i haven’t changed correctly?
What can i send you to check?
These were the instructions that i followed: http://www.homebrewtalk.com/showpost.php?p=6594822
I changed wherever it said /var/www to /var/www/html and i wrote the virtual host script in /etc/apache2/sites-available/000-default.conf
You moved the www-files to a different directory, so I think you will have to let the script now that.
In config.cfg, add
wwwPath = /var/www/html