Author Topic: WS View "Customized"  (Read 22623 times)

0 Members and 1 Guest are viewing this topic.

Offline KenW

  • Member
  • *
  • Posts: 23
Re: WS View "Customized"
« Reply #25 on: July 25, 2019, 11:03:25 PM »
I just had to 'reconnect' my WH2950 by adding it as a new device in the WS View app, and using all the previous connection settings.
Not impressed that it went offline for the second time in a few days.  That connection can't be restored remotely, so if it happens again and I'm away, my weatherstation becomes a lump of junk.

Offline BGM

  • Member
  • *
  • Posts: 3
Re: WS View "Customized"
« Reply #26 on: August 05, 2019, 07:06:27 PM »
I finally got the customize screen in WS View to upload data to Pwsweather.com and then onto Aeris.  This is useful if you are trying to set your own weather station up for use in wifi irrigation systems like b-hyve or Ranchio.
 
My PWS is a Fine Offset WH2950 (Branded “Pantech”) but i'm pretty sure this will work with any PWS supported by "WS View". I have attached a screenshot of the settings I used.

One thing I also learnt was that while many of the websites requires your password to include a special character it won’t work on Pwsweather.com. Any data uploads to pwsweather.com cannot be done with a password including special character even though you can set up your pwsweather website login with one. Since its the same password for uploads best to not include one.

Anyway hope this helps

Offline galfert

  • Global Moderator
  • Forecaster
  • *****
  • Posts: 6822
Re: WS View "Customized"
« Reply #27 on: August 05, 2019, 08:28:27 PM »
I finally got the customize screen in WS View to upload data to Pwsweather.com and then onto Aeris.  This is useful if you are trying to set your own weather station up for use in wifi irrigation systems like b-hyve or Ranchio.
 
My PWS is a Fine Offset WH2950 (Branded “Pantech”) but i'm pretty sure this will work with any PWS supported by "WS View". I have attached a screenshot of the settings I used.

One thing I also learnt was that while many of the websites requires your password to include a special character it won’t work on Pwsweather.com. Any data uploads to pwsweather.com cannot be done with a password including special character even though you can set up your pwsweather website login with one. Since its the same password for uploads best to not include one.

Anyway hope this helps

Really? So PWSweather accepts data in WU format? Interesting. You've checked it out that nothing is messed up? All sensors reporting what you would expect over at PWSweather?

Ecowitt GW1000 | Meteobridge on Raspberry Pi
WU: KFLWINTE111  |  PWSweather: KFLWINTE111
CWOP: FW3708  |  AWEKAS: 14814
Windy: pws-f075acbe
Weather Underground Issue Tracking
Tele-Pole

Offline BGM

  • Member
  • *
  • Posts: 3
Re: WS View "Customized"
« Reply #28 on: August 06, 2019, 12:42:25 AM »
I finally got the customize screen in WS View to upload data to Pwsweather.com and then onto Aeris.  This is useful if you are trying to set your own weather station up for use in wifi irrigation systems like b-hyve or Ranchio.
 
My PWS is a Fine Offset WH2950 (Branded “Pantech”) but i'm pretty sure this will work with any PWS supported by "WS View". I have attached a screenshot of the settings I used.

One thing I also learnt was that while many of the websites requires your password to include a special character it won’t work on Pwsweather.com. Any data uploads to pwsweather.com cannot be done with a password including special character even though you can set up your pwsweather website login with one. Since its the same password for uploads best to not include one.

Anyway hope this helps

Really? So PWSweather accepts data in WU format? Interesting. You've checked it out that nothing is messed up? All sensors reporting what you would expect over at PWSweather?

Yeah so far all appears as it should, only been up since yesterday, no rain yet but everything syncing correctly

Offline NicolasBe

  • Member
  • *
  • Posts: 8
    • Weerstation Vinkt
Re: WS View "Customized"
« Reply #29 on: August 08, 2019, 02:28:52 AM »
Can someone help me with this?

