PWS Update ... then Max-Min problems

Hi all,

It’s been over 2 years since I last updated. Mostly because everything was working great! That’ll teach me. :slight_smile: Basically, Max-Min stopped updating. I have combed the my previous posts (where I had a similar problem) and everywhere else with no solution. Sorry.

One anomaly … when I updated, all the files migrated out of my [pwsWD] folder and into my main folder up one level (public_html). Not sure why.

Now, Max-Min in both Temp and Wind isn’t updating. I tried running the PWS_hist_recreate.php script, pointing it to the public_html folder. It successfully ran but didn’t solve the problem. The PWS_hist_update.php script looked interesting but I didn’t mess with it.

I looked in the wudata folder and found that the today.txt file hadn’t updated since Oct 4. A clue … but I’m not sure what to do with it. A cruise through the chartswudata folder didn’t help me.

So I need some help. Those of you that have helped me in the past (wim, bitsostring, etc.) know that I know enough about this to be REALLY dangerous. Please speak slowly and in language a non-coder can understand.

Station: Data is coming from WU. I confirmed the API key that is in the easy set-up.

Thank you!

Quick Update:

I tried running PWS_cron_stationcron.php and while it reported success, no luck with getting Max-Min to work correctly. Also, Annual Rainfall is off too. Maybe I didn’t notice before. :face_with_spiral_eyes:


You should run every 5 minutes.

As you moved your website from the . . /pwsWD/ folder to the root you have to to check your cron-setup that it is not using the old . ./pwsWD/ folder

This link prints your history file → historyURL
It shows the age of the history file and at the bottom the last daily / monthly / yearly roll-overs.

Major problem: The last time a correct cron job has run around midnight is October 3
That is the reason the high-lows are not updated as the values in the history file contain high-lows of the period Oct 3 → till now.
Every midnight between 23:55 and 00:30 the cron-job will “roll-over” todays high-lows into month/year and reset the values to the latest measurements.

    [last_roll_over] => 1696398904
    [last_roll_over2] => 2023-10-03T23:55:04-06:00
    [last_first_day] => 1696139711
    [last_first_day2] => 2023-09-30T23:55:11-06:00

Are you really running the cron-job every 5 minutes 24 hours every day ?

I attach a screenshot of this night around 01:00 am, it shows the high-lows from the history file

Regards, Wim


Thank you for your tireless support of noobs like me! You are the best!

As you can see, the Cron Job in my cPanel is set up for every 5 minutes. I fixed the command so it points to the root folder by removing /pwsWD/ from the command line.

I ran the scripts for history_recreate.php and stationcron.php again. Everything appears to be back to normal on the website for Temp and Wind. I assume I have to wait for it to rollover again to really know for sure. The Today.txt file in the root wudata folder has not updated since Oct 4. That may have something to do with the following.

Annual Rainfall is another problem. I think it has to do with the WU data going to the old /pwsWD/ folder, as you pointed out with the Cron Job. I did some detective work and found the following WU scripts with old /pwsWD/ references:

> <?php $scrpt_vrsn_dt  = 'PWS_wuhistory.php|01|2023-02-15|'; # beta release 2012_lts 
> #-----------------------------------------------
> #                 EXTRA SETTINGS for this script
> $wu_fldr= '../wuhistory/'; # next to pwsWD/
> #$wu_fldr= './wuhistory/'; # inside pwsWD/
> #
> <?php $scrpt_vrsn_dt  = 'PWS_wureports.php|01|2023-02-15|'; # beta release 2012_lts
> #-----------------------------------------------
> #                 EXTRA SETTINGS for this script
> $wu_fldr= '../wureports/'; # next to pwsWD/
> #$wu_fldr= './wureports/'; # inside pwsWD/
> $dateLongFormat = 'l d F Y';

I truly apologize for moving everything to the root folder … but I have no idea how I did it. All it did was follow the instructions, or so I thought. I know that support like this is a royal PITA for you. I appreciate you and this wonderful template!!!


How did you update?

Because of the folder/directory change, nothing in your setup seems to know where $this_server or $wu_server is. So, for example, you can’t get WU data because PWS_load_files.php is looking for …/pwsWD/PWS_DailyHistory.php. And at this time of night I can’t remember where you enter the server address. . . Sorry.

Once that’s sorted, we can turn to the problem that you have no graph data since 31 December 2022.


