WXforum.net

Weather Station Hardware => Ambient Weather and Ecowitt and other Fine Offset clones => Topic started by: droiddk on May 16, 2019, 02:08:31 PM

Title: WS View "Customized"
Post by: droiddk on May 16, 2019, 02:08:31 PM
Hello

Anyone managed to get the customized upload to work?

Have tried different combinations, local and remote host but Weather Station (WH2910C, branded as Ventus W830) never contacts the php script :/

Upload to Ecowitt.net og Weathercloud works fine.

Kind Regards
Title: Re: WS View "Customized"
Post by: droiddk on May 17, 2019, 04:06:45 AM
Upgraded to firmware 1.3.4 this morning but still no luck.

Regards
Title: Re: WS View "Customized"
Post by: droiddk on May 17, 2019, 03:46:16 PM
Customized upload using "Wunderground" protocol is running now. Can describe how if anyone wants it 

Cant figure out how to get the data using "Ecowitt" protocol. I can see in server logs that Ecowitt protocol is using POST (Wunderground is using GET). Can also see that weather station is contacting server/data/report (no file specified? Looking for index.php?) but server throws 301 status :/

Regards

Title: Re: WS View "Customized"
Post by: farcus on May 18, 2019, 08:11:22 PM
Upgraded to firmware 1.3.4 this morning but still no luck.

Regards

where did you get 1.3.4 firmware?
About a week ago I was prompted to update firmware to 1.3.2 that introduced "ecowitt" & "custom" but haven't seen any further updates since then.
Title: Re: WS View "Customized"
Post by: farcus on May 19, 2019, 01:09:06 AM
never mind . . . 1.3.4 was pushed through in an update earlier today.
interestingly, WU is still reporting 1.3.2 as being used.
Title: Re: WS View "Customized"
Post by: Weatherwx85 on May 19, 2019, 01:54:57 AM
Customized upload using "Wunderground" protocol is running now. Can describe how if anyone wants it 

Yes please that would be great, been trying to get it to send to weewx.

Thanks
Title: Re: WS View "Customized"
Post by: Weatherwx85 on May 19, 2019, 08:10:49 AM
I have sorted it, seems you have to use a hostname rather than an IP address.
Title: Re: WS View "Customized"
Post by: droiddk on May 19, 2019, 08:47:47 AM
2
I have sorted it, seems you have to use a hostname rather than an IP address.

I have not tried with IP adress but found out that if your website is domain.net, then you have to type domain.net into "hostname/ip" Weather station will then look for script in http://www.domain.net/weatherstation Script has to be called updateweatherstation.php so this address needs to be valid: http://www.domain.net/weatherstation/updateweatherstation.php but one shall only type domain.net into WS View.
Script needs to catch the data by the HTTP get request. In php $_SERVER['QUERY_STRING'] can catch all keys and values in the query string.

So far so good with the Wunderground protocol, next is Ecowitt protocol but I'm stuck, need more documentaton, Lucy  :grin: :grin:

Regard
Title: Re: WS View "Customized"
Post by: mafen on May 26, 2019, 03:08:10 PM
Some more documentation would have been great, since i am trying to do the same
Title: Re: WS View "Customized"
Post by: droiddk on May 26, 2019, 03:10:22 PM
Some more documentation would have been great, since i am trying to do the same

My first attempts were blocked by my server firewall. Had to allow access to the script from the console.

Title: Re: WS View "Customized"
Post by: Weatherwx85 on May 26, 2019, 04:35:39 PM
I have noticed since the recent firmware (currently 1.3.7) the port section in the app is ignored so it only uses port 80. Mine stopped working after the update a quick tcpdump reveiled the port change to 80 ignoring the 8090 that I had set and was listening on (weewx), changed the listening port to 80 and all is good again :)

Agree could have more documentation.
Title: Re: WS View "Customized"
Post by: mafen on May 28, 2019, 06:08:07 PM
I have noticed since the recent firmware (currently 1.3.7) the port section in the app is ignored so it only uses port 80. Mine stopped working after the update a quick tcpdump reveiled the port change to 80 ignoring the 8090 that I had set and was listening on (weewx), changed the listening port to 80 and all is good again :)

Agree could have more documentation.

I have found out that the app wont update unless you click the save button and the finish button
Title: Re: WS View "Customized"
Post by: droiddk on May 29, 2019, 09:41:38 AM
I have found out that the app wont update unless you click the save button and the finish button

Do you use Wunderground or Ecowitt protocol?
Title: Re: WS View "Customized"
Post by: Weatherwx85 on May 29, 2019, 01:05:25 PM
I have found out that the app wont update unless you click the save button and the finish button

Do you use Wunderground or Ecowitt protocol?

I am using Wunderground
Title: Re: WS View "Customized"
Post by: droiddk on May 29, 2019, 03:47:20 PM
I am using Wunderground

Ok. Do not try Ecowitt.net protocol, It wont work if your web-server is running Apache which is quite common: https://news.netcraft.com/archives/2019/02/28/february-2019-web-server-survey.html

Ecowitt.net protocol will post to http://www.example.net/data/report Notice there is no trailing / Therefore the Apache server will redirect the request to http://www.example.net/data/report/ and look for index.php in that folder but the POST data will not survive the redirect!

Documentation: https://stackoverflow.com/questions/12302516/why-do-i-get-a-301-redirect-to-folder-name-with-slash and: https://stackoverflow.com/questions/42925865/post-data-is-not-recieved-on-destination-url

I have made a small .php script that is sending a POST request to the same script that shall catch the request from the weather station console and all is fine when using http://www.example.net/data/report/ as URL but not when using http://www.example.net/data/report as URL.

Cant get ecowitt.net procotol to work and my theory is above. Request from weather station console always gets html 301 status (in server log) so I'm pretty sure above is correct.

If my theory is right (I hope not because it would be nice to have the option), then maybe there should be a note about it...somewhere...in the documentation?

I have had some mails about this with Lucy and support have been great, but without finding out excatly what is going on.

Anyway, Wunderground protocol is working great! So maybe we don't need the Ecowitt.net protocol at all!?

Will do last tests tomorrow.

Regards
Title: Re: WS View "Customized"
Post by: droiddk on June 04, 2019, 07:51:40 AM
Update:

Thanks to great support by Lucy and the team at Ecowitt the customized upload option using Ecowitt.net protocol is now also working with Apache servers!

Kind Regards
Title: Re: WS View "Customized"
Post by: Mandrake on June 04, 2019, 11:51:59 AM
OK, that's great news....I shall explore your work!

The big benefit of the ecowitt.net data over the WU format is that it includes (I assume) the additional sensor data that WU does not support.
Can you confirm that?
Title: Re: WS View "Customized"
Post by: droiddk on June 04, 2019, 12:16:03 PM
OK, that's great news....I shall explore your work!

The big benefit of the ecowitt.net data over the WU format is that it includes (I assume) the additional sensor data that WU does not support.
Can you confirm that?

I don't have extra sensors so cant confirm this.
But yes, it should include extra sensors.

Regards
Title: Re: WS View "Customized"
Post by: KenW on July 18, 2019, 02:58:40 AM
 [tup]  Thank you very much for this thread.

I bought a Fine Offset WH2950, to save me having to maintain a Linux server which was receiving data from my previous WH3081.
The WH2950 is uploading to Wunderground, Weathercloud and Ecowitt just fine, but I don't like the displays those sites give me.
So I thought I'd use the 'Customized' setting to upload to my own hosted website, stuff the data into a MySQL DB, and display it how I want, both for a PC browser and a phone browser.  I will also be able to do the same for a mate's weatherstation at a different location, with hardly any extra software.

Until this thread, I had no idea how to get the Customized settings working.
Happily I can now capture both the Wunderground and Ecowitt formats.  I don't have extra sensors, so I'll use whichever seems to make most sense.
I guess there is no way to get the WH2950 to send in metric, so a first task will be to convert all the readings.
(I code in PHP, which works fine for this sort of thing.)

Thanks again for a very informative thread and forum.
Title: Re: WS View "Customized"
Post by: Mandrake on July 18, 2019, 05:39:22 AM
For the record I was under the impression that the consoles sent the data formatted to whatever you have the display settings set to.
In other words if you display metric then the raw data transmitted via the custom option is metric as well. I am wondering if flags are also transmitted so that external systems 'know' what format the data is in so can process it correctly?
Anyone know?
Title: Re: WS View "Customized"
Post by: droiddk on July 18, 2019, 05:51:45 AM
[tup]  Thank you very much for this thread.

I bought a Fine Offset WH2950, to save me having to maintain a Linux server which was receiving data from my previous WH3081.
The WH2950 is uploading to Wunderground, Weathercloud and Ecowitt just fine, but I don't like the displays those sites give me.
So I thought I'd use the 'Customized' setting to upload to my own hosted website, stuff the data into a MySQL DB, and display it how I want, both for a PC browser and a phone browser.  I will also be able to do the same for a mate's weatherstation at a different location, with hardly any extra software.

Until this thread, I had no idea how to get the Customized settings working.
Happily I can now capture both the Wunderground and Ecowitt formats.  I don't have extra sensors, so I'll use whichever seems to make most sense.
I guess there is no way to get the WH2950 to send in metric, so a first task will be to convert all the readings.
(I code in PHP, which works fine for this sort of thing.)

Thanks again for a very informative thread and forum.

Glad you like it  [tup]
Title: Re: WS View "Customized"
Post by: droiddk on July 18, 2019, 05:52:25 AM
I was under the impression that the consoles sent the data formatted to whatever you have the display settings set to.

