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

0 Members and 1 Guest are viewing this topic.

Offline Casper

  • Member
  • *
  • Posts: 2
Re: WS View "Customized"
« Reply #50 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.
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).

Offline KenW

  • Member
  • *
  • Posts: 23
Re: WS View "Customized"
« Reply #51 on: September 08, 2019, 02:37:29 AM »
Apologies Casper.
If you navigate to https://waggies.net/files, can you see the ZIP there and download it?

Offline Casper

  • Member
  • *
  • Posts: 2
Re: WS View "Customized"
« Reply #52 on: September 08, 2019, 02:46:54 AM »
Apologies Casper.
If you navigate to 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]

Offline weerstat

  • Member
  • *
  • Posts: 2
Re: WS View "Customized"
« Reply #53 on: September 15, 2019, 07:55:13 AM »
I tried your Waggies Weather software and it works. Thank you for sharing. [tup]

Offline KenW

  • Member
  • *
  • Posts: 23
Re: WS View "Customized"
« Reply #54 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/

Offline weerstat

  • Member
  • *
  • Posts: 2
Re: WS View "Customized"
« Reply #55 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:
« Last Edit: September 16, 2019, 05:25:21 PM by weerstat »

Offline mr.sneezy

  • Member
  • *
  • Posts: 1
Re: WS View "Customized"
« Reply #56 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

----------------------------------------------------
Stations: Ecowitts WH2900 and WH2081.

Offline theslydog

  • Member
  • *
  • Posts: 47
Re: WS View "Customized"
« Reply #57 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?

Offline galfert

  • Global Moderator
  • Forecaster
  • *****
  • Posts: 6822
Re: WS View "Customized"
« Reply #58 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?
« Last Edit: May 23, 2020, 07:09:13 PM by galfert »
Ecowitt GW1000 | Meteobridge on Raspberry Pi
WU: KFLWINTE111  |  PWSweather: KFLWINTE111
CWOP: FW3708  |  AWEKAS: 14814
Windy: pws-f075acbe
Weather Underground Issue Tracking
Tele-Pole

Offline BGM

  • Member
  • *
  • Posts: 3
Re: WS View "Customized"
« Reply #59 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.

Offline galfert

  • Global Moderator
  • Forecaster
  • *****
  • Posts: 6822
Re: WS View "Customized"
« Reply #60 on: October 05, 2019, 08:14:54 AM »
Perhaps both paths work? I haven't tested.
Ecowitt GW1000 | Meteobridge on Raspberry Pi
WU: KFLWINTE111  |  PWSweather: KFLWINTE111
CWOP: FW3708  |  AWEKAS: 14814
Windy: pws-f075acbe
Weather Underground Issue Tracking
Tele-Pole

Offline droiddk

  • Forecaster
  • *****
  • Posts: 334
Re: WS View "Customized"
« Reply #61 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

Offline theslydog

  • Member
  • *
  • Posts: 47
Re: WS View "Customized"
« Reply #62 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?


Offline bigcountry9907

  • Member
  • *
  • Posts: 2
Re: WS View "Customized"
« Reply #63 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.

Offline raffaello.dimartino

  • Raffaello - IZ0QWM
  • Member
  • *
  • Posts: 40
    • a Kind of Weather Observing Station
Re: WS View "Customized"
« Reply #64 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/

Offline bigcountry9907

  • Member
  • *
  • Posts: 2
Re: WS View "Customized"
« Reply #65 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:

Offline meteocaldas

  • Member
  • *
  • Posts: 12
    • MeteoCaldas
Re: WS View "Customized"
« Reply #66 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!
« Last Edit: January 03, 2020, 08:07:49 PM by meteocaldas »

Offline droiddk

  • Forecaster
  • *****
  • Posts: 334
Re: WS View "Customized"
« Reply #67 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

Offline KenW

  • Member
  • *
  • Posts: 23
Re: WS View "Customized"
« Reply #68 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.

Offline Vetti52

  • Senior Member
  • **
  • Posts: 52
Re: WS View "Customized"
« Reply #69 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!

Offline KenW

  • Member
  • *
  • Posts: 23
Re: WS View "Customized"
« Reply #70 on: January 05, 2020, 01:08:57 PM »
I'm not using WeeWx.  Not sure where you got that idea from.

Offline galfert

  • Global Moderator
  • Forecaster
  • *****
  • Posts: 6822
Re: WS View "Customized"
« Reply #71 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).

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

Offline Vetti52

  • Senior Member
  • **
  • Posts: 52
Re: WS View "Customized"
« Reply #72 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.

Offline raffaello.dimartino

  • Raffaello - IZ0QWM
  • Member
  • *
  • Posts: 40
    • a Kind of Weather Observing Station
Re: WS View "Customized"
« Reply #73 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.
« Last Edit: January 06, 2020, 04:37:48 PM by raffaello.dimartino »

Offline Vetti52

  • Senior Member
  • **
  • Posts: 52
Re: WS View "Customized"
« Reply #74 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?