Author Topic: Server to receive Ecowitt Data  (Read 6617 times)

0 Members and 1 Guest are viewing this topic.

Offline Old Salt

  • Member
  • *
  • Posts: 10
Re: Server to receive Ecowitt Data
« Reply #25 on: September 26, 2020, 04:17:42 PM »
If all you want is to confirm the GW1000 is transmitting, and you have a php web server, try this on your server:

<?php
// =========================================================== \\
//                  Dump Post Data to a File                   \\
// =========================================================== \\   
if ($_SERVER["REQUEST_METHOD"] == "POST") {
   $myfile = fopen("e:\\newfile.txt", "a");      // *** Set filename ***
   foreach ($_POST as $key => $value) {
      $txt = "".htmlspecialchars($key)." = ".htmlspecialchars($value)."\r\n";
    fwrite($myfile, $txt);
   }
   fwrite($myfile, "\r\n");
   fclose($myfile);
}
?>


I'm using it to determine what the GW1000 sends.  I'm building an Ecowitt protocol simulator.  It's almost done, and beats waiting on the weather for development.

Offline Zimerhonzl

  • Member
  • *
  • Posts: 26
    • TexWx
Re: Server to receive Ecowitt Data
« Reply #26 on: September 28, 2020, 08:16:21 PM »
Thanks!  I PHP processor actually would simplify some things!

-Jonathan

Offline Old Salt

  • Member
  • *
  • Posts: 10
Re: Server to receive Ecowitt Data
« Reply #27 on: October 01, 2020, 07:31:05 AM »
Here's the Ecowitt Protocol Simulator.

The attachment contains the html, and php files, as well as a text copy of this post.  I would appreciate feedback as to the data sent by the wh41, wh43, wh55, and wh57 sensors.  an explanation, data limits, and the number of decimal places sent are needed.  I don't have these sensors, and only found a few hints as to their output on the 'net.  For example, I found the wh57 sends:
  • lightning: integer, 0 ~ 50, distance to storm front in Km (confirmed)
  • lightning_time: integer, 0 ~ 86400000, UTC time of day of the lightning strike (not confirmed)
  • lightning_num: integer, 0 ~ ??, lightning count (not confirmed; is this for the storm, hour, or some other period?)
  • wh57batt: integer, 1~5, battery level, 1=low battery (confirmed)

     Sample POST Output (from gwrx.php):

PASSKEY = 6DB5CB9D897958D3AE20C78D6B9D9E2C
stationtype = GW1000B_V1.6.3
dateutc = 2020-10-01 11:31:16
tempinf = 71.6
humidityin = 45
baromabsin = 29.790
baromrelin = 29.580
temp1f = 72.4
humidity1 = 63
batt1 = 0
pm25_ch1 = 32.0
pm25_avg_24h_ch1 = 29.0
pm25batt1 = 5
soilmoisture1 = 37
Siolbatt1 = 1.6
leak_ch1 = 1
leakbatt1 = 5
lightning = 7
lightning_time = 41476065
lightning_num = 1
wh57batt = 5
freq = 915M
model = GW1000_Pro

gwrx.php:
Dumps the post data to a file, with a blank line between data packets.  This requires a php enabled web server.  Be sure to set the name and full path to your destination file on line 6 ("e:\\newfile.txt", "a").  The "a" opens the file to have data added to it, or creates the file if it does not exist.

This is useful to check the output of the GW1000, or an simulator.

ecosim.html:
This is useful in the design of a Personal Weather Station or data logger for the Ecowitt protocol.  It is easily extensible for new sensors.  It works in Firefox, not in IE.  It may or may not work with other browsers.

The target is set to "gwrx.php".  This can be changed on line 16 (tgt_path).

Data for the Ecowitt GW1000 is always sent.
Selections are provided for the Firmware Revision, MAC Address, and fre4quency of the unit.
All min, max, and pulse values are limited to that of their respective sensors where known. They are checked upon leaving the field as follows:
  sensor min <=  display min <= display max
  display min <=  display max <= sensor max
  display min <=  pulse <= display max

The Pulse/Run/Stop button:
  Pulse - sends a single data packet
  Run - sends the number of packets specified by Update, starting with the pulse value.
      - The step for values is 10% of the displayed max - min.  This can be changed in line 13 (step_percent)
  Stop - Ends multi-packet "Run"

Update drop down selects whether packets are to be sent once, five, or ten times; or continuously.

Time Stamp Interval selects the change in time stamps for the packets.  This is not the time between sending the packets.  The time between sending packets can be changed on line 15 (send_interval).

Sensors are sent only if their checkboxes are checked.

In the outdoor sensor group, you can only check the items in a single line.  If an item in another line is selected the item(s) in the other lines will be de-selected.

Only one PM25 sensor can be selected for each address.  Selecting a wh41 address will disable the wh43 at that address, and vice versa.

