Ecowitt API history data

Hi
I 've been trying to get the Ecowitt API to get history data when WD is off. Whenever I try I get this error in the log:
151: HTTP protocol error. 400 Bad Request.
I’m able to successfully get responses using the API directly so all the keys and MAC are correct.
I’m using crongw100 for real time data but I also get the same error when trying to use API for real time data.
Have the latest version of WD 10.37S145 (22 Dec).
Thanks
R

That’s strange because I do this all the time both live data and archive, although I rarely use the archive stuff as my PC runs 24x7. Exactly which OS are you using? It does sound like your Windows does not support the secure access like TLS etc? My Windows 7 needed a few tweaks to get that working some time ago. I’m not talking about browser access here but native Windows. I was misled initially on my system because Firefox worked but nothing else did!

Stuart

I too have been getting that error, I have sent Ecowitt a message asking if anything changed or if its broken, but have not heard back. It was erratic for a while before it quit altogether,

Rrgards,

Jim

That was my first thought. I’m using Win10, I tried turning off the firewall but no difference. I’m thinking Ecowitt changed something without telling anyone. I can access the api throgh Firefox no problem.
R

I just tested mine and cannot find any errors but equally I can find no missed data downloaded. I checked my settings and they are correct and I was sure this worked before but as I said I run 24x7 so rarely need the archive. Which log file do you see this error message in?

Stuart

The error is in programerrorlog.txt. If I turn the api history off there is no error.
R

Well I see nothing relevant in that log but as I said there is no file I can find with the downloaded archive data either and there is a gap in the current lg.txt log for today.

Stuart

They updated the API on 25/12 so might have changed something.
R

I tried the Ecowitt API for realtime data. It seems to work but still throws the error. Maybe I’m looking in the wrong place for the history file? The real time temporary data was in the Webfiles dir.
R

From support at Ecowitt:

Hi, Jim

Nothing changed from our side.

Please follow the API document.

Best Regards

Ecowitt Support Team

发件人: [email protected] [email protected]
发送时间: 2022年12月28日 18:01
收件人: [email protected]
主题: API History data failing

For the last week or so my WeatherDisplay app fails to retrieve overnight history data via data via the api with an HTTP 400 error. Has something changed or is it broken?

151: HTTP protocol error. 400 Bad Request.
Above error or program log occured at :04 35 19 12/28/2022

Jim Altman
[email protected]
www.altlaw.com

Got rid of the error, but still no history. In control panel there is an item labelled data logger. It seems to turn on history for ambientweather and interacts in some way with the ecowitt api. Anyway it was turned on for some unknown reason. Turned it off and error went away. The next question is the history and how to get it. Any clues on where the file is stored?
R

Its in webfiles and is named ecowittapidatahistory.txt. I get no current data api error, but i usually get current data directly from my gw1000.

Regards,

Jim

I’ve been trying to test this after seeing these issues. So far I have not been able to get any history data for my Ecowitt GW1103 setup, last time it did work was end of September this year but as I said I run my PC 24x7 so rarely need it. Anyway I can recreate the error the OP got by turning on that Ambient thing in the datalogger control panel which goes away when I turn it off as expected. However I just tried to get the history data by leaving WD down for about 6 minutes but all I have is a 6 minute hole in my log files and no update to the ecowittapidatahistory.txt file.

Stuart

Yes I tried it after leaving it off for a few hours and got nothing. The API works ok if you test it manually. So the problem is to do with WD.
Probably pretty easy to write a Python script to do it.
R

New version posted this morning and its fixed (here at least). History works.

Regards,

Jim

Thanks I’ll try it. I had posted this on the WXForum as well to see if anyone there had the issue but so far no replies.

Stuart

I sent Brian a note and a copy of Ecowitt’s reply. I never heard back from him, but found the new version this morning.

Regards,

Jim

Well I just downloaded it and installed it but on restarting WD after about 5 minutes I see no data being downloaded from the archive, still have a 5 minute gat in the lg.txt file for December! I am running Windows 7 btw. I only installed the .exe not the .zip.

Stuart

I used the full install and waited about 15 minutes, then the data came in fine. He’s got an error in the current data for a local AQI sensor. The raw data is 25 but the %purpleairaqi% tag shows 78.1.

Regards,
Jim

I’ll give it another go tomorrow now.

Stuart