Author Topic: Advice needed please - GW1001  (Read 4591 times)

0 Members and 1 Guest are viewing this topic.

Offline nathz

  • Member
  • *
  • Posts: 2
Advice needed please - GW1001
« on: June 09, 2019, 02:22:22 AM »
Hi team,

I want to buy my first weather station. I would like one which has all of the bells and whistles expected with a modern weather station in terms of parameters measured, and I want to be able to push the collected data into a sql database which will be hosting on my Synology NAS. I am not really interested in having a screen to view the data (I will design my own display at a later stage), and cloud storage on sounds cool but is not essential either. I have previous experience with raspberry pi's, arduino's and more recently particle photon's, and am a reasonably competent programmer.

I have been doing a fair bit of research over the last couple of weeks and discovered last night the Ecowitt GW1001 for $150 AUD from Amazon Australia which looks like a good value package. I can't however find any reviews on this...

I'm guessing it contains the GW1000 and the same station as is used in other Ecowitt models like the HP2551 and WH2910, can anyone confirm this?

Do I need additional hardware to push this data through to my SQL database? I have read a bit about Meteobridge's but not sure if one would be needed for my use case. It also looks like some weather station models have 'advanced options' to push data directly in a mysql database - would the GW1001 happen to be one of these models? (No information I have seen suggests it is, but can't hurt to confirm).

Thanks for any advice given, cheers, Nathan

Offline droiddk

  • Forecaster
  • *****
  • Posts: 334
Re: Advice needed please - GW1001
« Reply #1 on: June 09, 2019, 11:27:29 AM »


Do I need additional hardware to push this data through to my SQL database?

Thanks for any advice given, cheers, Nathan

Hi nathz

The newly added option in WS View (tool for viewing data) allows sending data to a "customized" server. Protocol is Wunderground (using HTTP Post) or Ecowitt (using HTTP Get), and a simple PHP script on your Synology can grab the data and insert into MySQL on same Synology. Refresh rate is 16 seconds  and the PHP script can also generate a JSON-file which can be used together with AJAX on a homepage to generate "near realtime updates".

WS View can not put directly into MySQL.

Please note, I have not done it myself, don't have a GW1000 but there is an image of that device in WS View so I guess it can do the same as my console.

So based on what you are writing, no need for Meteobridge  [tup]

Regards
« Last Edit: June 09, 2019, 11:29:40 AM by droiddk »

Offline galfert

  • Global Moderator
  • Forecaster
  • *****
  • Posts: 6822
Re: Advice needed please - GW1001
« Reply #2 on: June 09, 2019, 01:46:56 PM »
The GW1000 with "Customized" server option upload will not upload all sensors if you use the WU option. If you want all sensors then you'll need to use the Ecowitt upload option.

But as you've mentioned if you have a Meteobridge then the heavy lifting and work to accomplish the connection to SQL has already been done. The Meteobridge is a very elegant solution that will send all sensors to SQL. This is the method I'm using and the Meteobridge is very flexible in letting you customize what you send to SQL. This allows easily customize what period you want for wind gust calculation and the same goes for other variables. Like when saving PM2.5 data do you want current or do you want to save average and for what period is that average. So using the Meteobridge saves a lot of work because it does more than just upload raw sensor data.

The Meteobridge also has the ability to send to just about any online weather service so it is a worthy investment. There are many more features like custom alerts. I'm very pleased with it. Why reinvent the wheel?
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: Advice needed please - GW1001
« Reply #3 on: June 09, 2019, 02:13:12 PM »
A "reasonably competent programmer" can do more with the raw data, a server running PHP and MySQL than with a single Meteobridge. It takes some time, not out of the box as with Meteobridge, but there is no thing a programmer cant do using the raw data when the data hits a server. This option is not just raw data.

Also, RPI was mentioned, if you (nathz) have no problem running Linux and have a spare RPI around then look at WeeWx. nathz, the Meteobridge is easy, but based on what you are telling, you don't need it.

Reinvent the wheel? Some people just like doing it themself and maybe already have some useful code, then Meteobridge will be the new wheel.
« Last Edit: June 09, 2019, 02:28:19 PM by droiddk »

Offline nathz

  • Member
  • *
  • Posts: 2
Re: Advice needed please - GW1001
« Reply #4 on: June 11, 2019, 01:48:27 AM »
Great advice, thanks guys!!

The last thing I need to know is whether the weather station that is packaged with the GW1000 is the same as in the other Ecowitt models. Can anyone confirm this by chance?

