I am trying to run my legacy setup which used to work earlier. The script starts without the problem. Permissions should be fine. The problem is the script and the web based gui can detect each other. When I kill the script with Ctrl+C I see that it is always hanging in the following place:
Jan 10 2019 00:43:57 Controller debug message: INFO MESSAGE 2: Sensor initialized: pin 15 28A4D7AD0900002B null
Jan 10 2019 00:43:58 Controller debug message: INFO MESSAGE 2: Sensor initialized: pin 15 28A4D7AD0900002B null
Jan 10 2019 00:43:59 Controller debug message: INFO MESSAGE 2: Sensor initialized: pin 15 28A4D7AD0900002B null
^CTraceback (most recent call last):
File “./brewpi.py”, line 455, in
conn, addr = s.accept()
File “/usr/lib/python2.7/socket.py”, line 206, in accept
sock, addr = self._sock.accept()
It seems to me they cant establish a socket communication between them. Any idea what might the problem be. I am using a PC under ubuntu instead of Pi.
I apologize … I think I read “PC” as “Windows” and that’s why I posted what I did.
Assuming you are running as ‘brewpi’ and have not changed a bunch of things at once, it looks as if your permissions and ownership are not consistent with a default setup:
pi@brewpi:/home/brewpi $ ls -al
drwxrwsr-x 8 brewpi brewpi 4096 Jan 11 05:u7121:
drwxr-xr-x 4 root root 4096 Jan 8 09:09 ..
-rw-rwxr-- 1 brewpi brewpi 2971 Jan 8 09:09 autoSerial.py
-rw-rwxr-- 1 brewpi brewpi 6410 Jan 8 09:09 backgroundserial.py
srwxrwxrwx 1 brewpi brewpi 0 Jan 11 05:21 BEERSOCKET
You might try to run fixPermissions.py in the utils directory. While BEERSOCKET is rwx for world, one of the other scripts might not be reading properly. As Elco said, /var/log/apache2 often show us what’s happening. That’s been the source for me figuring out a lot of mistakes I’ve made.
Nothing in apache2 error log except debug prints i added. This is not assumed as a problem because if u cant access the socket it means the script is not running. PHP scripts always die with info which is shown in the web page. I believe the problem is in some apache config. Maybe raspbian distro is different in the sense of security.