Weather Station Hardware > WiFiLogger/Meteo-Pi

AirLink export - new WiFiLogger feature

(1/2) > >>

WiFiLogger:
I have made new function in WiFiLogger.
I have add new menu where user can enable/disable up to 5 AirLink, or WeatherLink Live (because WLL use the same interface).
When user set local IP of own AirLink inside home network and user will add link to external server with PHP file (test PHP is provided by me), then every 5 minutes (fixed) WiFilogger will connect to the defined AirLinks/WLLs grab raw JSON data and send it to the PHP script.

With this simple procedure you can save AirLink/WLL data on your own server.

 [ You are not allowed to view attachments ]

 [ You are not allowed to view attachments ]

PaulMy:
Hi Wojtek,
I have updated firmware and have the AirLink set up, and a [test] displays the Airlink data in the lower box.  I've used the IP for both Airlink and WLL and both show their data in that box.  So I think that is all ok.

I entered the full path to execute airlink.php and a .json file was created in the remote folder but it was blank, and an error-log

--- Quote ---[01-Apr-2022 16:05:27 UTC] PHP Notice:  Undefined variable: json_source in /home/psoykkrhjuz3/public_html/wifi-console/airlink/airlink.php on line 16
[01-Apr-2022 16:05:27 UTC] PHP Notice:  Trying to access array offset on value of type null in /home/psoykkrhjuz3/public_html/wifi-console/airlink/airlink.php on line 17
[01-Apr-2022 16:05:27 UTC] PHP Notice:  Trying to access array offset on value of type null in /home/psoykkrhjuz3/public_html/wifi-console/airlink/airlink.php on line 20
[01-Apr-2022 16:05:27 UTC] PHP Notice:  Undefined variable: json_source in /home/psoykkrhjuz3/public_html/wifi-console/airlink/airlink.php on line 23
[01-Apr-2022 16:05:27 UTC] PHP Notice:  Trying to access array offset on value of type null in /home/psoykkrhjuz3/public_html/wifi-console/airlink/airlink.php on line 27

--- End quote ---



I then edited the .php on line 20 to rename .json to airlink.json and then run the php script again and an airlink.json file was created on the remote but it is still empty, and a new error_log as above.


What have I missed?  and is WFL to execute that airlink.php every 5 minutes?  That hasn't happened.

Enjoy,
Paul

WiFiLogger:

--- Quote from: PaulMy on April 01, 2022, 12:31:15 PM ---What have I missed?  and is WFL to execute that airlink.php every 5 minutes?  That hasn't happened.
[/size]

--- End quote ---

Please try on my test server. http://wifilogger.net/airlink/airlink.php

Maybe my test script in PHP is not executing the same way on your server.

PaulMy:
Hi Wojtek,
I have entered your server url in my airlink settings and did a [test].  What should I be seeing?
Is WiFiLogger to run the airlink.php script every 5 minutes?  Nothing seems to happen unless I manually execute it in komokaweather.com/wifi-console/airlink/ and then the blank file and error-log.


Enjoy,
Paul

WiFiLogger:

--- Quote from: PaulMy on April 01, 2022, 01:01:39 PM ---Hi Wojtek,
I have entered your server url in my airlink settings and did a [test].  What should I be seeing?

--- End quote ---

https://wifilogger.net/airlink/001D0A10050E.json

When airlink.php will grab data from WiFilogger, then it is putting it into JSON file in the same directory.
It can save multiple files, so name of the file is DID, because it is unique.

My script is working fine on my hosting. Probably your hosting has different PHP version.


--- Code: ---while ($rawputdata = fread($putdata, 1024)){
$json_source = $json_source.$rawputdata;
}

--- End code ---
Issue is within this function. It is reading chunk of 1024 bytes from input buffer and put it into variable. It is repeating it multiple times up to the end of the buffer.
It looks like while loop is not executed. But it can be issue with opening stream file before that.

--- Code: ---$putdata = fopen("php://input", "r");

--- End code ---
More investigating is needed. I am not very familiar with PHP  :-(

Navigation

[0] Message Index

[#] Next page

Go to full version