If it is the same I'm going to pull the trigger on the GW1001. I'll update the group once I've coded something suitable. PHP to MariaDB on the NAS I think will be the preferred option. If this is proving too difficult I'll look at the meteobridge again, but fingers crossed I don't need the additional hardware. R.e. reinventing the wheel, I'm ok with this - it a just a small project to keep me busy when I have some free time.... and it's much more simple than my other project I am yet to commence (automated aquarium water parameter checking with 3D printed parts and servos!)

Thanks again, Nathan

Offline Mandrake

  • Forecaster
  • *****
  • Posts: 1102
Re: Advice needed please - GW1001
« Reply #5 on: June 11, 2019, 03:12:02 AM »
OK, perplexed me as what configuration you meant but a quick look at the Auz Amazon site confirms my suspicion.
https://www.amazon.com.au/ECOWITT-Weather-Station-Powered-Outdoor/dp/B07R1Y72G4/ref=sr_1_11?keywords=ecowitt&qid=1560236103&s=gateway&sr=8-11

The question you are asking is whether the sensor array is the same as that used for the other weather stations is yes!
This is the same sensor array used for the 'normal' display consoles etc so no panic!
G1ZFO

Ecowitt HP2551A + WH65 Tri-Wing (Wunderground: IGUILDFO67)
Ecowitt GW1000 (Wunderground: IGUILDFO68)
Ecowitt GW1000 (Mk2) test environment driving CumulusMX on a RPi 3b
Ecowitt GW2000 (Test)
Ecowitt WS90 Wittboy - Test
Ecowitt WH51 (x6) Soil Moisture Sensor
Ecowitt WH41 PM2.5 AQM Sensor
Ecowitt WH31 (x8) Thermo/Hygro Sensor
Ecowitt WS80 Ultrasonic Anemometer (pre-prod test)
Ecowitt WH57 Lightning Sensor -test
Ecowitt WH32-EP (SHT35) + Davis 7714 Screen
Ecowitt WH45 CO2/PM2.5/PM10 -Test
Ecowitt WN34 Soil Temp Sensor -Test
Ecowitt WN34 Water Temp Sensor -Test
Ecowitt WN35 Leaf Moisture

Offline droiddk

  • Forecaster
  • *****
  • Posts: 334
Re: Advice needed please - GW1001
« Reply #6 on: June 11, 2019, 07:05:31 AM »

If it is the same I'm going to pull the trigger on the GW1001. I'll update the group once I've coded something suitable. PHP to MariaDB on the NAS I think will be the preferred option. If this is proving too difficult.


I have this exact option running so come and ask if you need help.

A few tips:
- Check firewall-status. My firewall on my web-server was blocking all request from my weather station console. Had to allow access.
- Ecowitt protocol uses HTTP Post and will send a request to http://www.example.net/data/report/ so script that shall catch data should be named index.php
- Wunderground protocol uses HTTP Get and will send a request to http://www.example.net/weatherstation/updateweatherstation.php

When using PHP:
All keys and values in the query string when using HTTP Get can be cached using this: $queryString = $_SERVER['QUERY_STRING'] and the parse_str function can make the string to an array: parse_str($queryString, $output) Convert the array to JSON-format using json_encode: $jsonformat = json_encode($output) save this to a file and you will see what was received.

Since Ecowitt protocol uses HTTP Post the data can be converted directly to JSON, again using json_encode: $jsonFormat = json_encode($_POST);

Regards!
« Last Edit: June 11, 2019, 11:54:38 AM by droiddk »

Offline WelshDragon

  • Member
  • *
  • Posts: 43
    • Tenby weather website
Re: Advice needed please - GW1001
« Reply #7 on: June 13, 2019, 02:40:25 AM »
@DROIDDK

What format does the Server/Host name require? I'm attempting to send the data to a NAS with the following line :

192.168.1.18/Public/EcowittDataExport

But nothing ever gets exported. Am I doing something wrong?

Offline droiddk

  • Forecaster
  • *****
  • Posts: 334
Re: Advice needed please - GW1001
« Reply #8 on: June 13, 2019, 11:12:06 AM »
@DROIDDK

What format does the Server/Host name require? I'm attempting to send the data to a NAS with the following line :

192.168.1.18/Public/EcowittDataExport

But nothing ever gets exported. Am I doing something wrong?

Do you use Ecowitt or Wunderground protocol? And show your code in index.php or updateweatherstation.php

Regards

Offline galfert

  • Global Moderator
  • Forecaster
  • *****
  • Posts: 6822