This is not the case.

Regards
Title: Re: WS View "Customized"
Post by: KenW on July 19, 2019, 09:50:18 PM
Still a work in progress, but I have my WH2950 weatherstation data captured and displayed on my hosted website.
Info at https:/waggies.net/weather (https://waggies.net/weather).

A screen optimised for a phone browser is at https:/waggies.net/ws (https://waggies.net/ws).
-It displays in larger font on a phone than a PC.  At this minute the name shown depends on whether you come from an iPhone or not.  -I'm going to host a mate's weathersation as well, and he has an iPhone.  That will change, I'll give him a different URL.

My code is all PHP.  Now to add graphs of historical data... That will probably need some Javascript.
Its thanks to info in this thread that I could get the data capture working at all.  Why the manufacturer couldn't readily supply the info beats me.  An extra few sentences in the user manual would have done it.

I'm using the ecowitt format.  Note that it automatically sends a station ID which presumably one has to register at ecowitt to get (I did).
The Wunderground format sends a user-settable key and Id.
Title: Re: WS View "Customized"
Post by: diego on July 20, 2019, 02:45:11 PM
hi friends!

someone can help me with the ecowitt.net customize. how to set the WS app and the step to set my server ..i don`t know how to make the gw1000 send ecowitt data to my server .

thank you
Title: Re: WS View "Customized"
Post by: KenW on July 24, 2019, 03:20:47 AM
I've had my WH2950 operating for some days now.  Have been collecting the data for that time.  Now collecting it on my own hosted server.  Today the WS went off air for a few hours.  I got an email from Weathercloud telling me it was offline.
I came home, ran the WS View app, re-saved the customized setting, and now its back.
Don't know if that re-saving did anything or not.

Has anyone else had this happen?  -I don't know if I lost the Internet at home or not -wife and I were both out.
 
Title: Re: WS View "Customized"
Post by: KenW 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.
Title: Re: WS View "Customized"
Post by: BGM 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
Title: Re: WS View "Customized"
Post by: galfert 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?

Title: Re: WS View "Customized"
Post by: BGM 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
Title: Re: WS View "Customized"
Post by: NicolasBe 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
Title: Re: WS View "Customized"
Post by: mafen 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.
Title: Re: WS View "Customized"
Post by: NicolasBe 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
Title: Re: WS View "Customized"
Post by: mafen 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
Title: Re: WS View "Customized"
Post by: NicolasBe 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
Title: Re: WS View "Customized"
Post by: droiddk 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
Title: Re: WS View "Customized"
Post by: NicolasBe 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 "-" "-"
Title: Re: WS View "Customized"
Post by: droiddk 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
Title: Re: WS View "Customized"
Post by: NicolasBe 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.
Title: Re: WS View "Customized"
Post by: droiddk 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?
Title: Re: WS View "Customized"
Post by: Circle C Weather 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
Title: Re: WS View "Customized"
Post by: KenW 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.
Title: Re: WS View "Customized"
Post by: Circle C Weather 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.
Title: Re: WS View "Customized"
Post by: KenW 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);

Title: Re: WS View "Customized"
Post by: Circle C Weather on September 05, 2019, 08:39:16 PM
So far it has just given me a 500 Server Error :(

Title: Re: WS View "Customized"
Post by: Circle C Weather 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...
Title: Re: WS View "Customized"
Post by: Circle C Weather 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.
Title: Re: WS View "Customized"
Post by: KenW 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.)
Title: Re: WS View "Customized"
Post by: Circle C Weather 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...
Title: Re: WS View "Customized"
Post by: KenW 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.)
Title: Re: WS View "Customized"
Post by: KenW 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 (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).
Title: Re: WS View "Customized"
Post by: Casper on September 08, 2019, 02:28:23 AM
Just what i was looking for  [tup] but your link to the zipfile is dead.. any possibility so share it somewhere ?
 

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 (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).
Title: Re: WS View "Customized"
Post by: KenW on September 08, 2019, 02:37:29 AM
Apologies Casper.
If you navigate to https://waggies.net/files (https://waggies.net/files), can you see the ZIP there and download it?
Title: Re: WS View "Customized"
Post by: Casper on September 08, 2019, 02:46:54 AM
Apologies Casper.
If you navigate to https://waggies.net/files (https://waggies.net/files), can you see the ZIP there and download it?

Yes working.. Thanks for a lot for sharing, ill dig into your files right away  [tup]
Title: Re: WS View "Customized"
Post by: weerstat on September 15, 2019, 07:55:13 AM
I tried your Waggies Weather software and it works. Thank you for sharing. [tup]
Title: Re: WS View "Customized"
Post by: KenW on September 15, 2019, 08:46:14 PM
Glad to hear someone has made use of my code.
If I make any useful changes, I'll post back here, with a text file indicating what has changed, in which files.

One thing I did forget to include in the ZIP was the Javascript library I used with the non-Google graphing code.
I'd tried that before I settled on the Google library.  But for anyone wanting a standalone package independent of the Internet, ie using it on their own local server, they might want that package, which is chartjs.  https://www.chartjs.org/
Title: Re: WS View "Customized"
Post by: weerstat on September 16, 2019, 05:22:18 PM
If I make any useful changes, I'll post back here, with a text file indicating what has changed, in which files.

Thank you, I appreciate that. i am not that good with php... So it is a little difficult to make it all by myself :grin:
Title: Re: WS View "Customized"
Post by: mr.sneezy on October 04, 2019, 06:59:35 AM
I've just come across this thread about using the WS View custom upload to send weather data to your own destination. Nice to know this is possible, as it would save hardware and router hacks and interfaces being needed to host your own data. I also have a Ecowitts (Pantech) WH2900, but don't yet have a nice way to get it's data stored locally like I can with sensors attached to home automation.

Question.
Does anyone here use a home automation platform like Home Assistant, Domoticz or openHAB ?

The reason I ask is that it would seem to me unless I wrong, that the stations custom upload ability could update a local database running on the home automation platform hardware , and the platform could use that for displays and automations like they do with any other sensors.
Cheers,
Martin

Title: Re: WS View "Customized"
Post by: theslydog on October 04, 2019, 08:45:02 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

With the new update to WS View what have you put in the 'path:' box?
Title: Re: WS View "Customized"
Post by: galfert on October 04, 2019, 09:13:42 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

With the new update to WS View what have you put in the 'path:' box?

Code: [Select]
http://www.pwsweather.com/pwsupdate/pwsupdate.php?
Title: Re: WS View "Customized"
Post by: BGM on October 05, 2019, 05:55:52 AM
Hadn't seen the update until you mentioned it. Have now updated and it populated the path with "/weatherstation/updateweatherstation.php?" Which seems to be working fine.
Title: Re: WS View "Customized"
Post by: galfert on October 05, 2019, 08:14:54 AM
Perhaps both paths work? I haven't tested.
Title: Re: WS View "Customized"
Post by: droiddk on October 05, 2019, 09:10:36 AM

With the new update to WS View what have you put in the 'path:' box?

/data/report is standard path for Ecowitt protocol and Server IP / Hostname could be yourwebsite.com so something like that.

/weatherstation/updateweatherstation.php? is standard path for Wunderground protocol and Server IP / Hostname could be yourwebsite.com so something like that.

Glad Ecowitt added this path option, took me some hours to find out the path when the customized options was introduced.

Regards
Title: Re: WS View "Customized"
Post by: theslydog on October 05, 2019, 10:18:13 PM
Perhaps both paths work? I haven't tested.

I have not tested both yet.

But what I did test was the GW1000 and the WH2900 both with the exact same settings and the WH2900 will post to PWS Weather but the GW1000 will not.

Anyone cast some light on this?

Title: Re: WS View "Customized"
Post by: bigcountry9907 on December 11, 2019, 06:02:19 PM
Glad to hear someone has made use of my code.
If I make any useful changes, I'll post back here, with a text file indicating what has changed, in which files.

One thing I did forget to include in the ZIP was the Javascript library I used with the non-Google graphing code.
I'd tried that before I settled on the Google library.  But for anyone wanting a standalone package independent of the Internet, ie using it on their own local server, they might want that package, which is chartjs.  https://www.chartjs.org/

Hello Ken
Thank you very much for putting together this PHP package.
I am having some troubles and believe you can easily point me in the right direction.
I'm pretty sure my problem is that im not getting things in the right place.
PHP code is new to me i'm mostly a Bash kinda programmer.

Here are my details.

I have a NFO Servers Web Host.
I have a SQL Database Named -->> bigcountry_STATION
Hostname: localhost (for external connections, use STATION1.weather.site.nfoservers.com)
Port: not needed for localhost connections; 3306 for external connections


On my server I have -->> Copy the contents of the parent ws directory into my public_html directory.
The full path to the copied files is. -->>    /usr/www/bigcountry/public/ws
The data path is copied to full path -->>   /usr/www/bigcountry/public/data

I am sure the files are in the proper location.
I believe my problem is not know what to put where in the ws/classes/config.php

So if you can verify the following and let me know whats wrong it would be much appreciated.

#1 ECOWITT.NET   PASSWORD  ??

LINE 13 & 14
    public $kensId = 'xxx'; // ***
    public $petesId = 'xxxyx';  // ***

Is this entry supposed to be my Ecowitt Login Name? Or my Ecowitt Password for logging into ecowitt.net

You said in one post (the IDs in there are the Ecowitt passkey)

So I think I only need 1 entry here or do i enter the same password i use to login to ecowitt.net for both?
------------------------------------------------------------------------------------------------------------------------

#2 public $dbhost = 'localhost';
Do I Need to change this to STATION1.weather.site.nfoservers.com
Or due to the fact that the .php file is local on my server i can just use localhost?
-------------------------------------------------------------------------------------------------------------------------

#3 Figuring out what is what.

    public $dbname = 'waggies_ws';  // ***
    public $dbtablenames = array('waggies', 'pete');    // ***
    public $dbtablename = 'waggies';    // ***
    public $dbpassword = 'xxx';  // ***

    public $showInside = false;
    public $authCookie = 'insider';
    public $authPassword = 'xxx';       // ***

          A) dbname     -->> Is this the name of the database i created which is
              bigcountry_STATION
             
               Or is this the username for logging into mysql.?

           B) dbtablenames -->> Is this any name I choose and will end up being the name assigned to the table that is created?
               Or is this the username for logging into mysql.?

           C) dbtablename  -->> Is this any name I choose and will end up being the name assigned to the table that is created?
               Or is this the username for logging into mysql.? or Is this the name of the database i created which is
              bigcountry_STATION

           
           D) dbpassword  -->> I would expect that this is the password used to login to the database i created.
                                        bigcountry_STATION

            E) authPassword -->> IS the the password i use to upload and download files through SFTP or SCP, ? Or is this where the ecowitt password goes and the 
public $kensId = 'xxx'; // ***
public $petesId = 'xxxyx';  // ***
ARE actually supposed to be my ecowitt login name?

Can you please Label the variables with a comment so im not guessing?

This is the error i get when i try to run
http://station1.weather.site.nfoservers.com/ws/admin/setup.php

Fatal error: Uncaught PDOException: SQLSTATE[HY000] [1044] Access denied for user 'bigcountry'@'localhost' to database 'bigcountry' in /usr/www/bigcountry/public/ws/classes/Db.php:18 Stack trace: #0 /usr/www/bigcountry/public/ws/classes/Db.php(18): PDO->__construct('mysql:dbname=bi...', 'bigcountry', 'mypassword') #1 /usr/www/bigcountry/public/ws/admin/setup.php(31): Db->__construct() #2 {main} thrown in /usr/www/bigcountry/public/ws/classes/Db.php on line 18


It seems to be calling dbname 2 times.
Once as my sql username and then calling the database the same name.
it should be Access denied for user 'bigcountry'@'localhost' to database bigcountry_STATION
Not Access denied for user 'bigcountry'@'localhost' to database 'bigcountry'

Please Clarify and be easy on me. PHP is new to me, I'm more well versed in BASH.
Title: Re: WS View "Customized"
Post by: raffaello.dimartino on December 12, 2019, 01:25:38 AM
Hello

Anyone managed to get the customized upload to work?

Have tried different combinations, local and remote host but Weather Station (WH2910C, branded as Ventus W830) never contacts the php script :/

Upload to Ecowitt.net og Weathercloud works fine.

Kind Regards

Hello everybody,
I rarely come to this forum.

I have developed some script for Ecowitt in Custom mode upload protocol.
There is also a weewx driver and a Meteotemplate plugin if you need it:

https://github.com/iz0qwm/ecowitt_http_gateway/
Title: Re: WS View "Customized"
Post by: bigcountry9907 on December 16, 2019, 11:10:54 AM
An update on my progress.
I have been using the Waggies Weather code developed by KEN.
Initially i had a minor problem with the setup.php logging into my database.
I e-mailed Ken and he replied to me and clarified the things i was misunderstanding.

If you get a sql login error i fixed that by adding a $dbuser variable to the \classes\config.php
Then you need to edit this line in the Db.php
$this->dbh = new PDO("mysql:dbname=$cfg->dbname;host=$cfg->dbhost", $cfg->dbuser, $cfg->dbpassword);

$cfg->dbuser was originally $cfg->dbname
If your database username and your name of the database are the same then $cfg->dbname will work. But if your username is different than the database name then you will need to change it.

Other than that everything is great.

Waggies Weather PHP code will do everything you need it to.
It takes the data sent by ecowitt and puts it into a file.
It creates the database tables for you automatically.
And it populates the databases with the ecowitt data.

With those basic things already done you can use it as a starting point. To set up the basics.
Then once the ecowitt data is being stored in the database you can do anything with it.
If you know how to make your own web pages then you can make your own pages.

With the data in a database you can use that data with any code that can use the data.

Thank You again Ken aka Waggie for sharing your work. :idea:
Title: Re: WS View "Customized"
Post by: meteocaldas on January 03, 2020, 08:05:22 PM
First of all a special mention to KenW for his superb ws.zip. Thank you sooooo much Ken!
I have done all the procedures that are mentioned in the readme.md.
Data base was created and seems to work fine but... I can't get it populated with data from WS View!
I am almost sure that the problem is within the /ws/classes/config.php because I can not understand some of the quoted *** mandatory variables:

//data
   public $kensId = 'xxx'; // ***
   public $petesId = 'xxxyx';  // ***

//DB
   public $authPassword = 'xxx';       // ***

I don't have any 'passkey' from Ecowitt, as mentioned in readme.md
All I have is Ecowitt username, and login email + password.
Can someone please be so kind to help me by explaining what these variables mean and what are the values that I need to use?
Thank you so much in advance!
Title: Re: WS View "Customized"
Post by: droiddk on January 04, 2020, 04:39:59 AM
First of all a special mention to KenW for his superb ws.zip. Thank you sooooo much Ken!
I have done all the procedures that are mentioned in the readme.md.
Data base was created and seems to work fine but... I can't get it populated with data from WS View!
I am almost sure that the problem is within the /ws/classes/config.php because I can not understand some of the quoted *** mandatory variables:

//data
   public $kensId = 'xxx'; // ***
   public $petesId = 'xxxyx';  // ***

//DB
   public $authPassword = 'xxx';       // ***

I don't have any 'passkey' from Ecowitt, as mentioned in readme.md
All I have is Ecowitt username, and login email + password.
Can someone please be so kind to help me by explaining what these variables mean and what are the values that I need to use?
Thank you so much in advance!

The data using Ecowitt protocol contains a "PASSKEY" (32 char long), maybe this is what you are looking for? A simple temporary script where data is written to a txt can show this key. I don't use or have looked into Ken's scripts so its just a guess.

Regards
Title: Re: WS View "Customized"
Post by: KenW on January 04, 2020, 04:51:47 PM
After checking my code to help Meteo, I've made some slight bugfixes.
The later version is at https://waggies.net/files/ws-1.01.zip.
The change is only in report/index.php.  -No change to functionality, just some PHP errors fixed.

Please note: in that file, there are lines which can be uncommented, to cause the downloaded data to be saved to your server for perusal.  In particular, finding your PASSKEY.  It will save in report/data0.htm.
Once you have a copy, re-comment-out those lines.

Ken.
Title: Re: WS View "Customized"
Post by: Vetti52 on January 05, 2020, 12:58:40 PM
Thanks for your optimistic words!

Just to introduce my actual state:

I bought a Fine Offset WS2900 clone (Eurochron EFWS 2900), which uploads perfectly via WS View to Ecowitt and WU. I thought, it would be easy to upload to Weewx as well, as you "happily" declare.

[tup]  Thank you very much for this thread.

I bought a Fine Offset WH2950, to save me having to maintain a Linux server which was receiving data from my previous WH3081.
The WH2950 is uploading to Wunderground, Weathercloud and Ecowitt just fine, but I don't like the displays those sites give me.
So I thought I'd use the 'Customized' setting to upload to my own hosted website, stuff the data into a MySQL DB, and display it how I want, both for a PC browser and a phone browser.  I will also be able to do the same for a mate's weatherstation at a different location, with hardly any extra software.

Until this thread, I had no idea how to get the Customized settings working.
Happily I can now capture both the Wunderground and Ecowitt formats.  I don't have extra sensors, so I'll use whichever seems to make most sense.
I guess there is no way to get the WH2950 to send in metric, so a first task will be to convert all the readings.
(I code in PHP, which works fine for this sort of thing.)

Thanks again for a very informative thread and forum.

However, up to date, there are no data to be detected from the station.

Firmware version is EasyWeatherV1.4.5.

WS View Costumized: Enabled, protocol Type Same as Ecowitt, Server http://myserver.local, Path /data/report, port 9000, upload interval 16.

WeeWx:
[Interceptor]
    driver = user.interceptor
    device_type = ecowitt-client
    mode = listen
    port = 9000

When looking at PYTHONPATH=/usr/share/weewx/ python bin/user/interceptor.py --device=ecowitt-client --mode=listen --port=9000 --debug
no data occur. tcpdump results in
0 packets captured
0 packets received by filter
0 packets dropped by kernel

When starting WeeWx and looking in a web browser, I can see that all parameters are set to N/A and on the bottom it says:

About this weather station
Hardware    ecowitt-client
Latitude    54° 05.40' N
Longitude    010° 15.60' E
Altitude    32 meters
Server uptime    11 days, 18 hours, 51 minutes
WeeWX uptime    0 days, 13 hours, 31 minutes
WeeWX version    3.9.2

Hopefully I only missed some crazy silly foolish detail.
And hopefully you can bring me on the lane.

Thanks!
Title: Re: WS View "Customized"
Post by: KenW on January 05, 2020, 01:08:57 PM
I'm not using WeeWx.  Not sure where you got that idea from.
Title: Re: WS View "Customized"
Post by: galfert on January 05, 2020, 02:01:36 PM
Currently WeeWx can only get data using "Customized Server" settings if you set the Protocol type to Weather Underground.  There is work being done by Matthew Wall to expand on the Interceptor driver so that it may also work with the Ecowitt protocol so that it gets more sensors but this isn't available yet. But even better is work being done on a completely new driver (currently in early design phase) that will support the GW1000 and its local network API (this will only work with the GW1000).

Title: Re: WS View "Customized"
Post by: Vetti52 on January 05, 2020, 02:52:08 PM
I'm not using WeeWx.  Not sure where you got that idea from.
You wrote, that you used Weewx and then decided to build your own solution, using the WS View Customized output. This was my starting point right now.
 
Currently WeeWx can only get data using "Customized Server" settings if you set the Protocol type to Weather Underground.  There is work being done by Matthew Wall to expand on the Interceptor driver so that it may also work with the Ecowitt protocol so that it gets more sensors but this isn't available yet. But even better is work being done on a completely new driver (currently in early design phase) that will support the GW1000 and its local network API (this will only work with the GW1000).
Matthew Wall has recently introduced the Ecowitt-client device into the Interceptor driver. However, I can not test it, because I do not achieve any data. That's why I wanted to step in here. Besides, I do not get data from the WS2900, neither with the Ecowitt nor with the WU protocol. I am afraid, that the problem is somewhere else. If at least tcpdump would receive data, I would then prefer to establish all the steps as described here. Actually I am reading through the content of Ken's ws.zip approach. But, at first, the transfer of data should be established somehow.
Title: Re: WS View "Customized"
Post by: raffaello.dimartino on January 06, 2020, 04:35:42 PM
Currently WeeWx can only get data using "Customized Server" settings if you set the Protocol type to Weather Underground.  There is work being done by Matthew Wall to expand on the Interceptor driver so that it may also work with the Ecowitt protocol so that it gets more sensors but this isn't available yet. But even better is work being done on a completely new driver (currently in early design phase) that will support the GW1000 and its local network API (this will only work with the GW1000).
Not true.
Weewx can receive via Customized Server in Ecowitt protocol. No need of Interceptor
You find the extension here:
https://github.com/iz0qwm/ecowitt_http_gateway/tree/master#ecowitt-weewx-driver

When Matthew will go out with a similar extension, not Interceptor, I will stop to update.
Title: Re: WS View "Customized"
Post by: Vetti52 on January 07, 2020, 12:57:20 PM

Not true.
Weewx can receive via Customized Server in Ecowitt protocol. No need of Interceptor
You find the extension here:
https://github.com/iz0qwm/ecowitt_http_gateway/tree/master#ecowitt-weewx-driver

When Matthew will go out with a similar extension, not Interceptor, I will stop to update.
You wrote on GIT, that this http_gateway is supposed to cooperate with GW1000.
Quote
Simple HTTP gateway that receives data from GW1000 with Ecowitt protocol and resend data to Meteotemplate
whereas Matthew writes in interceptor.py
Quote
    #   ecowitt-client - any hardware that uses the ecowitt protocol
    #   wu-client - any hardware that uses the weather underground protocol
Does your gateway work with a WS View customized PWS directly, as interceptor does (or should do)? Or do we need a GW1000?
Title: Re: WS View "Customized"
Post by: meteocaldas on January 07, 2020, 02:25:47 PM
Actually I am reading through the content of Ken's ws.zip approach. But, at first, the transfer of data should be established somehow.

Hi Vetti52. I had the same problem of not receiving data and with the precious help of KenW I finaly managed to receive it. If you install Ken's ws.zip and still don't receive data, be sure that the problem is not with the zip because it is FANTASTIC and works like a charm :-) 
How did I solve the situation?
My first problem was that my http:// site was redirected to https:// so I had to return it to HTTP OR HTTPS.
Second problem is that in WS VIEW in the server IP/hostaname entry I had http://mysite.com and had to remove the http://
For Ken's script, PATH should be left at default /data/report/ and port 80 upload interval 300 is fine for it to work.
You can see the result here https://meteocaldas.com/ws
You will also need a PASSKEY that can be seen after first data is received.
Hope this helps :-)
Title: Re: WS View "Customized"
Post by: droiddk on January 07, 2020, 02:55:59 PM

You can see the result here https://meteocaldas.com/ws


Hi

How often is data updated? Is that webpage updated automatically?

Regards
Title: Re: WS View "Customized"
Post by: meteocaldas on January 07, 2020, 03:35:02 PM
How often is data updated? Is that webpage updated automatically?

Hi droiddk. This page https://meteocaldas.com/ws is updated everytime you open it or refresh it. Data from Ecowitt is beeing received every 300 seconds and upadating a database in my server. Ken's fantastic ws.zip has the script to create tables in the data base and works fine.
Since I use this Ecowitt data for further processing in my site, (by creating a realtime.txt file that can be treated in a similar way cumulus does), I am doing a cronjob every 300 seconds to update that "fake" realtime.txt file.
Once again many many thanks to KenW for his fatastic WS script and for the precious support that he gave me. Thanks Ken!
Title: Re: WS View "Customized"
Post by: KenW on January 07, 2020, 03:59:59 PM
I think I should clarify the above.  The data goes from the weatherstation to the web server, there to be stored in a database, and a file written each receive, for quick reading if someone views the web page.
The transmitted data is in Ecowitt format.  It doesn't come "from" Ecowitt.
My graphs only show last day (last 24 hours) and last week, but of course more could be displayed.
Caution:  The database just keeps expanding.  An occasional manual cleanout is probably good.

I have two web pages, one for PC,  one for phone.  They are only slightly different, mainly text size.
What I've done with previous WS software, was add a refresh to the HTML, so that for local devices, ie on my home network, a web page would get refreshed automatically.  That was for things like a tablet, displaying the weather page continually, but automatically getting updated.
I haven't added it to this package (yet).

If anyone uses my code and gets errors from it, please let me know, and I'll fix it.  -Send me your error log.
Current version is at https://waggies.net/files/ws-1.01.zip (https://waggies.net/files/ws-1.01.zip)
Title: Re: WS View "Customized"
Post by: Vetti52 on January 08, 2020, 03:00:25 PM
Hi Vetti52. I had the same problem of not receiving data and with the precious help of KenW I finaly managed to receive it. If you install Ken's ws.zip and still don't receive data, be sure that the problem is not with the zip because it is FANTASTIC and works like a charm :-) 
How did I solve the situation?
My first problem was that my http:// site was redirected to https:// so I had to return it to HTTP OR HTTPS.
Second problem is that in WS VIEW in the server IP/hostaname entry I had http://mysite.com and had to remove the http://
For Ken's script, PATH should be left at default /data/report/ and port 80 upload interval 300 is fine for it to work.
You can see the result here https://meteocaldas.com/ws
You will also need a PASSKEY that can be seen after first data is received.
Hope this helps :-)
Thanks, Meteocaldas!

Removing http:// did the job! As I have another web service running on the same RPi4 for a Unifi controller, my Lighttp server did not start using https, port 437 already in use, neither using port 80. But without the string "http://" at the beginning and using port 9000, the connection is established perfectly.
So, for the beginning I see my PWS data imported into Weewx. Next step is to get the data into some nicer presentation. So I will give Ken's solution a try, although I am not sure, how to realize, as I am not experienced in understanding and editing PHP. But hopefully Ken will help.

OTOH now there is the opportunity to upload the data from Weewx to Windy. Just before doing this, I would like to find out, how to interpret the raw data from customized WS View. It seems, that, especially for pressure, there are different approaches. When uploading to Ecowitt or WU directly, the data provided for relative pressure are used without modification. Weewx, however, takes the absolute pressure data and calculates relative pressure in a different manner than the PWS 2900 does (in fact, I observe, that there is just a simple difference of about 27 hPa between WS2900 absolute and relative pressure data). So, before I will contact Windy.com, I would like to make sure, that all data are reliable. Maybe it is better, first to go into Ken's solution.

The next step is waiting now!
Title: Re: WS View "Customized"
Post by: raffaello.dimartino on January 10, 2020, 01:38:59 AM
It does what is written.
When I received the GW1000 I was looking for something that could send data externally to my Meteotemplate and weewx I have in my office.
GW1000 can send data via Customized Server in Ecowitt protocol (more complete)
I wrote this Gateway to receive data from it and send data to Meteotemplate, weewx and so on.
After, I decided to have a simple gateway inside the ecowitt extension for weewx.

The interceptor works inside the same network of the GW1000, just like the WSView does using the GW1000 API. Mine uses the http protocol API of Customized section

That's all.
And I should say thank to all people that put their work on github wher I found many examples.

This is the result:
http://www.kwos.org/poggiocorese_ecowitt/indexDesktop.php

or this

http://www.kwos.it/joomla/weather-monitoring/weather-stations/ecowitt-weewx
Title: Re: WS View "Customized"
Post by: darb81 on March 03, 2020, 06:08:31 AM
I have a B-Hyve irrigation controller and a PanTech wh2900 WS, I have been searching the last 2 weeks on the net for a way to be able to connect the two together but I'm having no luck.  Why does it have to be so damn hard?
I feel like I've this site is the closest I've come to finding a way to do it but I've read every post and it still doesn't seem that easy to understand.  Is there anyone out there that can assist me so my B-Hyve controller can receive weather data from my own PWS or do I have to be some type of programmer to even have the slightest chance?
Title: Re: WS View "Customized"
Post by: galfert on March 03, 2020, 06:35:28 AM
I have a B-Hyve irrigation controller and a PanTech wh2900 WS, I have been searching the last 2 weeks on the net for a way to be able to connect the two together but I'm having no luck.  Why does it have to be so damn hard?
I feel like I've this site is the closest I've come to finding a way to do it but I've read every post and it still doesn't seem that easy to understand.  Is there anyone out there that can assist me so my B-Hyve controller can receive weather data from my own PWS or do I have to be some type of programmer to even have the slightest chance?

The B-Hyve gets data from Aeris. The Aeris data comes from two types of weather station networks.
- MADIS, which is something you can do if you put your station on CWOP. But this will require extra hardware and software for your station. This is more complicated than the next option.
- PWSweather, which is something you can do if your station under the WS View mobile app shows a Customized server upload. Just create a PWSweather account and upload there.

See here for how to configure for PWSweather:
https://www.wxforum.net/index.php?topic=38500.msg396026#msg396026

Follow instructions here for how to select your PWSweather station.
https://bhyve.orbitonline.com/topic/how-to-add-my-personal-weather-station/

If your Pantech station does not have a Customized server option in the WS View app then I would recommend getting an Ecowitt GW1000 with matching frequency of your Pantech so that the GW1000 can pick up your sensors. The GW1000 has the Customized server option.
Title: Re: WS View "Customized"
Post by: darb81 on March 03, 2020, 02:36:57 PM
Wow, so it's really that easy? Yes the app does have a customised server upload, thanks so much, I will check out that link and enter in the details.
Title: Re: WS View "Customized"
Post by: dryale on March 21, 2020, 09:33:48 AM
is it possible to point my ecowitt HP2551-C to ambientweather.net portal?  i assume i need to use the ecowitt protocol

Does anyone know what the domain and port are?

i tried www.ambientweather.net port 80 but it does not connect

Title: Re: WS View "Customized"
Post by: Rover1822 on March 21, 2020, 10:02:20 AM
Hi, this was answered in your other post https://www.wxforum.net/index.php?topic=39044.msg401461#msg401461

The customized server option is not a way to post "directly" to Ambientweather.net.

Title: Re: WS View "Customized"
Post by: buffy on April 30, 2020, 11:25:30 AM
maybe you can use my simple php script to get data from station to server.

https://www.wxforum.net/index.php?topic=39339.0 (https://www.wxforum.net/index.php?topic=39339.0)
Title: Re: WS View "Customized"
Post by: eahill on May 04, 2020, 12:29:47 AM
Hi Folks,

Just an FYI I managed to get the WS View "Customized" Ecowitt protocol instead of the Weather Underground one worked out. Here is the PHP file I used to be able to receive this, in case it helps save anyone else an hour.

In the code, $wxdata is a PHP array containing all the data. This script will write a text file to the server at each upload interval.

Eric

Code: [Select]
<?php

// RECEIVE ECOWITT GW1000 DATA
// CONFIGURATION IN WS VIEW
// Enabled
// Protocol: Ecowitt
// Server IP / Hostname: example.com
// Path: /path/to/filename.php?   Make sure to have the leading slash, and the ending ?
// Port: 80
// Upload Interval: >= 16s 

// RETRIEVE DATA
$raw_data file_get_contents('php://input');

// CONVERT TO ARRAY
$newarray explode('&'$raw_data);

foreach($newarray as $na) {
$temp explode("=",$na);
$wxdata[$temp[0]] $temp[1];
}

// PHP ARRAY WITH ALL DATA HERE:
// print_r($wxdata);

// WRITE TO A FILE (optional)
$timestamp strtotime("now");
$filename 'wxdata_'.$timestamp.'.txt';
$wx_export  var_export($wxdatatrue);
file_put_contents($filename$wx_export);

?>


Example output from my station:
Code: [Select]
array (
  'PASSKEY' => XXXX,
  'stationtype' => 'GW1000B_V1.5.8',
  'dateutc' => '2020-05-04+04:31:22',
  'tempinf' => '73.2',
  'humidityin' => '53',
  'baromrelin' => '29.616',
  'baromabsin' => '29.616',
  'tempf' => '69.6',
  'humidity' => '79',
  'winddir' => '159',
  'windspeedmph' => '0.00',
  'windgustmph' => '0.00',
  'maxdailygust' => '3.36',
  'solarradiation' => '0.00',
  'uv' => '0',
  'rainratein' => '0.000',
  'eventrainin' => '0.000',
  'hourlyrainin' => '0.000',
  'dailyrainin' => '0.000',
  'weeklyrainin' => '0.000',
  'monthlyrainin' => '0.000',
  'yearlyrainin' => '0.000',
  'totalrainin' => '0.000',
  'wh68batt' => '1.64',
  'wh40batt' => '1.6',
  'wh26batt' => '0',
  'freq' => '915M',
  'model' => 'GW1000_Pro',
)
Title: Re: WS View "Customized"
Post by: droiddk on May 04, 2020, 10:02:30 AM
Hi Folks,

Just an FYI I managed to get the WS View "Customized" Ecowitt protocol instead of the Weather Underground one worked out. Here is the PHP file I used to be able to receive this, in case it helps save anyone else an hour.

In the code, $wxdata is a PHP array containing all the data. This script will write a text file to the server at each upload interval.

Eric

Code: [Select]
<?php

// RECEIVE ECOWITT GW1000 DATA
// CONFIGURATION IN WS VIEW
// Enabled
// Protocol: Ecowitt
// Server IP / Hostname: example.com
// Path: /path/to/filename.php?   Make sure to have the leading slash, and the ending ?
// Port: 80
// Upload Interval: >= 16s 

// RETRIEVE DATA
$raw_data file_get_contents('php://input');

// CONVERT TO ARRAY
$newarray explode('&'$raw_data);

foreach($newarray as $na) {
$temp explode("=",$na);
$wxdata[$temp[0]] $temp[1];
}

// PHP ARRAY WITH ALL DATA HERE:
// print_r($wxdata);

// WRITE TO A FILE (optional)
$timestamp strtotime("now");
$filename 'wxdata_'.$timestamp.'.txt';
$wx_export  var_export($wxdatatrue);
file_put_contents($filename$wx_export);

?>


Example output from my station:
Code: [Select]
array (
  'PASSKEY' => XXXX,
  'stationtype' => 'GW1000B_V1.5.8',
  'dateutc' => '2020-05-04+04:31:22',
  'tempinf' => '73.2',
  'humidityin' => '53',
  'baromrelin' => '29.616',
  'baromabsin' => '29.616',
  'tempf' => '69.6',
  'humidity' => '79',
  'winddir' => '159',
  'windspeedmph' => '0.00',
  'windgustmph' => '0.00',
  'maxdailygust' => '3.36',
  'solarradiation' => '0.00',
  'uv' => '0',
  'rainratein' => '0.000',
  'eventrainin' => '0.000',
  'hourlyrainin' => '0.000',
  'dailyrainin' => '0.000',
  'weeklyrainin' => '0.000',
  'monthlyrainin' => '0.000',
  'yearlyrainin' => '0.000',
  'totalrainin' => '0.000',
  'wh68batt' => '1.64',
  'wh40batt' => '1.6',
  'wh26batt' => '0',
  'freq' => '915M',
  'model' => 'GW1000_Pro',
)

Wow that is hacker-friendly! Anyone, please don't use above script as it is! Some sort of password checking should be added.

Regards
Title: Re: WS View "Customized"
Post by: eahill on May 04, 2020, 10:37:25 AM
Yes, this is not "production-ready", this is for development only. This was only to help start since there is no documentation on WS View's Custom protocols. Someone else feel free to add on -- looking at you droiddk.
Title: Re: WS View "Customized"
Post by: wvdkuil on May 04, 2020, 11:25:27 AM
Yes, this is not "production-ready", this is for development only. This was only to help start since there is no documentation on WS View's Custom protocols. Someone else feel free to add on -- looking at you droiddk.

For this very dangerous type of scripts, one should always check if a legitimate sender sends correct data. 

Ecowitt protocol has a PASSKEY you can check if the sender is legitimate.
And one or more fields which should always be filled should be checked also.

I attach a more "distrustful" script.
One can add checking contents length of all fields if they do not contain to many characters a.s.o.

Wim
Title: Re: WS View "Customized"
Post by: evilkos on June 23, 2020, 05:39:01 AM
Just in case anyone else stumbles onto it, I had problems setting up Ecowitt GW1000 for my use case: climate automation that starts by Ecowitt GW1000 regularly reporting the temperature readings to my custom script (hosted as an Azure Function, but that doesn't matter). So here's a little guide for future self or anyone else who this might help.

1. Plug in the device.
2. Install the "WS View" app on your Android or iOS device. For me personally their Android app did not work when pairing, but others say it's fine.
3. Click the hamburger and choose "Configure New Device" (or maybe you won't have to if you just installed the app).
4. Choose the image of your device, click Next.
5. Follow the instructions on screen (hold the line of LEDs on the device that doesn't seem to be a button until it flashes rapidly in red). Check the checkbox, click Next.
6. When instructed, manually go to Settings, choose the GW** Wifi hotspot and return to the app.
7. The app should report the device as set up.
8. Close the app properly, reopen it, go to the hamburger, Device List.
9. Wait for the device to be discovered, when it is - click on it.
10. Click More in the top right corner, choose Weather Services.
11. Click Next until you get to "Customized"
12. Click Enable, leave protocol at Ecowitt.
13. Enter your hostname (not URL, so no https:// or http:// here, and no path, no port), or the IP. That's the server that hosts your script. Example: user123.randomscripthost.com
14. Enter the Path, starting with a slash "/". Example: /api/v1/mymegaapi/method
15. Leave the port at 80 or change if needed. I believe this thing can only send HTTP requests, and you're out of luck with HTTPS, and simply setting port 443 won't work. So make sure your server is configured to accept HTTP requests (many aren't nowadays unless you override this server-side).
16. Click Save. It must give you an animation that it's saved. If not, properly close the app and start from #8
17. Very important to also go back, click More again, click Device Settings and there click Reboot Device. Without that step my device didn't correctly resolve the hostname via DNS and simply sent all the requests to the gateway (router IP), which has driven me nuts for a couple of days!

18. Done! But if you're still not seeing requests come in server-side, good ways to debug:
a) Configure it (via steps above) to send requests to your local PC where you can set up a server for that port and monitor requests. I did that by installing and running https://www.npmjs.com/package/http-echo-server (requires installation of Node.js)
b) On your Windows 10 laptop, click the button in the bottom right to bring up the notification area and turn on the Mobile hotspot. You can see the name and password if you press Start and start entering "Mobile hotspot settings". Then you can reset Ecowitt to factory settings and reconfigure it to this wi-fi hotspot on your laptop, and then you can monitor any incoming requests via Wireshark. That's how I knew the device was sending requests to the incorrect IP and didn't even try to run DNS queries (which looks like it only does after reboot). Make sure to choose the correct network adapter - that won't be your normal WiFi network, and instead a new one.
19. If all else fails, also may help to reset the device to factory settings through the app (that's how I reconfigure it to a new WiFi hotspot) AND/OR update firmware (also through the app).

Hope this helps anyone that has trouble with ecowitt customized server not sending requests properly.

Also, by way of 18 b there may be a way to figure out how to get the temperature from the device directly (like, point your Raspberry Pi to it and have it poll the sensor constantly and then run any automation). Not sure if it's been figured out already, but Wireshark can probably capture those packets if you connect both the weather station and your iOS device to your laptop wi-fi access point and monitor packets on the correct network adapter.
Title: Re: WS View "Customized"
Post by: galfert on June 23, 2020, 08:49:47 AM
You lost me on step 2.
Title: Re: WS View "Customized"
Post by: evilkos on June 23, 2020, 08:52:39 AM
Oh no!
Title: Re: WS View "Customized"
Post by: Rover1822 on June 23, 2020, 09:19:45 AM
The android version of WS View works just fine.

I've not had issues with it.

Title: Re: WS View "Customized"
Post by: evilkos on June 23, 2020, 09:36:19 AM
Fair enough, edited.
Title: Re: WS View "Customized"
Post by: tommyD on July 05, 2020, 10:16:35 PM
I am setting up KenW weather station and it asks for the ecowitt passkey. I don't think this was supplied to me.
Any ideas on how I can get it.
Thanks in Advance
Tom
Title: Re: WS View "Customized"
Post by: galfert on July 05, 2020, 10:43:45 PM
I am setting up KenW weather station and it asks for the ecowitt passkey. I don't think this was supplied to me.
Any ideas on how I can get it.
Thanks in Advance
Tom

Seems to me like you have taken a wrong turn. I just can't quite figure out what your are trying to accomplish to get you back on track. What is KenW?    Kenosha Regional Airport? Or is it the PBS station in New Mexico? Or something else?
Title: Re: WS View "Customized"
Post by: tommyD on July 05, 2020, 10:55:52 PM
I am using a fine-offset wh2900 and ws-view

Nope, sorry about that.
I am trying to log my weather details into a mysql database for my own website.
KenW (a fellow user) has a file in his post above (https://waggies.net/files/ws-1.01.zip) which I have setup on my server at home.
It mentions the passkey for ecowitt.
I do have a 5 digit id that is used in the website on ecowitt.net would this be it?

Tom
Title: Re: WS View "Customized"
Post by: galfert on July 05, 2020, 11:11:07 PM
Ok apologies to KenW  #-o  :oops:

I just looked at his code. Seems like KenW has identified a passkey that the Ecowitt upload does from your station console upload to Ecowitt.net. He even mentions that he has no idea what your passkey would be. Seems like we will need him to answer this question about his code. Unless someone else understands this better. It would seem to me that he used a packet sniffer to figure this out. But I'm not sure why he is capturing the Ecowitt upload instead of just using the Customized upload in Ecowitt format.
Title: Re: WS View "Customized"
Post by: tommyD on July 06, 2020, 12:11:47 AM
My setup has a website hosted from home.
https://rolandweather.ddns.me/ws
on the ws view I have
server: rolandweather.ddns.me
also I have tested my local ip for my server (10.1.1.xx)
path: /data/report
this path has 777 permissions

i have an index.php file with this to log any file
Code: [Select]
<?php
$str 
print_r($_POSTTRUE);
$fh fopen('output.txt''w');
fwrite($fh$str);
fclose($fh);

I am not getting any data from my wh-2900
Tom
Title: Re: WS View "Customized"
Post by: tommyD on July 06, 2020, 01:46:57 AM
I am using a Australian Jaycar branded XC0370. This is a fine-offset wh2900 clone.
WS view says i have EasyWeatherV1.50.
Can I or do I need to do a firmware upgrade.
The app does show and use ecowitt and I have setup that as well.
Tom
Title: Re: WS View "Customized"
Post by: Rover1822 on July 06, 2020, 09:35:24 AM
1) I don't think the device supports HTTPS, since this is a local server, see if it will accept HTTP, or have your server configured to accept HTTP
2) I think there was an issues with someone having a 10.X.X.X subnet as opposed to the more common 192.168.X.X
3) Try using the IP address for your local server instead of the Domain Name in WS View. Your rolandweather.ddns.me will get resolved on an external DNS server and point to your public IP address. Your router may not allow this from an internal request. Unless you also have your own internal DNS server that points to the local IP of 10.x.x.x . Depends on the router in use and its configuration. (If you can get to the site from your local network, you probably don't have this issue)

Unfortunately I do not use PHP a lot.





Title: Re: WS View "Customized"
Post by: tommyD on July 06, 2020, 03:44:30 PM
I will see what I can do with the 192. xx My local subnet is 10.1.xx.
Is their any way to get the latest firmware. I have 1.5.0 Could this be the problem?
Tom
Title: Re: WS View "Customized"
Post by: Rover1822 on July 06, 2020, 06:37:20 PM
If you can connect to your system with WS View , it should have told you if you need an upgrade.

Title: Re: WS View "Customized"
Post by: tommyD on July 06, 2020, 10:06:20 PM
It is connected with WS view on both android and iPhone. Is their any other way to force an upgrade on firmware?
Title: Re: WS View "Customized"
Post by: galfert on July 06, 2020, 10:36:59 PM
I believe that for your model 1.5.0 is the latest firmware.
That would be WH2910C / WH2900

GW1000 is on 1.6.0

Every model has their own firmware. They are separate. Just because an update is released to address a bug in one does not mean that an update is needed for a different model. They each follow their own version increase numbering. If an update is made to add a feature to multiple consoles at around the same time then they all increase from where they were before, but even this does not cause the version numbers to end up matching each other.
Title: Re: WS View "Customized"
Post by: tommyD on July 07, 2020, 12:17:19 AM
Have had some success.
I setup a Raspberry PI with a hot-spot which has a 192.168.xx address and it works.
Now to see what I can do.
So much of a shame that the 10.1.xx does not work. Is it something that could be requested>

Tom
Title: Re: WS View "Customized"
Post by: Vetti52 on July 07, 2020, 09:21:28 AM
Fair enough, edited.
Fair enough, you could address one Android problem, which the Apple app does not show: On Android devices WS View tries automatically to stop your connection to your home network access point and open the connection to the access point of the station by itself. But that is not always successful. So in case, searching for the station's access point fails, it might be an alternative, to open Android's Wifi setup page and connect to the access point manually, such as you do with Apple's devices.

Another problem, I have seen, is, that some routers/access points have disabled the communication among wireless clients. This was also the case in my guest network, where i wanted to work my smart home devices separated from the rest of my home network. So, after the station had connected to the guest network, it could no longer communicate with my smartphone in the same network. I had to repeat the whole thing in my home network, where I could explicitely enable communication among wireless devices. I could connect to the device, enable uploading to weather services, and calibrate the pressure. I could move the station back to the guest network, even without being connected, because, when enabling "hide SSID" in the settings dialogue, you can enter whatever SSID you want. It will just be written into the configuration setting of the station, and if all was correct, it will connect to that network. The connection to WS View, however, will be lost that way, if the smartphone is not connected to the same network and if communication of wireless clients is disabled.

It would be nice, if there was a way to setup the station with a LAN based configuration software. Ecowitt had provided a software last year for GW1000: "WiFi Configuration with PC Software (WS_Connect_Router Setup(0530).zip)", which is currently no longer available on their web site. So I don't know, it this software would still be functional. Then only the connection to the wireless network must have been established with WS View. The rest of the administration could be done much more convenient.
Title: Re: WS View "Customized"
Post by: Mandrake on July 07, 2020, 09:44:59 AM
The GW1000 PC software is still there:
http://www.ecowitt.com/upfile/201905/WS_Connect_Router%20Setup(0530).zip

Title: Re: WS View "Customized"
Post by: Vetti52 on July 07, 2020, 11:21:03 AM
The GW1000 PC software is still there:
http://www.ecowitt.com/upfile/201905/WS_Connect_Router%20Setup(0530).zip
ok, thanks! I did not find it on the manual page. Does anyone have experience with it?
Title: Re: WS View "Customized"
Post by: Rover1822 on July 07, 2020, 11:33:15 AM
My limited experience with it, I found WS View to be a better option. But I only tried it once, and may not have had the GW1000 in the proper mode.

Title: Re: WS View "Customized"
Post by: Vetti52 on July 07, 2020, 12:48:21 PM
Ok. So I may try, if I need it. At the moment, I do not use WS View either. I am satisfied collecting and viewing the data with Weewx and on Ecowitt.net. I have seen foshkplugin.phantasoft.de/generic/ which introduces a plugin into a loxone environment, which currently can at least restart a GW1000 directly. Maybe, there will be some nice solution for Weewx in the future?
Title: Re: WS View "Customized"
Post by: galfert on July 07, 2020, 01:04:49 PM
There is no real alternative to WS View. You MUST use WS View to manage your GW1000 or other Fine Offset clones.
(and in the case of Ambient the equivalent awnet app)

That PC application is only for joining a new station onto your WiFi (or for a factory reset station). That is all it does. It does not fully replace the functionality of WS View. The purpose of the PC application is for people that were having difficulty connecting the station to WiFi with their mobile. But once connected then they can utilize the WS View app for the continuation of the station setup (calibration, upload settings, firmware updates etc.).

Even if you are using WeeWX or any other means of getting data you still must periodically use WS View to maintain your station. You'll need WS View to calibrate the sensors (at least the barometer will need adjustment on the GW1000), and you'll need WS View to do regular firmware updates (on all models) which are highly recommended as often bugs are discovered.

That said....the Fine Offset API that WS View uses is documented and available to certain software developers like (Cumulus MX, Meteobridge, Weather-Display, and WeeWX). This means that if these software developers wanted they could implement the functionalities of WS View in regards to maintenance (calibration, changing settings..etc.). But as of this moment none of them have done this and I don't see a reason that they should. The purpose of these software is just to get live data. I think maintenance tasks should be reserved for the WS View. I do though see a potential reason for perhaps adding functionality to these software and that would be for the remote management of the station hardware. Currently it requires the WS View app for reasons I've stated....but if these software were to implement these added capabilities then the station could more easily be managed remotely and not require a mobile device on the local network.....BUT...I've already come up with a resource to manage a station remotely using WS View. All you need is to install an Android emulator into a computer to which you then install WS View and then you remote into said computer. There are several Android emulators. For now my preference is NoxPlayer.
More details:
https://www.wxforum.net/index.php?topic=36792.0

The WS View app could perhaps have been given a better name I think. Its name insinuates that it is just for "viewing" data, but it does so much more and it is indispensable.
Title: Re: WS View "Customized"
Post by: Vetti52 on July 07, 2020, 02:54:14 PM
Great, Galfert!!!

I agree, that we must use WS View for now. But, as you also stated, there is also a need for manageing devices in a regular (home) net environment. And that is LAN based. So, of course the first step must be to adopt the console into a wireless connection, where WS View is mandatory. But everything else should manage this wireless client by means of network setting, which can be adopted to the special needs of each home or professional network. I do not know much about android emulators, but I would expect, that the network emulation is not that trivial to keep it working. And still then, it is far from an integrated management system, e.g. creating backups, or running a watchdog to restart on errors.
But, I think, that one reason for the lack of developements of an integration into a management environment is, that the station usually works for months without any hands on time. So, for the occasional updates and calibrations WS View does the job.
In my eyes, the term WS View says, that you need it to view the device in your net. And this function remains essential.
Title: Re: WS View "Customized"
Post by: Rover1822 on July 07, 2020, 03:01:03 PM
I kind of agree with you. I also look at market demand etc and labor costs. The current drive for just about anything is to go "mobile device". 
And if there is insufficient demand for alternative access or applications, probably not worth the development investment.



Title: Re: WS View "Customized"
Post by: olicat on July 07, 2020, 03:47:54 PM
Technically, it is no problem to do the configuration via a web interface for example or a PC-program.
I had already considered that for FOSHKplugin. And I also do it partially - for example to configure the interval or the custom server itself (server ip, path, port, Ecowitt/WU).
The commands for configuration and calibration are pretty well documented.

But I don't really see the need for a solution other than WS View, because you don't have to do it that often.

But what annoys me (and what I've already told Lucy - Ecowitt wants to think about it) is that WS View always searches for the weather station via UDP and you can't just store its IP address. Because the UDP search via broadcast only works in the local network and not across a router.
If you could specify the IP address, you could also work with WS View on the go - for example via VPN - or from other connected networks.

But - at all - I like WS View and prefer to put my programming work into things that are not yet so well implemented or possible at all.

Oliver
Title: Re: WS View "Customized"
Post by: Vetti52 on July 09, 2020, 09:10:21 AM
Sounds reasonable, not to double work, if not necessary.

But my simple example, e.g. in case, the console rejects to send data, just initiate a reset of the console, which is observed by a watchdog on the server. I thought, this could be part of functions of your FOSHplugin. Anyway, it is hard to realize with WS View alone.

No matter, if UDP or TCP or any other connection would be established, it will need to implement a standardized interface, to interact with. Well, there is this well documented API, but it seems, that there are not efforts to integrate it into server oriented systems.
Title: Re: WS View "Customized"
Post by: olicat on July 09, 2020, 09:46:22 AM
Hi!

FOSHKplugin already detects that the weather station is no longer sending values and notifies the user in various ways (Log, UDP, http). FOSHKplugin can also reboot the weather station if requested by the user. At least for the GW1000 (only that I have here) this works.

What I have deliberately not implemented so far is that FOSHKplugin automatically restarts the weather station. On the one hand, this was previously not necessary (I have been operating the GW1000 since November 2019 without any problems). On the other hand, I do not like such poorly monitored automatisms - any real problems may not be recognized or an error in the program (or in it's configuration) leads to constant restart of the weather station.

For security reasons I have only installed a reboot option via UDP.
However, installing this for the FOSHKplugin web interface would be very easy.
But:
An http request like http://ip-address:port/FOSHKplugin/rebootWS can be done by anyone with a browser.

Maybe we can better discuss that in the FOSHKplugin thread.

Regards, Oliver
Title: Re: WS View "Customized"
Post by: Vetti52 on July 09, 2020, 02:42:37 PM
Hi, Oliver!

As I had detected, that FOSHKplugin can reboot the GW1000, my hope raized, that there will be an implementation of "regular" administration of the station, without the need of WS View in it's original manner.
And, of course, if the wireless connection is broken, there will be no way to administer the device remotely. But rebooting under certain conditions is just one point of the whole thing. Maybe, there is some interest to engage in this project here. For FOSHKplugin, I agree, that we should discuss in the FOSHKplugin thread or in https://www.loxforum.com/
Title: Re: WS View "Customized"
Post by: sstracy on April 09, 2021, 01:07:52 AM
I realize that this is an older topic but I just wanted to join in and say thank you to everyone who had contributed with the helpful information within this topic! I'm not too terribly advanced developer but with this provided information, I was able to connect my GW1000 to a little WordPress website to make a simple web page for my plant! :) With a little added code, I have also created a simple algorithm to estimate when I might need to water next. :)

https://bigbirdy.live/

Thanks again and take care to you all!
Scott
Title: Re: WS View "Customized"
Post by: PaulQM on October 25, 2021, 01:17:47 PM
Hi,
If anyone is still active on this thread, could you please tell me what info goes into the following in KenW’s scripts. 
 
public $kensId = 'xxx'; // ***
public $names = array('Waggies', 'Petes');  //***
public $authPassword = 'xxx';       // ***

thanks
P…
Title: Re: WS View "Customized"
Post by: Rover1822 on October 25, 2021, 01:41:54 PM
Hi,
If anyone is still active on this thread, could you please tell me what info goes into the following in KenW’s scripts. 
 
public $kensId = 'xxx'; // ***
public $names = array('Waggies', 'Petes');  //***
public $authPassword = 'xxx';       // ***

thanks
P…


I think you should create a new thread (topic) , outlining everything , and then the question.

Rover
Title: Re: WS View "Customized"
Post by: meteocaldas on October 26, 2021, 11:38:53 AM
Hi,
If anyone is still active on this thread, could you please tell me what info goes into the following in KenW’s scripts. 
 
public $kensId = 'xxx'; // ***
public $names = array('Waggies', 'Petes');  //***
public $authPassword = 'xxx';       // ***

thanks
P…

Hi Paul

This is what I have in my config.php:

          // yes, this could be more generalised
          public $kensId = 'ECAB8A15AB6E8273CF50530D39E6A9EA'; // *** Ecowitt PASSKEY for weather station 1.
          public $petesId = 'xxxyx';  // *** leave unchanged if you only have one weather station or insert ecowitt passkey for your second station

        public $nameIndex = 0;  // default index 
        public $names = array('MeteoCaldas', 'MeteoLitoral');  //*** names to show on html for each weather station (1 and station 2. Even if you have no 2nd station, use a name for it)
        public $locations = array('C. Rainha MC',  'C. Rainha ML');   // *** names for location of the stations 1 and 2. Even if you have no 2nd station, use a name for it)                             '
        public $locale = 'Europe/London';  // ***
   public $timeFormat = '%Y-%m-%d %H:%M:%S';

        public $onMobile = false;

        //DB
        public $dbhost = 'localhost';
        public $dbname = 'xxxxx';  // *** put here the name of the database you have created
        public $dbtablenames = array('station1', 'station2');    // ***name of the tables you have created in DB. Even if you only have one station, you can create 2 tables
        public $dbtablename = 'station1';    // *** choose you preferred name for DB table
        public $dbpassword = 'xxxx';  // *** Password to acess your DB

        public $showInside = false;
        public $authCookie = 'insider';
        public $authPassword = 'xxxx';  // *** Password to set cookie that allows you to see indoor data


Hope this may help you.

Title: Re: WS View "Customized"
Post by: PaulQM on October 27, 2021, 03:52:22 AM
Exellent, thank you so much.

P..
Title: Re: WS View "Customized"
Post by: McMelloW on November 18, 2021, 08:44:55 AM
Hi to all,

My name is McMelloW and new to this forum. This week, I bought a Fine Offset Clone called Waldbeck Huygens. 
This has to be configured wit WS View (plus)  It all went fine, made a connections to my WiFi  and found a device  EasyWeather-WIFIxxxx with an IP address etc.  Sending data to a WU station works fine is.

However switch to a customized server does not work at all. I have tried a station a www.pwsweather.com  or to my Raspberry Pi  but both servers are not receiving any data at all.

Any one with a golden tip or hint?

Greetings, McMelloW
Title: Re: WS View "Customized"
Post by: olicat on November 18, 2021, 08:59:36 AM
Hi!

For PWSWeather you should configure in the Customized Server-settings:
Code: [Select]
Customized: Enable
Protocol: Wunderground
Server IP: www.pwsweather.com (without http and slash!)
Path: /pwsupdate/pwsupdate.php? (keep the ? in mind!)
Station ID: (your PWSWeather-ID)
Station Key: (your PWSWeather-Key)
Port: 80
Upload Interval: 300
A connection to your Raspi would also have to be configured in the same way. No http and no path information in the host name and don't forget the question mark in the path.
Your router should be configured so that devices can communicate with each other. (The Fritzbox has a corresponding configuration point.)
Ecowitt-protocol will be transferred as http/POST; Wunderground is sent by http/GET.

Oliver
Title: Re: WS View "Customized"
Post by: McMelloW on November 18, 2021, 09:31:03 AM
Hi!

For PWSWeather you should configure in the Customized Server-settings:
Code: [Select]
Customized: Enable
Protocol: Wunderground
Server IP: www.pwsweather.com (without http and slash!)
Path: /pwsupdate/pwsupdate.php? (keep the ? in mind!)
Station ID: (your PWSWeather-ID)
Station Key: (your PWSWeather-Key)
Port: 80
Upload Interval: 300
A connection to your Raspi would also have to be configured in the same way. No http and no path information in the host name and don't forget the question mark in the path.
Your router should be configured so that devices can communicate with each other. (The Fritzbox has a corresponding configuration point.)
Ecowitt-protocol will be transferred as http/POST; Wunderground is sent by http/GET.

Oliver

Thanks very much for your reply.
This is exact what I used for pwsweather.com  But the station has not received any data.
WS View Plus reports as EasyWeater v1.5.9

McMelloW
Title: Re: WS View "Customized"
Post by: olicat on November 18, 2021, 09:56:59 AM
Hi!

Quote
WS View Plus reports as EasyWeater v1.5.9
Which station is this in reality? Please check here (https://www.wxforum.net/index.php?topic=40730.0).
Perhaps you have to update the device firmware, if it is a HP2551C. There were some problems regarding cusom server fixed recently.

Oliver
 
Title: Re: WS View "Customized"
Post by: McMelloW on November 18, 2021, 11:29:07 AM
Hi!

Which station is this in reality? Please check here (https://www.wxforum.net/index.php?topic=40730.0).
Perhaps you have to update the device firmware, if it is a HP2551C. There were some problems regarding cusom server fixed recently.

Oliver
My PWS is Waldbeck Huygens (10032850). Seen in the column with also WH2910, WH3000SE, WS-2902AB etc.  It comes with a 5-1 sensor set. 
How can I discover the firmware version and how can you update the firmware?

Title: Re: WS View "Customized"
Post by: olicat on November 18, 2021, 11:42:29 AM
Hi!

Since it is a WH2910 you can not update the device firmware.
So the problem is somewhere else.
You could try to install FOSHKplugin onto your Raspi. Then you would see the incoming data there (and have the possibility to monitor the outgoing data to PWSWeather.
But probably this is another thing ...
Beside that I do not have an idea, sorry.

Oliver
Title: Re: WS View "Customized"
Post by: Rover1822 on November 18, 2021, 12:11:31 PM
One of us should really setup a site to receive requests and print out the  request , header , and body contents .
I would but my PHP foo not great, I work in JAVA/.Net and I don't have an accessible site that I can use for this with those technologies.
Title: Re: WS View "Customized"
Post by: olicat on November 18, 2021, 12:24:26 PM
Hi!

I'm already working on this.

Oliver

Addendum: Tool's ready (https://www.wxforum.net/index.php?topic=43041.0)!
Title: Re: WS View "Customized"
Post by: davidefa on November 18, 2021, 12:27:58 PM
If you want a small script that logs the requests you can use the attached one ( it logs the requests in a file called params.txt )
You can use it directly online here: http://www.fanometeo.it/template/params.php ( the log file is http://www.fanometeo.it/template/params.txt )


 [ You are not allowed to view attachments ]

P.S.
Sorry forgot to specify: 1 euro cent / call ; - )
Title: Re: WS View "Customized"
Post by: Rover1822 on November 18, 2021, 12:49:55 PM
Not bad Davidefa.
But I would like the raw data, and then perhaps a pretty version of the data. Also , since you are outputting to a single .txt file , which gets overwritten on the next request, might be a better to generate a separate file per request, and as part of the code, create a URL link on another static page to the distinct   data file. There would be concerns about privacy as the key is / may be transmitted and the data would be accessible by anyone.

Other option is to have an argument added to the URL that would then become part of the output file name. So not as public,  does not address every privacy issue , but you would have to know the unique name you supplied as the argument.

I'm thinking of those that do not have a lot of skills , this would be a simple test
 
Title: Re: WS View "Customized"
Post by: McMelloW on November 18, 2021, 01:01:55 PM
Hi!

Since it is a WH2910 you can not update the device firmware.
So the problem is somewhere else.
So if the firmware is not correct and cannot be updated. I have to go back to the shop.
Quote
You could try to install FOSHKplugin onto your Raspi. Then you would see the incoming data there (and have the possibility to monitor the outgoing data to PWSWeather.
I have a Lenovo Laptop with an ubuntu 20.04 partion running.  Can the FOSHKplugin installed and run on ubuntu. Then I can figure out how it works
Quote
But probably this is another thing ...
Beside that I do not have an idea, sorry.

Oliver
I guess there is something with the customized section. It is sending data to the WU website OK now on a regular interval. see https://www.wunderground.com/dashboard/pws/IHARDE61

One last try. I can send the data to WU using the customized set up?  What is the correct website and path.  Do you think this is possible?
Title: Re: WS View "Customized"
Post by: olicat on November 18, 2021, 03:38:14 PM
Hi!

Quote
So if the firmware is not correct and cannot be updated. I have to go back to the shop.
I'm not aware of any faulty firmware for the WH2910 regarding the custom server. It should work in any way.
So this is probably not a problem of your station but of configuration or (network) infrastructure.
But I could be wrong.

Quote
Can the FOSHKplugin installed and run on ubuntu.
FOSHKplugin should work with Ubuntu 20.04 - no problem.

Quote
I can send the data to WU using the customized set up?
Yes. But then you must not send to WU the regular way.
Hostname: rtupdate.wunderground.com
Path: /weatherstation/updateweatherstation.php?
ID: WU-ID
Key: WU-Key
Port: 80

Oliver
Title: Re: WS View "Customized"
Post by: McMelloW on November 19, 2021, 05:10:27 AM
Hi!

Yes. But then you must not send to WU the regular way.
Hostname: rtupdate.wunderground.com
Path: /weatherstation/updateweatherstation.php?
ID: WU-ID
Key: WU-Key
Port: 80

Oliver
Thanks for the info. I have got this working OK.

Finally I found out how to send it to my Raspberry Pi with Domoticz.
Domoticz does not need a path, station ID and station key.  But someway my PWS Console wants something else as empty in these fields. So I filled in Path: /? and something for the station ID and key and it works like a charm.

Thanks for you patience and help.
Title: Re: WS View "Customized"
Post by: B3nE on February 20, 2023, 11:24:12 PM
I got this working with the customised Ecowitt protocol, sending data to a python API > to MongoDb then showing the data on a Flutter application.

Happy to provide more details if anyone wants to do similar.
Title: Re: WS View "Customized"
Post by: Gyvate on February 21, 2023, 11:33:17 AM
Domoticz does not need a path, station ID and station key.  But someway my PWS Console wants something else as empty in these fields. So I filled in Path: /? and something for the station ID and key and it works like a charm.
when time allows I will add a "custom server" section to the MUST READ thread
station ID and key are not needed, (unless this is data the receiver expects)
but when the console doesn't find a minimum path e.g. "/" in the path field, it will not post. That applies for every Ecowitt (clone) console.