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

0 Members and 1 Guest are viewing this topic.

Offline meteocaldas

  • Member
  • *
  • Posts: 12
    • MeteoCaldas
Re: WS View "Customized"
« Reply #75 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 :-)
« Last Edit: January 07, 2020, 02:30:33 PM by meteocaldas »

Offline droiddk

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

Offline meteocaldas

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

Offline KenW

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

Offline Vetti52

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

Offline raffaello.dimartino

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

Offline darb81

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

Offline galfert

  • Global Moderator
  • Forecaster
  • *****
  • Posts: 6822
Re: WS View "Customized"
« Reply #82 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.
« Last Edit: March 03, 2020, 02:41:06 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 darb81

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

Offline dryale

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


Offline Rover1822

  • Forecaster
  • *****
  • Posts: 1989
    • Mini Wind and Solar Data project
Re: WS View "Customized"
« Reply #85 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.

Ambient:
  WS-2000
  PM 2.5(2)
  WH31B(2)
  WH40E
  WH31P
EcoWitt:
  GW1100
  GW1000(4)
  WH31(2)
  WH57
  WH51(12),
  WH40
  WH5360B
  WN34S
  WittBoy WS90 + GW2000
  WS90 (other one) + GW1100
Personal Sites: Weather Cam

Offline buffy

  • Contributor
  • ***
  • Posts: 111
  • My PWS: Garni Ventus 830
    • PWS Monitor
Re: WS View "Customized"
« Reply #86 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

Offline eahill

  • Member
  • *
  • Posts: 2
Re: WS View "Customized"
« Reply #87 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',
)
« Last Edit: May 04, 2020, 12:32:20 AM by eahill »

Offline droiddk

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

Offline eahill

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

Offline wvdkuil

  • Wim van der kuil
  • Forecaster
  • *****
  • Posts: 1986
    • My PWS at Leuven Belgium Europe
Re: WS View "Customized"
« Reply #90 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
« Last Edit: May 04, 2020, 11:30:19 AM by wvdkuil »

Offline evilkos

  • Member
  • *
  • Posts: 3
Re: WS View "Customized"
« Reply #91 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.
« Last Edit: June 23, 2020, 09:36:03 AM by evilkos »

Offline galfert

  • Global Moderator
  • Forecaster
  • *****
  • Posts: 6822
Re: WS View "Customized"
« Reply #92 on: June 23, 2020, 08:49:47 AM »
You lost me on step 2.
Ecowitt GW1000 | Meteobridge on Raspberry Pi
WU: KFLWINTE111  |  PWSweather: KFLWINTE111
CWOP: FW3708  |  AWEKAS: 14814
Windy: pws-f075acbe
Weather Underground Issue Tracking
Tele-Pole

Offline evilkos

  • Member
  • *
  • Posts: 3
Re: WS View "Customized"
« Reply #93 on: June 23, 2020, 08:52:39 AM »
Oh no!

Offline Rover1822

  • Forecaster
  • *****
  • Posts: 1989
    • Mini Wind and Solar Data project
Re: WS View "Customized"
« Reply #94 on: June 23, 2020, 09:19:45 AM »
The android version of WS View works just fine.

I've not had issues with it.

Ambient:
  WS-2000
  PM 2.5(2)
  WH31B(2)
  WH40E
  WH31P
EcoWitt:
  GW1100
  GW1000(4)
  WH31(2)
  WH57
  WH51(12),
  WH40
  WH5360B
  WN34S
  WittBoy WS90 + GW2000
  WS90 (other one) + GW1100
Personal Sites: Weather Cam

Offline evilkos

  • Member
  • *
  • Posts: 3
Re: WS View "Customized"
« Reply #95 on: June 23, 2020, 09:36:19 AM »
Fair enough, edited.

Offline tommyD

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

Offline galfert

  • Global Moderator
  • Forecaster
  • *****
  • Posts: 6822
Re: WS View "Customized"
« Reply #97 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?
Ecowitt GW1000 | Meteobridge on Raspberry Pi
WU: KFLWINTE111  |  PWSweather: KFLWINTE111
CWOP: FW3708  |  AWEKAS: 14814
Windy: pws-f075acbe
Weather Underground Issue Tracking
Tele-Pole

Offline tommyD

  • Member
  • *
  • Posts: 7
    • roland weather
Re: WS View "Customized"
« Reply #98 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
« Last Edit: July 05, 2020, 10:58:22 PM by tommyD »

Offline galfert

  • Global Moderator
  • Forecaster
  • *****
  • Posts: 6822
Re: WS View "Customized"
« Reply #99 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.
Ecowitt GW1000 | Meteobridge on Raspberry Pi
WU: KFLWINTE111  |  PWSweather: KFLWINTE111
CWOP: FW3708  |  AWEKAS: 14814
Windy: pws-f075acbe
Weather Underground Issue Tracking
Tele-Pole

 

anything