I would like to have the data from my WH2900 gets uploaded to my server.

I have set the WS View app to upload to my site
I have a folder mysite.net/weatherstation

Now I'm searching a updateweatherstation.php script. (I'm working with PHP 7.x). I have found one on GitHub, but I can't get it working (https://github.com/ccgruber/updateweatherstation)

Any help is welcome

Offline mafen

  • Member
  • *
  • Posts: 7
Re: WS View "Customized"
« Reply #30 on: August 08, 2019, 04:00:22 AM »
I have gotten it to work with the WH2900

And from how my system does it, the updateweatherstation.php has to be in a folder called weatherstation this folder has to be in your www folder on your web server, for me atleast the file does almost nothing apart from not giving the WS a 404 page. The data logging is done thru a extension of Weewx called interceptor which is reading the data that gets send to your host computer.

Offline NicolasBe

  • Member
  • *
  • Posts: 8
    • Weerstation Vinkt
Re: WS View "Customized"
« Reply #31 on: August 08, 2019, 04:07:40 AM »
Yes ok, but what is written in the php file?

I have this for now: https://www.weerstationvinkt.be/weatherstation/updateweatherstation.php

with the updateweatherstation.php that I found on https://github.com/ccgruber/updateweatherstation

Offline mafen

  • Member
  • *
  • Posts: 7
Re: WS View "Customized"
« Reply #32 on: August 08, 2019, 04:40:38 AM »
I am using this one

https://obrienlabs.net/code/receiving-data-weather-station/

But again it is not doing anything with this file, it is the interception of the data packets sent by the weather station, take a look in the access.log file and see if the WS connects to your web server at all

Edit : this is my config, yours may differ
« Last Edit: August 08, 2019, 05:22:41 AM by mafen »

Offline NicolasBe

  • Member
  • *
  • Posts: 8
    • Weerstation Vinkt
Re: WS View "Customized"
« Reply #33 on: August 08, 2019, 08:51:54 AM »
The good news is that the WS is sending information to the server. No I have to find how to get the information in a .json format

Offline droiddk

  • Forecaster
  • *****
  • Posts: 334
Re: WS View "Customized"
« Reply #34 on: August 08, 2019, 02:18:19 PM »
Hi

Try this:

Code: [Select]
<?php

function test_input($data) {

$data trim($data);
$data stripslashes($data);
$data htmlspecialchars($data);
return $data;

}

$password test_input($_GET["PASSWORD"]);

if (
$password == "YOURPASSWORD") {

$queryString $_SERVER['QUERY_STRING'];

parse_str($queryString$output);

$jsonformat json_encode($output);

$jsonFile fopen("data.json""w") or die("Unable to open file!");

fwrite($jsonFile$jsonformat);

fclose($jsonFile);

echo "success";
http_response_code(200);

}

?>

Will generate jsonfile.

Remember to edit "YOURPASSWORD".

As always, use on own risk.

Regards

Offline NicolasBe

  • Member
  • *
  • Posts: 8
    • Weerstation Vinkt
Re: WS View "Customized"
« Reply #35 on: August 08, 2019, 02:35:05 PM »
Thank you for your reply. Unfortunately nothing happens...

This is my server log. The 301 code is due to the fact that my site is HTTPS I think

Code: [Select]
"GET /weatherstation/updateweatherstation.php?ID=******&PASSWORD=*****&indoortempf=80.4&tempf=75.4&dewptf=61.0&windchillf=75.4&indoorhumidity=49&humidity=61&windspeedmph=0.0&windgustmph=0.0&winddir=122&absbaromin=29.847&baromin=29.850&rainin=0.000&dailyrainin=0.000&weeklyrainin=0.000&monthlyrainin=0.012&solarradiation=41.10&UV=0&dateutc=2019-08-08%2018:28:32&softwaretype=EasyWeatherV1.4.0&action=updateraw&realtime=1&rtfreq=5 HTTP/1.0" 301 1466 "-" "-"

