Author Topic: Ecowitt protocol  (Read 258 times)

0 Members and 1 Guest are viewing this topic.

Offline Globemaster

  • Member
  • *
  • Posts: 11
Ecowitt protocol
« on: November 10, 2020, 04:26:51 AM »
Hi guys!
Sorry if I am posting in wrong sub forum or asking question that is somewhere answered already but when you are in hurry and reading 20 tabs of information in browser you just can't find everything.

Anyway, I have problems with uploading data from my Froggit (Ecowitt) station to my own web server via custom upload method. I guess that problem is something minor and I will deal with it later as it is not important to me. Right now I want to finish first display and later I will fix connection.... so at this moment I need to see how exactly looks Ecowitt protocol POST "raw" data that is sent to server. I guess it is JSON data but anyway I would need to see it to know what to expect.

For WU protocol it can be easily found (for example: https://docs.google.com/document/d/1OlAIqLb8kSfNV_Uz1_3je2CGqSnynV24qGHHrLWn7O8/edit# ) but I can't find Ecowitt protocol example anywhere.

Any help is welcome ;)

Online wvdkuil

  • Wim van der kuil
  • Forecaster
  • *****
  • Posts: 1727
    • My PWS at Leuven Belgium Europe
Re: Ecowitt protocol
« Reply #1 on: November 10, 2020, 04:44:27 AM »
Hi guys!
Sorry if I am posting in wrong sub forum or asking question that is somewhere answered already but when you are in hurry and reading 20 tabs of information in browser you just can't find everything.

Anyway, I have problems with uploading data from my Froggit (Ecowitt) station to my own web server via custom upload method. I guess that problem is something minor and I will deal with it later as it is not important to me. Right now I want to finish first display and later I will fix connection.... so at this moment I need to see how exactly looks Ecowitt protocol POST "raw" data that is sent to server. I guess it is JSON data but anyway I would need to see it to know what to expect.

For WU protocol it can be easily found (for example: https://docs.google.com/document/d/1OlAIqLb8kSfNV_Uz1_3je2CGqSnynV24qGHHrLWn7O8/edit# ) but I can't find Ecowitt protocol example anywhere.

Any help is welcome ;)

WU uses http-GET,  Ecowitt custom upload is http-POST, easy to process in a receiving script  f.i. in PHP it is a 1 level array.
A large number of sensor names+values. 
Code: [Select]
    [stationtype] => GW1000A_V1.6.3
    [dateutc] => 2020-11-10 09:42:37
    [tempinf] => 73.8
    [humidityin] => 49
    [baromrelin] => 30.200
    [baromabsin] => 30.200
    [tempf] => 51.3
    [humidity] => 99
    [winddir] => 159
    [windspeedmph] => 0.00
    [windgustmph] => 0.00
    [maxdailygust] => 0.00
    [solarradiation] => 54.19
    [uv] => 0
    [rainratein] => 0.000
    [eventrainin] => 0.000
    [hourlyrainin] => 0.000
    [dailyrainin] => 0.000
    [weeklyrainin] => 0.012
    [monthlyrainin] => 0.232
    [yearlyrainin] => 12.299
    [totalrainin] => 12.299
    [temp2f] => 74.84
    [humidity2] => 46
    [temp3f] => 49.82
    [humidity3] => 54
    [temp4f] => 47.48
    [humidity4] => 53
    [soilmoisture1] => 37
    [soilmoisture2] => 52
    [pm25_ch1] => 122.0
    [pm25_avg_24h_ch1] => 98.3
    [pm25_ch2] => 39.0
    [pm25_avg_24h_ch2] => 54.4
    [pm25_ch3] => 13.0
    [pm25_avg_24h_ch3] => 12.7
    [lightning_time] =>
    [lightning_num] => 0
    [lightning] =>
    [wh65batt] => 0
    [wh26batt] => 0
    [batt2] => 0
    [batt3] => 0
    [batt4] => 0
    [soilbatt1] => 1.5
    [soilbatt2] => 1.6
    [pm25batt1] => 4
    [pm25batt3] => 6
    [wh57batt] => 4
    [freq] => 868M
    [model] => GW1000_Pro

The "WU-protocol" is more static as almost all fieldnames are known.
For the Ecowitt version there are new sensors introduced every few months, the list of possible fields is therefor growing rapidly.
Also different consoles sent mostly the same fields, not exactly the same number though.

Wim
« Last Edit: November 10, 2020, 04:49:41 AM by wvdkuil »
Support for Leuven-Template & Scripts  at this forum via https://support.leuven-template.eu/
Script sponsors support.leuven-template.eu/userlistScripts.php
Template sponsors support.leuven-template.eu/userlist.php

Support for the PWS_Dashboard  pwsdashboard.com

Offline sky_watcher

  • Senior Member
  • **
  • Posts: 66
Re: Ecowitt protocol
« Reply #2 on: November 10, 2020, 04:52:52 AM »
Hi guys!
Sorry if I am posting in wrong sub forum or asking question that is somewhere answered already but when you are in hurry and reading 20 tabs of information in browser you just can't find everything.

Anyway, I have problems with uploading data from my Froggit (Ecowitt) station to my own web server via custom upload method. I guess that problem is something minor and I will deal with it later as it is not important to me. Right now I want to finish first display and later I will fix connection.... so at this moment I need to see how exactly looks Ecowitt protocol POST "raw" data that is sent to server. I guess it is JSON data but anyway I would need to see it to know what to expect.