When multiple sensors of the same type are selected they are offset by (sensor # - 1)((max-min) / max number of sensors).

Battery levels are set to a good level for the checked sensors initially.  During run, each battery has a 15% chance of failure per packet. This can be changed on line 14 (batt_fail).

EDIT: Change line 172 to data["soilbatt" + i] = new Nested_obj (1.6, -7778, 1.6, 1.1);  There was a misprint in the documentation I received.
« Last Edit: October 16, 2020, 11:49:00 AM by Old Salt »

Offline neavilag

  • Member
  • *
  • Posts: 9
    • ClimaYa.com
Re: Server to receive Ecowitt Data
« Reply #28 on: February 08, 2021, 01:46:30 PM »
[ You are not allowed to view attachments ]
Ignore red circled section. This an image I was using for something else back when I worked on the WH6006.

Hello All, I am trying to test receive my data to my own server, but after setting a simple endpoint to see what the station sends, I don't see any data coming.

does someone has implemented this on their side ? what to place on each section of the screen that galfert shows? My idea until now is just log the $_GET values received to see the data but does not seems to hit the server..

thanks for any guidance

Online olicat

  • Forecaster
  • *****
  • Posts: 1515
  • GWxx00, HPx5x1C, WN1900C, WN1980C & WS3800C
    • FOSHKplugin
Re: Server to receive Ecowitt Data
« Reply #29 on: February 08, 2021, 02:26:21 PM »
Hi!

Quote
just log the $_GET values received
GET is used in WU-protocol only. If you send via Ecowitt-protocoll the data will be sent via POST.

Oliver

Offline neavilag

  • Member
  • *
  • Posts: 9
    • ClimaYa.com
Re: Server to receive Ecowitt Data
« Reply #30 on: February 08, 2021, 03:15:21 PM »
Thanks, I am fine with WU protocol HTTP but I need to know what to put on the server section to check what is sent via http.

Someone has successfully uploaded this ?
 [ You are not allowed to view attachments ]

Online Rover1822

  • Forecaster
  • *****
  • Posts: 1989
    • Mini Wind and Solar Data project
Re: Server to receive Ecowitt Data
« Reply #31 on: February 08, 2021, 03:36:38 PM »
What do you expect?

What do you expect from from your upp.php, what does it read how does it read it?

Have to forgive me if upp.php is something I should know, as I don't. But then I don't work a lot in php





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 neavilag

  • Member
  • *
  • Posts: 9
    • ClimaYa.com
Re: Server to receive Ecowitt Data
« Reply #32 on: February 08, 2021, 05:05:39 PM »
Hi,

upp.php is the script where I need the data send, I am reading the $_GET parameters to insert data on my database, the thing is that I don't see that WX stations is posting to that script, so My question is if the configuration of the webserver field is ok, or what to expect.

thanks

Online Rover1822

  • Forecaster
  • *****
  • Posts: 1989
    • Mini Wind and Solar Data project
Re: Server to receive Ecowitt Data
« Reply #33 on: February 08, 2021, 05:10:16 PM »
Without knowing what your webserver is, almost all, Apache etc.. have an access log, and a return value for a valid , or not valid request.
Can you see your requests come in via the logs on your web server?
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 neavilag

  • Member
  • *
  • Posts: 9
    • ClimaYa.com
Re: Server to receive Ecowitt Data
« Reply #34 on: February 08, 2021, 05:22:55 PM »
Yes, right now is what I am doing just logging the get request so anything that is send is being logged see the following:

http://axs.on.gt/upp.php?var1=value1&var2=value2&var3=value3&id=12345&pass=567879

you can check this file and will see what is sent.  So webserver is ok is just a matter of seems the wx stations does not have the right config to send the data to....

http://axs.on.gt/test.log

++++++++++======2021-02-08 16:21:17-----------
var1 => value1
var2 => value2
var3 => value3
id => 12345
pass => 567879

thanks for any help.

Offline neavilag

  • Member
  • *
  • Posts: 9
    • ClimaYa.com
Re: Server to receive Ecowitt Data
« Reply #35 on: February 08, 2021, 05:45:45 PM »
SUCCESS UPDATE:

As I was not able to see proper instructions for this, I tested using the RTupdate urls of WU, and replicate the environment:

So far what is needed is just to post the server url (without http or whatever)
and use same paths  / php names that WU uses.

So in my server I created the upload script to be able to be accessed like this
http://<your website url>/weatherstation/updateweatherstation.php

and station post to that address




++++++++++======2021-02-08 16:36:08-----------
ID => cyid
PASSWORD => 123456
indoortempf => -9999
indoorhumidity => -9999
tempf => -9999
humidity => -9999
dewptf => -9999
winddir => -9999
windspeedmph => -9999
windgustmph => -9999
rainin => 0
dailyrainin => 0
weeklyrainin => 0
monthlyrainin => 0
yearlyrainin => 0
solarradiation => -9999
UV => -9999
baromin => 24.932
absbaro => 25.112
battery => 98
wh65batt => 1
dateutc => 2021-02-08 22:36:07
softwaretype => 20467 V1.1.17
action => updateraw
realtime => 1
rtfreq => 5

Online Rover1822

  • Forecaster
  • *****
  • Posts: 1989
    • Mini Wind and Solar Data project
Re: Server to receive Ecowitt Data
« Reply #36 on: February 08, 2021, 05:48:48 PM »
I'm very glad you worked it out
:)

And now , your fun begins

(I do the same on my on own http server)

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 neavilag

  • Member
  • *
  • Posts: 9
    • ClimaYa.com
Re: Server to receive Ecowitt Data
« Reply #37 on: February 08, 2021, 05:51:26 PM »
Yes, thanks.

Just to know more, does Ecowitt site gives an API to can post to ecowitt and then take my data to my server ?

I see ecowitt.net site is closed to general public ?

regards

Online olicat

  • Forecaster
  • *****
  • Posts: 1515
  • GWxx00, HPx5x1C, WN1900C, WN1980C & WS3800C
    • FOSHKplugin
Re: Server to receive Ecowitt Data
« Reply #38 on: February 08, 2021, 06:10:28 PM »
Hi!

Quote
does Ecowitt site gives an API to can post to ecowitt and then take my data to my server ?
Not yet. But this is in progress.
:-)

Oliver

 

anything