Re: Advice needed please - GW1001
« Reply #9 on: June 13, 2019, 11:16:40 AM »
Seems to me like there is some miscommunication/misunderstanding. I think WelshDragon is trying to just send the data to flat file/directory on his NAS. No webserver running. That is my guess, but I could be wrong. If so that is not how you use the Customized upload.
« Last Edit: June 13, 2019, 11:19:13 AM 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 droiddk

  • Forecaster
  • *****
  • Posts: 334
Re: Advice needed please - GW1001
« Reply #10 on: June 13, 2019, 11:18:30 AM »
Seems to me like there is some miscommunication/misunderstanding. I think WelshDragon is trying to just send the data to flat file on his NAS. No webserver running. That is my guess, but I could be wrong. If so that is not how you use the Customized upload.

I agree and I was just editing my post with this:
Customized option is very different from other export-options. Its not like FTP where a file will be uploaded. Instead a webpage (often a .PHP script) on or server is contacted and information is handled over that way. Now you get it here :)

Regards

Offline WelshDragon

  • Member
  • *
  • Posts: 43
    • Tenby weather website
Re: Advice needed please - GW1001
« Reply #11 on: June 13, 2019, 11:43:39 AM »
Oh right OK - thanks for the clarification. That's exactly what I'm aiming to do. So I need a web server running, which I have so that's a beginning. I guess I now need to read up on how to setup the script.

Anyone got any pointers or can recommend a site to explain how to do it?

Offline droiddk

  • Forecaster
  • *****
  • Posts: 334
Re: Advice needed please - GW1001
« Reply #12 on: June 13, 2019, 02:10:56 PM »

Anyone got any pointers or can recommend a site to explain how to do it?

What exactly are you trying to do? Send data to a template? Which one? Documentation about data for this template?

Regards

Offline WelshDragon

  • Member
  • *
  • Posts: 43
    • Tenby weather website
Re: Advice needed please - GW1001
« Reply #13 on: June 13, 2019, 02:20:46 PM »
I'd like to capture the data and use it on my own personal website with a template. Saratoge is one ive used in the past. I now have a local webserver successfully running.

I have a folder in the root called EcowittData and within that, I have an index.php file as suggested with the following code:

Code: [Select]
$data = file_get_contents('php://input');
var_dump($data);

In WS View, in the customized section, I have in the Server IP / Hostname field:

Quote
192.168.1.100/EcowittData

The interval is set to 16 secs but the file doesn't seem to do anything.

Am I totally off point?

Offline droiddk

  • Forecaster
  • *****
  • Posts: 334
Re: Advice needed please - GW1001
« Reply #14 on: June 13, 2019, 02:26:42 PM »
Am I totally off point?

Ummm yes   :grin:

The question before we move on, is to find out, how does Saratoga gets the data? I took a quick look at https://saratoga-weather.org/template/ but it was a bit overwhelming :o)
What do you use today when feeding Saratoga with data?

The index.php is more complicated than that, but set than on pause for a moment.

Regards

« Last Edit: June 13, 2019, 02:38:13 PM by droiddk »

Offline WelshDragon

  • Member
  • *
  • Posts: 43
    • Tenby weather website
Re: Advice needed please - GW1001
« Reply #15 on: June 13, 2019, 03:08:44 PM »
 :lol: :lol: Yeah I kind of thought it would be as easy as the code I had - that was from an example I saw when I started reading up on JSON earlier.

I'm not that bothered about getting it into Saratoga for now - just a formatted (xml, csv) type of file would be fine. Getting it into SQL/MariaDB would be great!

Offline droiddk

  • Forecaster
  • *****
  • Posts: 334
Re: Advice needed please - GW1001
« Reply #16 on: June 13, 2019, 03:17:18 PM »
:lol: :lol: Yeah I kind of thought it would be as easy as the code I had - that was from an example I saw when I started reading up on JSON earlier.

I'm not that bothered about getting it into Saratoga for now - just a formatted (xml, csv) type of file would be fine. Getting it into SQL/MariaDB would be great!

Point for trying!

Ok. Lets see where we can start.

On your server, 192.168.1.100, in home root, make a folder called "weatherstation" and place "updateweatherstation.php" in that folder, so this is a valid path:

192.168.1.100/weatherstation/updateweatherstation.php

updateweatherstation.php shall contain this:

Code: [Select]
<?php

$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);

http_response_code(200);

?>
Please note, above is just for testing, script should be protected against attacks but you should be fine since its on your own server not exposed to the world, yes?