For WU protocol it can be easily found (for example: https://docs.google.com/document/d/1OlAIqLb8kSfNV_Uz1_3je2CGqSnynV24qGHHrLWn7O8/edit# ) but I can't find Ecowitt protocol example anywhere.

Any help is welcome ;)
I don't have all of the sensors, so I can't comment on the likes of the Lightning Detector, Leak Detector, etc, but this may help.

http://brigadoon.power.on.net/projects/extended_pws/readhp2550_2.html

This will give you an example of how to capture the message from your station using php. The link at the bottom of the page will take you to some php code that I use to capture the observations to a database. Probably not what you want, but it may help you a bit. Be away there are two lots of software: index.php for my old HP1000, and the updateweatherstation.php for my HP2550.

“The more a man knows, the more willing he is to learn. The less a man knows, the more positive he is that he knows everything...” ― Robert G. Ingersoll

Offline Globemaster

  • Member
  • *
  • Posts: 11
Re: Ecowitt protocol
« Reply #3 on: November 10, 2020, 05:30:29 AM »
Tnx both for replys.

Regarding WU, I know that it is using GET method to send data and I already tested it with my API key.

Regarding Ecowitt, which is more interesting to me as it provide much more sensor data so I am trying to develop my app relying on it mainly.
So for link above, this is correct format of message sent via POST from PWS to server ?
Code: [Select]
{"PASSKEY":"XXXXXXXXXXXXXXXXXXXXXXXX","stationtype":"EasyWeatherV1.4.4","dateutc":"2020-02-23 23:14:11",
"tempinf":"74.8","humidityin":"43","baromrelin":"30.021","baromabsin":"29.983","tempf":"80.1","humidity":"31","winddir":"223",
"winddir_avg10m":"180","windspeedmph":"1.1","windspdmph_avg10m":"0.7","windgustmph":"2.2","maxdailygust":"10.3",
"rainratein":"0.000","eventrainin":"0.000","hourlyrainin":"0.000","dailyrainin":"0.000","weeklyrainin":"0.000","monthlyrainin":"0.571",
"yearlyrainin":"2.614","solarradiation":"580.36","uv":"5","temp1f":"77.0","humidity1":"40","temp2f":"79.3","humidity2":"41",
"temp3f":"74.3","humidity3":"45","soilmoisture5":"40","soilmoisture6":"51","pm25_ch1":"14.0","pm25_avg_24h_ch1":"14.0",
"wh65batt":"0","wh25batt":"0","batt1":"0","batt2":"0","batt3":"0","Siolbatt5":"1.7","Siolbatt6":"1.7","pm25batt1":"4","freq":"433M",
"model":"HP2550_Pro_V1.5.6"

Offline sky_watcher

  • Senior Member
  • **
  • Posts: 66
Re: Ecowitt protocol
« Reply #4 on: November 10, 2020, 06:04:04 AM »
Tnx both for replys.

Regarding WU, I know that it is using GET method to send data and I already tested it with my API key.

Regarding Ecowitt, which is more interesting to me as it provide much more sensor data so I am trying to develop my app relying on it mainly.
So for link above, this is correct format of message sent via POST from PWS to server ?
Code: [Select]
{"PASSKEY":"XXXXXXXXXXXXXXXXXXXXXXXX","stationtype":"EasyWeatherV1.4.4","dateutc":"2020-02-23 23:14:11",
"tempinf":"74.8","humidityin":"43","baromrelin":"30.021","baromabsin":"29.983","tempf":"80.1","humidity":"31","winddir":"223",
"winddir_avg10m":"180","windspeedmph":"1.1","windspdmph_avg10m":"0.7","windgustmph":"2.2","maxdailygust":"10.3",
"rainratein":"0.000","eventrainin":"0.000","hourlyrainin":"0.000","dailyrainin":"0.000","weeklyrainin":"0.000","monthlyrainin":"0.571",
"yearlyrainin":"2.614","solarradiation":"580.36","uv":"5","temp1f":"77.0","humidity1":"40","temp2f":"79.3","humidity2":"41",
"temp3f":"74.3","humidity3":"45","soilmoisture5":"40","soilmoisture6":"51","pm25_ch1":"14.0","pm25_avg_24h_ch1":"14.0",
"wh65batt":"0","wh25batt":"0","batt1":"0","batt2":"0","batt3":"0","Siolbatt5":"1.7","Siolbatt6":"1.7","pm25batt1":"4","freq":"433M",
"model":"HP2550_Pro_V1.5.6"
This is exactly what the php routine captured from my HP2550 using the "Same as Ecowitt" setting for the custom server - except that the trailing bracket "}" is missing.

Obviously, my PASSKEY is X-ed out for privacy reasons and things like the "stationtype', "freq" and "model" will vary with updates and sensor frequency. Note that if you have the soilmoisture sensor, the "Siolbatt" battery fields actually have that spelling.
« Last Edit: November 10, 2020, 06:06:31 AM by sky_watcher »
“The more a man knows, the more willing he is to learn. The less a man knows, the more positive he is that he knows everything...” ― Robert G. Ingersoll

 

anything