Offline droiddk

  • Forecaster
  • *****
  • Posts: 334
Re: WS View "Customized"
« Reply #36 on: August 08, 2019, 02:53:10 PM »
Thank you for your reply. Unfortunately nothing happens...

This is my server log. The 301 code is due to the fact that my site is HTTPS I think

Code: [Select]
"GET /weatherstation/updateweatherstation.php?ID=******&PASSWORD=*****&indoortempf=80.4&tempf=75.4&dewptf=61.0&windchillf=75.4&indoorhumidity=49&humidity=61&windspeedmph=0.0&windgustmph=0.0&winddir=122&absbaromin=29.847&baromin=29.850&rainin=0.000&dailyrainin=0.000&weeklyrainin=0.000&monthlyrainin=0.012&solarradiation=41.10&UV=0&dateutc=2019-08-08%2018:28:32&softwaretype=EasyWeatherV1.4.0&action=updateraw&realtime=1&rtfreq=5 HTTP/1.0" 301 1466 "-" "-"

Just a guess, but have you tried https://mywebsite.com/weatherstation as Server IP / Hostname in WS View?

Or maybe this: https://stackoverflow.com/questions/18362285/htaccess-redirect-losing-get-variables Maybe http get variables are lost when http redirect to https

Regards
« Last Edit: August 08, 2019, 02:56:47 PM by droiddk »

Offline NicolasBe

  • Member
  • *
  • Posts: 8
    • Weerstation Vinkt
Re: WS View "Customized"
« Reply #37 on: August 09, 2019, 03:03:53 PM »
Yes got it all working!