In WS View, select "Wunderground" as protocol and type in 192.168.1.100 as hostname, port 80. Click save and finish.

Above should generate a JSON-file in 192.168.1.100/weatherstation with latest data.

Regards
« Last Edit: June 13, 2019, 03:19:07 PM by droiddk »

Offline WelshDragon

  • Member
  • *
  • Posts: 43
    • Tenby weather website
Re: Advice needed please - GW1001
« Reply #17 on: June 13, 2019, 03:40:45 PM »
Many thanks for the help so far - it is much appreciated!

I have done all of the above. However, nothing is being created. If I goto:

Quote
192.168.1.100/weatherstation/updateweatherstation.php

 I get the following msg:

Quote
Unable to open file!

Am I missing something?

Offline droiddk

  • Forecaster
  • *****
  • Posts: 334
Re: Advice needed please - GW1001
« Reply #18 on: June 13, 2019, 03:44:03 PM »
Many thanks for the help so far - it is much appreciated!

I have done all of the above. However, nothing is being created. If I goto:

Quote
192.168.1.100/weatherstation/updateweatherstation.php

 I get the following msg:

Quote
Unable to open file!

Am I missing something?

Must be some access rights :/ Which server are you running?

Regards
« Last Edit: June 13, 2019, 04:03:58 PM by droiddk »

Offline WelshDragon

  • Member
  • *
  • Posts: 43
    • Tenby weather website
Re: Advice needed please - GW1001
« Reply #19 on: June 13, 2019, 04:46:33 PM »
Yeah I'd already checked the rights and tweaked them so now when I run that manually in the browser, I get a blank page and a file gets created. However, it doesn't seem to be getting called by WS View Or the console.

The server is IIS 7 and is up and running correctly.

Anything else I can check?

Offline galfert

  • Global Moderator
  • Forecaster
  • *****
  • Posts: 6822
Re: Advice needed please - GW1001
« Reply #20 on: June 13, 2019, 04:52:26 PM »
Check network settings. You want port 80 open on local system firewall.
« Last Edit: June 13, 2019, 04:54:57 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 droiddk

  • Forecaster
  • *****
  • Posts: 334
Re: Advice needed please - GW1001
« Reply #21 on: June 13, 2019, 04:57:18 PM »
Yeah I'd already checked the rights and tweaked them so now when I run that manually in the browser, I get a blank page and a file gets created. However, it doesn't seem to be getting called by WS View Or the console.

The server is IIS 7 and is up and running correctly.

Anything else I can check?

Ok, thats good. Script is working.

Ummm
Weather Station console and server must be on same network, I guess you already got that right. Check if others pc's on your local network can reach 192.168.1.100/weatherstation/updateweatherstation.php.  Make sure Hostname in WS View is only ip, 192.168.1.100, WS View will add /weatherstation/ and look for updateweatherstation.php in that folder. 

Try use server hostname as hostname in WS View.

Regards
« Last Edit: June 14, 2019, 10:44:24 AM by droiddk »

Offline WelshDragon

  • Member
  • *
  • Posts: 43
    • Tenby weather website
Re: Advice needed please - GW1001
« Reply #22 on: June 13, 2019, 05:29:07 PM »
Tried all the above but still not happening. Port 80 is definitely open and I've ene disabled the firewall on the server machine for now.

I've tried 3 laptopes and an Android phone and all can get to 192.168.1.100/weatherstation/updateweatherstation.php just fine and the file in the weatherstation folder in the root of the web server also updates.

I've tried with both the console and my gw1000 through WS view but neither seem to work.

Offline galfert

  • Global Moderator
  • Forecaster
  • *****
  • Posts: 6822
Re: Advice needed please - GW1001
« Reply #23 on: June 13, 2019, 05:36:11 PM »
Did you install php on IIS?.. CGI
« Last Edit: June 13, 2019, 05:40:08 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 WelshDragon

  • Member
  • *
  • Posts: 43
    • Tenby weather website
Re: Advice needed please - GW1001
« Reply #24 on: June 13, 2019, 05:48:14 PM »
Yes and created the test php file with the following code to test the instalation:

Code: [Select]
<?php
    phpinfo
();
?>

Which when runs, comes up with the config page showing it's all installed fine. I have also created other test files such as:

Code: [Select]
<html>
 <head>
  <title>PHP Test</title>
 </head>
 <body>
 <?php echo '<p>Hello World</p>'?>
 </body>
</html>

Which also run fine.

The version of php I installed is 7.0.30 - does the version matter?

 

anything