Change the default port of the apache Webserver to e.g. 8080
http://www.noveldevices.co.uk/rp-webserverport
-
Fritzbox WLAN Script SomeOneAtHome
-
@SaxnPaule
Not sure how this would help. I have not setup my pimatic to be accessible from outside my network and I believe 8080 refers to https.This is the content of my /etc/apache2/ports.conf file
---------------------------Start-------------------
Listen 80<IfModule ssl_module>
Listen 443
</IfModule><IfModule mod_gnutls.c>
Listen 443
</IfModule>vim: syntax=apache ts=4 sw=4 sts=4 sr noet
------------------------End---------------------
The way I interpret this it is listening on port 80. When I change it to 8080 nothing I et “website not accessible”. I changed it back and get the Apache Startpage.
I think installing php7.0 overwrote some configuration of the pimatic webserver. Any help?
-
Port 8080 has nothing to do with access from “outside” or HTTPS. HTTPS default port is 443 and HTTP default port is 80.
As your pimatic is already running on port 80, the apache couldn’t also run on this port. Now you have to change the default port of one of them.
-
Guy’s, what are you doing? This is a script for server side! You don’t need apache for that. Please read my first post! You start this script with commands!
PHP works then like a bash script. I’ll like to help you, but I can’t explain how Linux works.
Did you get GUI from Pimatic via 8080 or via 80? Check Pimatic config file and set Port to 8080 as standard. Reboot your pi and everything must be fine.
-
The problem is, that PHP7 seems to install apache by default. @cherberg configure apache to listen to port 8080.
After that you could also just stop the apache service by
sudo service apache stop
Then restart pimatic
sudo service pimatic start
If pimatic still isn’t available provide the last 100 lines of your /home/pimatic-app/pimatic-daemon.log file
-
Otherwise sudo apt remove apache2 must be uninstall apache2 and I hope that PHP7 stand on the system.
-
Thanx guys uninstalling apache2 restart and flushing the browser cache has brought back the pimatic interface…
I have replaced the “” in the Script for user ID and password with the user ID and password from my Fritzbox. So it looks like this:
function checkDevice($ip,$mac){
$result = “”;
$uri = “urn:dslforum-org:service:Hosts:1”;
$location = “http://”.$ip.":49000/upnp/control/hosts";
$client = new SoapClient(
null,
array(
‘location’ => $location,
‘uri’ => $uri,
‘noroot’ => True,
‘login’ => user,
‘password’ => password,
‘connection_timeout’ => 5Now when recreating the device I get the error:
error [pimatic-shell-execute]: [ShellPresenceSensor#iphone-ch] Error: unknown state=“BOX IP or IPs missing”!
Which I believe means the Fritzbox Adresss is missing, where do I need to enter this information?
Thanx again for your patience. I believe it now becomes clear what I meant with a step by step guide
-
@swen said in Fritzbox WLAN Script SomeOneAtHome:
Script support now more then one fritz.box for use: yourscript.php macadress boxip1:boxip2:boxip3
call the script and pass mac address and ip of your fritzbox as arguments
-
OK that is meant by “arguments” this did not show in the Screenshot from wuschel.
Ok when I add the mac adress first and the and ip adress I now get the following error:
error [pimatic-shell-execute]: [ShellPresenceSensor#iphone-ch] Error: Command failed: php /home/pi/iphone.php ::::: 192.168.178.1
PHP Fatal error: Uncaught Error: Class ‘SoapClient’ not found in /home/pi/iphone.php:19
Stack trace:
#0 /home/pi/iphone.php(43): checkDevice(‘192.168.178.1’, ‘:::::…’)
#1 /home/pi/iphone.php(51): checkAllDevices(Array, ':::::…’)
#2 {main}
thrown in /home/pi/iphone.php on line 19 -
Ok php is missing soapclient.
Try:
sudo apt install PHP7.0-soap -
@swen said in Fritzbox WLAN Script SomeOneAtHome:
sudo apt install PHP7.0-soap
Thanx this has worked and the creation of the device now works free of errors.
However when manually executing the script I get the following error:
PHP Notice: Use of undefined constant user - assumed ‘user’ in /home/pi/iphone.php on line 25
PHP Notice: Use of undefined constant password - assumed ‘password’ in /home/pi/iphone.php on line 26as described before I have entered the username and password in your script replacing the “”:
$uri = “urn:dslforum-org:service:Hosts:1”;
$location = “http://”.$ip.":49000/upnp/control/hosts";
$client = new SoapClient(
null,
array(
‘location’ => $location,
‘uri’ => $uri,
‘noroot’ => True,
‘login’ => user,
‘password’ => password,
‘connection_timeout’ => 5That was probably wrong. Where and how do I enter the user ID and password?
Thanx again
-
Use My script as it is don’t modify anything in it. Let “” do not replace it please.
-
Hurray it works
Thanx so much, this is a great solution.
If you dont mind I will collect all the necessary steps and create a new article with a step by step guide so users with limited skillsets like myself will have it easier.
-
I created this new Howto:
No idea why some parts show in large fonts
-
Thanks for this how to. I have one additional information for you and this guide. There was a user how ask to request more then one box. If there is an user with more then one box then you can add more IP’s to the arguments of script.
./yourscript.php MACSearch IPBOX1:IPBOX2:IPBOX3
etc… See my first post.
-
i added this to the howto