[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 488: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 488: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 488: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 488: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 488: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 488: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 488: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 488: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 488: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 488: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 488: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 488: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 488: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 488: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 488: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 488: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 488: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 488: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 488: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 488: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 488: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 488: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 488: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 488: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 488: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 488: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 112: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 112: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/functions.php on line 4762: Cannot modify header information - headers already sent by (output started at [ROOT]/includes/functions.php:3897)
[phpBB Debug] PHP Warning: in file [ROOT]/includes/functions.php on line 4764: Cannot modify header information - headers already sent by (output started at [ROOT]/includes/functions.php:3897)
[phpBB Debug] PHP Warning: in file [ROOT]/includes/functions.php on line 4765: Cannot modify header information - headers already sent by (output started at [ROOT]/includes/functions.php:3897)
[phpBB Debug] PHP Warning: in file [ROOT]/includes/functions.php on line 4766: Cannot modify header information - headers already sent by (output started at [ROOT]/includes/functions.php:3897)
Toon onderwerp - HOWTO: Pushberichten ipv. mail notifications • nodo-domotica.nl

nodo-domotica.nl

HOWTO: Pushberichten ipv. mail notifications

Post hier vragen en ervaringen die betrekking hebben op het gebruik en configuratie van de WebApp

HOWTO: Pushberichten ipv. mail notifications

Berichtdoor rtenklooster » 08 nov 2013, 23:28

rtenklooster
 
Berichten: 377
Geregistreerd: 04 aug 2012, 12:10
Woonplaats: Aduard

Re: HOWTO: Pushberichten ipv. mail notifications

Berichtdoor avdl72 » 26 jan 2014, 11:28

Weet jij toevallig of deze methode ook werkt voor Prowl?
Nodo-Mega V3.7 R744
Web App version: SWINWA-PROD-V099 - lokaal
Nodo Ethernet Shield v2.0.2
Nodo Small v2.0.0 - t.b.v. Gas-, Water- en Stroommeter
Nodo Small v2.0.0 - t.b.v. KAKU
Nodo Mini - t.b.v. Temperatuur (Arduino Pro Mini)
avdl72
 
Berichten: 114
Geregistreerd: 29 nov 2012, 15:50

Re: HOWTO: Pushberichten ipv. mail notifications

Berichtdoor rtenklooster » 26 jan 2014, 12:05

rtenklooster
 
Berichten: 377
Geregistreerd: 04 aug 2012, 12:10
Woonplaats: Aduard

Re: HOWTO: Pushberichten ipv. mail notifications

Berichtdoor Annie » 11 maart 2014, 17:22

Het wil maar niet lukken met de pushberichten........

Pushover.net accounts aangemaakt en getest, werken. Pushover groep gecreëerd, werkt ook.

Daarna Nodo.php aangepast:

while($row_RSnotify = mysql_fetch_array($RSnotify)) {

$device = $row_RSnotify['recipient'];
$subject = $row_RSnotify['subject'];
$message = $row_RSnotify['body'];
//Dit bericht is nog niet verzonden dus we gaan hem nu verzenden.
curl_setopt_array($ch = curl_init(), array(
CURLOPT_URL => "https://api.pushover.net/1/messages.json",
CURLOPT_POSTFIELDS => array(
"token" => "API_token/key_verkregen_na_registratie_webserver",
"user" => "key_van_mijn_delivery_group",
"device" => $device,
"title" => $subject,
"message" => $message
)));
curl_exec($ch);
curl_close($ch);
}

Toen in mijn webapp een notification aangemaakt en bij event ingevuld: userevent 103,1.
Als ik nu als commando ingeef: usereventsend 103,1 dan is het result:

Input=HTTP(192.168.1.75); Unit=1; Event=UserEventSend 103,1
Output=HTTP(192.168.1.75); Unit=1; Event=UserEvent 103,1
Output=RF; Unit=0; Event=UserEvent 103,1

Krijg echter nooit een bericht binnen op mijn smartphone als ik dat met de NoDo verstuur.....

Why not?? Wat een toestand!!

André
Annie
 
Berichten: 92
Geregistreerd: 23 jun 2013, 09:56

Re: HOWTO: Pushberichten ipv. mail notifications

Berichtdoor rtenklooster » 27 maart 2014, 12:25

Wat heb je bij notifications ingevuld dan? Misschien handiger voor je als je de php code even laat zoals het is, en je de pushover mail service gebruikt, dan mail je naar het adres zoals in je pushover dashboard staat.
rtenklooster
 
Berichten: 377
Geregistreerd: 04 aug 2012, 12:10
Woonplaats: Aduard

Re: HOWTO: Pushberichten ipv. mail notifications

Berichtdoor Annie » 28 maart 2014, 15:32

Hi Richard;

Denk dat er iets niet lekker in mijn Apache on Windows server zit, maar weet niet wat. Mijn zoon heeft een kleiner script gemaakt om te testen, op zijn Linux server verzendt dit via mijn Pushover account gewoon de pushberichten zoals het hoort:

<?php
curl_setopt_array($ch = curl_init(), array(
CURLOPT_URL => "https://api.pushover.net/1/messages.json",
CURLOPT_POSTFIELDS => array(
"token" => "token",
"user" => "user",
"device" => null,
"title" => "Hallo Daar!",
"message" => "Haaii"
)));
curl_exec($ch);
curl_close($ch);
?>

Maar op mijn server werkt het niet, als ik het aanroep via de browser gebeurt er niets. Met phpinfo zie ik dat Curl actief is. Een ander Curl script doet het wel, dat is een vrij simpel ding:

<?php
$curl = curl_init();
curl_setopt ($curl, CURLOPT_URL, "http://www.php.net");
curl_exec ($curl);
curl_close ($curl);
?>

Als ik dat open in mijn browser wordt netjes http://www.php.net in de browser geopend.




Als ik PHP errors laat loggen in het Windows syslog, dan zie ik ik de volgende drie errors bij opstarten van de Apache webserver:

Kan de beschrijving van gebeurtenis-id 2 van bron PHP-5.3.3 niet vinden. Het onderdeel dat de gebeurtenis heeft gestart is mogelijk niet op de lokale computer geïnstalleerd, of de installatie is beschadigd. U kunt het onderdeel op de lokale computer installeren of herstellen.

Als de gebeurtenis van een andere computer afkomstig is, moest de weergave-informatie bij de gebeurtenis zijn opgeslagen.

De volgende informatie is in de gebeurtenis opgenomen:

php[6436]
PHP Warning: PHP Startup: Unable to load dynamic library 'C:/PHP64/ext\php_zip.dll' - Kan opgegeven module niet vinden.
in Unknown on line 0

php[6436]
PHP Warning: PHP Startup: Unable to load dynamic library 'C:/PHP64/ext\php_oci8.dll' - Kan opgegeven module niet vinden.
in Unknown on line 0

php[6436]
PHP Warning: PHP Startup: Unable to load dynamic library 'C:/PHP64/ext\php_pgsql.dll' - Kan opgegeven module niet vinden.
in Unknown on line 0

Als het meezit komt mijn zoon er binnenkort naar kijken, zijn kennis gaat (erg veel) verder dan die van mij. Als ik het eerste script uitvoer, krijg ik geen foutmeldingen in mijn Windows syslog. Toch gebeurt er dan gewoon niets, browservenster blijft leeg en er wordt geen berichtje verstuurd.
Heb ook aan mail zitten denken, maar dan moet ik aan de gang met Postfix, vond die Pushoplossing veel mooier. Als jij nog wat weet dan houd ik me aanbevolen, als mijn zoon iets vindt dan laat ik het uiteraard ook weten,

prettig weekeinde,

André
Annie
 
Berichten: 92
Geregistreerd: 23 jun 2013, 09:56

Re: HOWTO: Pushberichten ipv. mail notifications

Berichtdoor Annie » 01 apr 2014, 06:15

Ben er uiteindelijk zelf achter gekomen waarom het niet werkte. Het probleem zit hem in het feit dat de Pushover-server SSL gebruikt. De SSL-certificaten op mijn Win/Apache server zijn niet voor handen, zodat cURL het bericht niet gaat versturen, het is immers niet veilig. Heb het voor nu even opgelost door het checken van een veilige verbinding uit te schakelen door middel van een extra regel in het script. Om alles met de certificaten op orde te krijgen is dan weer iets voor de komende tijd..........

De extra regel, deze wordt in het script opgenomen juist vóór curl_exec:

curl_setopt($ch,CURLOPT_SSL_VERIFYPEER,false);

Het eenvoudige script om te testen ziet er nu dus zo uit:

<?php
curl_setopt_array($ch = curl_init(), array(
CURLOPT_URL => "https://api.pushover.net/1/messages.json",
CURLOPT_POSTFIELDS => array(
"token" => "token",
"user" => "user",
"device" => null,
"title" => "Hallo Daar!",
"message" => "Haaii"
)));
curl_setopt($ch,CURLOPT_SSL_VERIFYPEER,false);
curl_exec($ch);
curl_close($ch);
?>

Op deze manier heb ik ook Nodo.php aangepast, kan nu in ieder geval berichtjes versturen!
Annie
 
Berichten: 92
Geregistreerd: 23 jun 2013, 09:56

Re: HOWTO: Pushberichten ipv. mail notifications

Berichtdoor Annie » 01 apr 2014, 14:37

Het volgende gevonden, kan nu netjes met SSL mijn berichtjes naar de pushover.net server sturen!

Heb hier PHP 5.3.3, een enigszins oude versie draaien. In die versie kun je geen padregel in PHP.ini naar de certificaatfile opnemen, maar moet je het pad naar de certificaatfile (cacert.pem) in elk script opnemen door middel van:

curl_setopt ($ch, CURLOPT_CAINFO, "PATH_TO/cacert.pem");

Sinds PHP 5.3.7 kan het pad naar de certificaatfile gewoon in PHP.ini worden opgenomen. Zie hieronder:



It's a pretty common problem in Windows. You need just to set cacert.pem to curl.cainfo.

Since PHP 5.3.7 you could do:
1.download http://curl.haxx.se/ca/cacert.pem and save it somewhere.
2.update php.ini -- add curl.cainfo = "PATH_TO/cacert.pem"


In earlier PHP versions like 5.3.3 you have to set the certificate path in every script:

curl_setopt ($ch, CURLOPT_CAINFO, "PATH_TO/cacert.pem");



Get the CA certificates bundle file at: http://curl.haxx.se/docs/caextract.html

Voorbeeld, waarbij de certificaatfile cacert.pem in C:\PHP64 werd geplaatst:

<?php
curl_setopt_array($ch = curl_init(), array(
CURLOPT_URL => "https://api.pushover.net/1/messages.json",
CURLOPT_POSTFIELDS => array(
"token" => "token",
"user" => "user",
"device" => null,
"title" => "Hallo Daar!",
"message" => "Haaii"
)));
curl_setopt ($ch, CURLOPT_CAINFO, "C:/PHP64/cacert.pem");
curl_exec($ch);
curl_close($ch);
?>


Blij dat het nu eindelijk werkt, ook met SSL! Als ik ooit een paar weken niets te doen heb moet ik mijn server maar eens moderniseren.............. :mrgreen:
Annie
 
Berichten: 92
Geregistreerd: 23 jun 2013, 09:56


Keer terug naar Nodo WebApp

Wie is er online?

Gebruikers in dit forum: Geen geregistreerde gebruikers. en 11 gasten

cron