Dear pimatics
Would anybody be so kind to provide a step by step guide on how to implement this script ?
Thanx
Fritzbox WLAN Script SomeOneAtHome
Dear pimatics
Would anybody be so kind to provide a step by step guide on how to implement this script ?
Thanx
Start to ask with your issue and we try to help…
Well… my issue is that I would like to track the presence of my iphone at home but due to the “deep sleep” the pimatic-ping plugin does not work.
my question is: how to I implement this solution into my pimatic
I am more of a “user” used to GUI and I would need step by step guidance to implement this script. Is it part of a plugin, or do I need to run it in the terminal, what are the commands…??
@cherberg hi you copy the scipt an make a php file with the code
in pimatic add a shellpresencesensor
http://img292.imagevenue.com/img.php?image=131408686_Unbenannt222_122_105lo.JPG
thanx for your help. As said I am a “gui user” so I am already struggling to perform this very first taks and would need exact steps to “copy the scipt and make a php file with the code”
I am looking for something like the step by step install guide for pimatic with detailed instructions which commands to use “click here” “copy and paste this” “execute sudo xxxxxx”…
Thanx for your patience
@cherberg The First Task.
Copy all Code from the Box
Make a new iphone.txt on your desktop an paste the code -> save
Rename the file from iphone.txt to iphone.php and you have a php file
Second Task
Upload the File to your Pi with WinSCP add your Pi (IP) an Upload the php file to /home/pi
Last Step is in the pimatic GUI add a new Device with the config same like my Picture
// The very first Step is to install php! Is php not install google “install php on raspberry” or like this
Thanx wuschel
Last Step is in the pimatic GUI add a new Device with the config same like my Picture
What type of device would I need to create?
@cherberg Device is a “ShellPresencsesensor”
Thanx
There seem to be different Versions of PHP. Which one would I need to install?
You can install the newest one PHP7.0. If you use PHP7.0 edit the first line of my script:
#!/usr/bin/php to
#!/usr/bin/php7.0
Thats all… The script must be executable that means you must set this script via chmod +x yourfile.php
via ./yourfile.php you can execute this script but don’t forget to give arguments. Read first thread.
Hello,
i have see that this script works not with a IPhone which have activate power saving mode.
When i start then this script i become “0” as output.
Have anyone else this problem?
Only with Apple devices!!
I used a Fritz Box 7360.
@swen said in Fritzbox WLAN Script SomeOneAtHome:
via ./yourfile.php you can execute this script but don’t forget to give arguments
Thanx for the guidance.
Not sure what “arguments” means. Do you refer to the adress, Login and Password for the Fritzbox which have to be added to into your script??
I have installed PHP7.0 using “sudo apt-get install php7.0”
After restart I cannot reach the pimatic GUI anymore but get a “debian Apache2 Debian Default Page”.
Can anyone please help me how to fix this?
Change the default port of the apache Webserver to e.g. 8080
http://www.noveldevices.co.uk/rp-webserverport
@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>
------------------------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’ => 5
Now 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