The remaining problems are caused by incorrect file pointers as there is still a pwsWD/ in some file links.

ToDo first
Go to easyweather-setup and click the green button save your settings.
Thats make sure all file pointers are now pointing to your current dashboard folder and not to your non-exisitng old pwsWD? folder.
Check screenshot

1 Like

I had forgotten how simple it was. . . :roll_eyes:


Many thanks to both of you!

Done. I checked the today.txt file in the wu data folder and it seems to be updating properly. Same for the chartswudata folder. YAY! Should I expected the Annual Rainfall to update properly as well after tonights rollover?

bitsostring: Of course, you are right about the graphs. Any guidance you can offer would be greatly appreciated!

Thanks again, gentlemen!

1 Like


When searching for a way to financially support your work, Wim, I came to the “How should the new version be distributed?” discussion too late. I would be happy to make a donation now … and pay a yearly support fee on an ongoing basis. It has been 2 years since my last support request. But you and the other members of this forum are always here for me. That is worth something!


If you run PWS_module_test.php and list the contents of the chartswudata files you will find that KCOCARBO8YMD.txt is OK, …YM.txt is empty, and …Y.txt ends at 31 December 2022.

I’m sorry, I don’t know. . .

All 2023 files need to be removed.

In …/chartswudata/
delete or rename KCOCARBO8Y.txt, . . .YM.txt, . . .Y.txtold, . . .YM.txt.old

In …/wudata/
delete 2023 folder and delete KCOCARBO8-metric-2023.arr

Then use the …/PWS_module_test.php script and press bottom button “Load files”

Fingers crossed :slightly_smiling_face:

Hi bitsostring!

I did what you suggested, except that I deleted KCOCARBO8-english-2023.arr instead of KCOCARBO8-metric-2023.arr. There was no “metric” file available and I figured that’s what you meant.

Unfortunately, no luck. In chartswudata, KCOCARBO8YMD.txt is still OK, …YM.txt is empty, and …Y.txt ends at 31 December 2022.

Just for fun, I went to my WU page. The daily and monthly rainfall totals seem to be correct. There doesn’t seem to be a way to see yearly totals. Is the yearly total math done inside the PWS program? Is there a way to fix or alter that calculation?

Thank you so much for helping!

Sorry, I’m fresh out of ideas. . . hope Wim can see a way forward.

(Apologies for the metric/english mistake :roll_eyes:)

No worries! Thanks for the help!


All math is done in PWS_Dashboard

First: What you see on those WU pages is the calculated 5 minute data (one line) done by WU as WU has to do that task also.

That WU-page data is very from what you can read-nack from WU yourself. Go to your debug dashboard: Module test PWS_Dashboard
Bottom row has three buttons:
Left one “Show contents” displays the data you read back from WU after your WeatherCat weather-program uploaded the data

                    [stationID] => KCOCARBO8
                    [obsTimeUtc] => 2023-10-11T07:15:04Z
                    [obsTimeLocal] => 2023-10-11 01:15:04
                    [neighborhood] => SoprisView
                    [softwareType] => WeatherCatV3.20B364
                    [country] => US
                    [solarRadiation] => 
                    [lon] => -107.221962
                    [realtimeFrequency] => 
                    [epoch] => 1697008504
                    [lat] => 39.396339
                    [uv] => 
                    [winddir] => 148
                    [humidity] => 83
                    [qcStatus] => 1
                    [imperial] => Array
                            [temp] => 41.7
                            [heatIndex] => 41.7
                            [dewpt] => 36.9
                            [windChill] => 41.7
                            [windSpeed] => 0
                            [windGust] => 0
                            [pressure] => 29.64
                            [precipRate] => 0
                            [precipTotal] => 0
                            [elev] => 6191

The second button shows which data-items we use
The third button shows all data we minimally need.
Still no high-lows a.s.o. as those will be calculated by the cron-job

Hi Robert,

Your original post mentioned “pws-update-then-max-min-problems”
That one is solved.

I have no idea if and what the remaining problem(s) are.
Far too much text about different subjects in the previous 13 posts.

If you have another problem left,

  1. please make a new post with a correct description.
  2. Add a screenshot if possible.
  3. Use short and clear sentences so that GoogleTranslate can convert it to my native language.

If you want to discuss other anomalies please use the “Chatter” part of this forum, thanks.

Topic marked as solved.