I using it now on a non HTTPS site (just for collecting data) with the updateweatherstation.php file I found here on this forum (http://www.wxforum.net/index.php?topic=32027.msg322456#msg322456)

=> Now I got my Fine offset WH2900 uploading data to my server => data is set in a ws1001.json file => Data is picked up by Weather Display where it goes to different other site's and services.

Offline droiddk

  • Forecaster
  • *****
  • Posts: 334
Re: WS View "Customized"
« Reply #38 on: August 10, 2019, 07:29:24 AM »
Yes got it all working!

I using it now on a non HTTPS site (just for collecting data) with the updateweatherstation.php file I found here on this forum (http://www.wxforum.net/index.php?topic=32027.msg322456#msg322456)

=> Now I got my Fine offset WH2900 uploading data to my server => data is set in a ws1001.json file => Data is picked up by Weather Display where it goes to different other site's and services.

Did you try my script using non HTTPS?

Offline Circle C Weather

  • Member
  • *
  • Posts: 20
Re: WS View "Customized"
« Reply #39 on: September 04, 2019, 10:54:10 PM »
Hello and I am asking for a bit of help. My goal is to get the customized WS view to create a json file at this point.

I have a web server that I've confirmed is on port 80 http and has no firewall. I'm trying to custom upload Ecowitt protocol.

Based on the posts I've read, I'm still unsure if I should type in domain.net in the WS view box or the exact URL (like domain.net/data/report) or even my servers IP address. I gathered that I should have an index.php file in the domain.net/data/report folder.

I'm an engineer and not a programmer, so I'm a program hacker at this point. I can get things to work, but it's a learning process...

I've tried many flavors of index.php, but none seem to work. I guess I should expect a .json file when it works. I've tried looking in the web logs, but they don't seem to be too telling (other than my site gets hit by a bunch of spam).

Any help would be much appreciated...

Thanks,
Jeremy

Offline KenW

  • Member
  • *
  • Posts: 23
Re: WS View "Customized"
« Reply #40 on: September 04, 2019, 11:09:31 PM »
Hi Jeremy.
Just the domain name, with no trailing /.  That works for me.

In my /data/report/index.php I have a redirect to the 'real' reporting index.php in a more logical (for me) place
    chdir('../../ws/report');
    include "./index.php";
 
The WS data is in a POST to that file (in the global variable $_POST in PHP).
My WS code is all written in PHP, since I'm comfortable with that.

Happy hacking,
Ken.

Offline Circle C Weather

  • Member
  • *
  • Posts: 20
Re: WS View "Customized"
« Reply #41 on: September 05, 2019, 10:08:52 AM »
Can someone share a barebones index.php that would work for me as a starting point. THat way I could have a shell that works and can add on as I get used to the php language. Thanks. Jeremy.

Offline KenW

  • Member
  • *
  • Posts: 23
Re: WS View "Customized"
« Reply #42 on: September 05, 2019, 03:36:55 PM »
If you put the following into your index.php, it should write what the WS sends, to a file on your server.
(That assumes you have Apache or some other server and PHP operating successfully.)
Code: [Select]
<?php
$str 
print_r($_POSTTRUE);
$fh fopen('output.txt''w');
fwrite($fh$str);
fclose($fh);


Offline Circle C Weather

  • Member
  • *
  • Posts: 20
Re: WS View "Customized"
« Reply #43 on: September 05, 2019, 08:39:16 PM »
So far it has just given me a 500 Server Error :(


Offline Circle C Weather

  • Member
  • *
  • Posts: 20
Re: WS View "Customized"
« Reply #44 on: September 05, 2019, 09:03:23 PM »
I submitted a help desk ticket to my server hosts and it is working! OMG! That's the most excited I got all day.

Now on with the tinkering and hacking...

Thanks Ken...

Offline Circle C Weather

  • Member
  • *
  • Posts: 20
Re: WS View "Customized"
« Reply #45 on: September 05, 2019, 09:06:44 PM »
BTW, it had to do with file permissions. 666 and 777 are considered insecure and were blocked.

Offline KenW

  • Member
  • *
  • Posts: 23
Re: WS View "Customized"
« Reply #46 on: September 05, 2019, 09:16:33 PM »
If you want an "easy" solution, I could bundle up my code and provide it.  All PHP.
You'd have to set up a MySQL database as well.
My WS is at https://waggies.net/ws/
(Inside temperature readings are protected by password.)

Offline Circle C Weather

  • Member
  • *
  • Posts: 20
Re: WS View "Customized"
« Reply #47 on: September 05, 2019, 09:30:25 PM »
That would be most kind of you Ken. I am sending it with Ecowitt Protocol which may be different from yours.

It seems there are other packages out there that read mySQL like meteotemplate and weather display that can make it look pretty and calculate all kinds of statistics. Have you looked into those? I really like what you've done with the data...taking control of it. I guess you can extract anything from the database...

Offline KenW

  • Member
  • *
  • Posts: 23
Re: WS View "Customized"
« Reply #48 on: September 05, 2019, 10:05:45 PM »
I'm using the Ecowitt protocol.
I'll look at where I could best put my code in the public domain.  -Could be on my own server.  (But I'm not a fan of git.)

Offline KenW

  • Member
  • *
  • Posts: 23
Re: WS View "Customized"
« Reply #49 on: September 06, 2019, 05:51:09 AM »
OK, I created a project in GitHub.  Then I used SmartGit to create a git repository on my PC (Ubuntu Linux) and put the WS code into it.
Was unable to push the code to GitHub.  I hate git!!!!  (I use SVN with my code at home.)
So...

You will find a ZIP of my code at https://waggies.net/files/wz.zip.
Download it.  Extract it somewhere.  Copy the contents of the parent ws directory into your public_html directory.
Read the readme.
Edit ws/classes/config.php (the IDs in there are the Ecowitt passkey) for your details.
Create a DB to receive weather data.
Run ws/admin/setup.php to populate a DB entry in it.  (Initially in do-nothing mode.)

The code is not well documented, not very object oriented, enough to make a hacker proud.  But it works.

When I feel like beating myself up a bit more, I might have another go at getting it into GitHub (and syncing locally with Eclipse).

 

anything