Welcome to the Cumulus Support forum.

Latest Cumulus MX V3 release 3.28.6 (build 3283) - 21 March 2024

Cumulus MX V4 beta test release 4.0.0 (build 4018) - 28 March 2024

Legacy Cumulus 1 release v1.9.4 (build 1099) - 28 November 2014 (a patch is available for 1.9.4 build 1099 that extends the date range of drop-down menus to 2030)

Download the Software (Cumulus MX / Cumulus 1 and other related items) from the Wiki

How to get web page working after v1 -> MX upgrade?

From build 3044 the development baton passed to Mark Crossley. Mark has been responsible for all the Builds since. He has made the code available on GitHub. It is Mark's hope that others will join in this development, but at the very least he welcomes your ideas for future developments (see Cumulus MX Development suggestions).

Moderator: mcrossley

User avatar
DanielF
Posts: 184
Joined: Tue 30 Dec 2008 12:53 pm
Weather Station: Davis Vantage Vue, serial logger
Operating System: Win10Pro64
Location: Gerroa, NSW, Australia

Re: How to get web page working after v1 -> MX upgrade?

Post by DanielF »

sfws wrote: Mon 19 Jul 2021 2:02 pm I do not actually use the new default web pages, but I checked /opt/CumulusMX/webfiles/js/noaarpts.js.
The relevant file name selection code is

Code: Select all

url: rptPath + 'NOAAMO' + pad2(m) + pad2(y - 2000) + '.txt',
i.e. it accepts 1 or 2 digits for month and pads that to 2 digits with any necessary leading zero, it only accepts 4 digits for year, subtracts "2000" and pads out what remains to 2 digits, and does not allow anyone to change the bits of the file name that are in quotes. This is discussed by Mark here.
@sfws,

In my noaarpts.js (both local and server) I have these two lines:

Code: Select all

68                        url: rptPath + 'NOAAMO' + pad2(m) + pad2(y - 2000) + '.txt',
107    reqRpt = rptPath + 'NOAAMO' + month + pad2(yr - 2000) + '.txt';
I don't understand Java, so I don't know what these two lines are doing. I'm assuming the 'month' variable is a forced 2-digit version of 'm', which would make the two paths equivalent.

Since my NOAA files are now being created with a name format like NOAAMO2021-07.txt, if I just changed the above two paths to something like this, would that then allow monthly reports to be displayed (once I have some on the server!):

Code: Select all

rptPath + 'NOAAMO' + y + '-' + pad2(m) + '.txt'
:?:
Daniel
Gerroa ('paradise'), Australia
Gerroa weather
User avatar
HansR
Posts: 5871
Joined: Sat 20 Oct 2012 6:53 am
Weather Station: GW1100 (WS80/WH40)
Operating System: Raspberry OS/Bullseye
Location: Wagenborgen (NL)
Contact:

Re: How to get web page working after v1 -> MX upgrade?

Post by HansR »

Really, seriously... This is hells road iso stairway to heaven. Displaying the NOAA reports should NOT be a subject of javascript coding but just a matter of naming the correct directory and match the filenames. Stick to the CMX defaults would be the easy way out. Especially when you don't understand java (actually: javascript which is different).
Hans

https://meteo-wagenborgen.nl
CMX build 4017+ ● RPi 3B+ ● Raspbian Linux 6.1.21-v7+ armv7l ● dotnet 8.0.3
User avatar
beteljuice
Posts: 3292
Joined: Tue 09 Dec 2008 1:37 pm
Weather Station: None !
Operating System: W10 - Threadripper 16core, etc
Location: Dudley, West Midlands, UK

Re: How to get web page working after v1 -> MX upgrade?

Post by beteljuice »

@Daniel

That should do it - don't forget to keep a duplicate .js back-up as you are no longer using the distro.
Image
......................Imagine, what you will KNOW tomorrow !
User avatar
DanielF
Posts: 184
Joined: Tue 30 Dec 2008 12:53 pm
Weather Station: Davis Vantage Vue, serial logger
Operating System: Win10Pro64
Location: Gerroa, NSW, Australia

Re: How to get web page working after v1 -> MX upgrade?

Post by DanielF »

HansR wrote: Tue 20 Jul 2021 3:32 am Stick to the CMX defaults would be the easy way out.
Agreed, if the CMX defaults were sensible and worked (i.e. worked with the different file-naming allowed in CMX setup)! :roll:
Daniel
Gerroa ('paradise'), Australia
Gerroa weather
User avatar
DanielF
Posts: 184
Joined: Tue 30 Dec 2008 12:53 pm
Weather Station: Davis Vantage Vue, serial logger
Operating System: Win10Pro64
Location: Gerroa, NSW, Australia

Re: How to get web page working after v1 -> MX upgrade?

Post by DanielF »

beteljuice wrote: Tue 20 Jul 2021 3:55 am That should do it - don't forget to keep a duplicate .js back-up as you are no longer using the distro.
Thanks @beteljuice. I've made a backup, edited the file and FTP'd it to my server. We'll see how it goes after the month roll-over! :|
Daniel
Gerroa ('paradise'), Australia
Gerroa weather
User avatar
beteljuice
Posts: 3292
Joined: Tue 09 Dec 2008 1:37 pm
Weather Station: None !
Operating System: W10 - Threadripper 16core, etc
Location: Dudley, West Midlands, UK

Re: How to get web page working after v1 -> MX upgrade?

Post by beteljuice »

We'll see how it goes after the month roll-over
The beteljuice did say "(this) Month and (this) year reports are generated each day. - They are the current data upto end yesterday"
Image
......................Imagine, what you will KNOW tomorrow !
User avatar
HansR
Posts: 5871
Joined: Sat 20 Oct 2012 6:53 am
Weather Station: GW1100 (WS80/WH40)
Operating System: Raspberry OS/Bullseye
Location: Wagenborgen (NL)
Contact:

Re: How to get web page working after v1 -> MX upgrade?

Post by HansR »

DanielF wrote: Tue 20 Jul 2021 6:47 am
HansR wrote: Tue 20 Jul 2021 3:32 am Stick to the CMX defaults would be the easy way out.
Agreed, if the CMX defaults were sensible and worked (i.e. worked with the different file-naming allowed in CMX setup)! :roll:
They do work - really they do - without coding, never seen it fail. But yes it requires some understanding, NOT coding.
And I am sorry to see the enthusiastic support take that route against some explanation.
If you use the defaults, believe me, you can make it work. Do that first and if you really MUST do it differently, than take other routes.
(and yes, I think they - the defaults - should not be modifiable, I think there is no need for it... but that is another story)

CODING IS NOT REQUIRED TO GET THE NOAA REPORTS VISIBLE ON YOUR WEBSITE!!
Hans

https://meteo-wagenborgen.nl
CMX build 4017+ ● RPi 3B+ ● Raspbian Linux 6.1.21-v7+ armv7l ● dotnet 8.0.3
User avatar
DanielF
Posts: 184
Joined: Tue 30 Dec 2008 12:53 pm
Weather Station: Davis Vantage Vue, serial logger
Operating System: Win10Pro64
Location: Gerroa, NSW, Australia

Re: How to get web page working after v1 -> MX upgrade?

Post by DanielF »

HansR wrote: Tue 20 Jul 2021 7:56 am They do work - really they do - without coding, never seen it fail. But yes it requires some understanding, NOT coding.
And I am sorry to see the enthusiastic support take that route against some explanation.
If you use the defaults, believe me, you can make it work. Do that first and if you really MUST do it differently, than take other routes.
(and yes, I think they - the defaults - should not be modifiable, I think there is no need for it... but that is another story)

CODING IS NOT REQUIRED TO GET THE NOAA REPORTS VISIBLE ON YOUR WEBSITE!!
Hans,

OK, I give up! :bash:

@beteljuice, being impatient, I uploaded my few local reports, renamed as per my 'preferred' scheme, and with my modified .js code also uploaded. But, sadly, the reports failed to display (the usual error about none being available, for any date). And thanks for the info about daily uploads. I learn something each day! :D

So I renamed my local reports back to the (bad) default (can't sort monthlies by name=chronological), reinstated the original .js file (with just the relative Reports/ path added) on the server and uploaded the reports to the server. They now display as expected. Hans wins! :x
Daniel
Gerroa ('paradise'), Australia
Gerroa weather
User avatar
HansR
Posts: 5871
Joined: Sat 20 Oct 2012 6:53 am
Weather Station: GW1100 (WS80/WH40)
Operating System: Raspberry OS/Bullseye
Location: Wagenborgen (NL)
Contact:

Re: How to get web page working after v1 -> MX upgrade?

Post by HansR »

DanielF wrote: Tue 20 Jul 2021 9:03 am So I renamed my local reports back to the (bad) default (can't sort monthlies by name=chronological), reinstated the original .js file (with just the relative Reports/ path added) on the server and uploaded the reports to the server. They now display as expected. Hans wins! :x
Thank you :D
Not so much for winning as for reason and simplicity to win ;)

And maybe @mcrossley could take this as a hint to make the NOAA directory/filenames fixed (as I suggested myself some time ago).
Hans

https://meteo-wagenborgen.nl
CMX build 4017+ ● RPi 3B+ ● Raspbian Linux 6.1.21-v7+ armv7l ● dotnet 8.0.3
User avatar
DanielF
Posts: 184
Joined: Tue 30 Dec 2008 12:53 pm
Weather Station: Davis Vantage Vue, serial logger
Operating System: Win10Pro64
Location: Gerroa, NSW, Australia

Re: How to get web page working after v1 -> MX upgrade?

Post by DanielF »

HansR wrote: Tue 20 Jul 2021 10:01 am And maybe @mcrossley could take this as a hint to make the NOAA directory/filenames fixed (as I suggested myself some time ago).
Or better still, make the Java code handle the various available filename options, so users can choose the intelligent name option and still have the reports display! ;)
Daniel
Gerroa ('paradise'), Australia
Gerroa weather
User avatar
HansR
Posts: 5871
Joined: Sat 20 Oct 2012 6:53 am
Weather Station: GW1100 (WS80/WH40)
Operating System: Raspberry OS/Bullseye
Location: Wagenborgen (NL)
Contact:

Re: How to get web page working after v1 -> MX upgrade?

Post by HansR »

DanielF wrote: Tue 20 Jul 2021 12:54 pm
HansR wrote: Tue 20 Jul 2021 10:01 am And maybe @mcrossley could take this as a hint to make the NOAA directory/filenames fixed (as I suggested myself some time ago).
Or better still, make the Java code handle the various available filename options, so users can choose the intelligent name option and still have the reports display! ;)
Well, that definitely is for Mark.
Though for the display on the web I don't really see why the naming is important but then that might be me ;)
Hans

https://meteo-wagenborgen.nl
CMX build 4017+ ● RPi 3B+ ● Raspbian Linux 6.1.21-v7+ armv7l ● dotnet 8.0.3
User avatar
DanielF
Posts: 184
Joined: Tue 30 Dec 2008 12:53 pm
Weather Station: Davis Vantage Vue, serial logger
Operating System: Win10Pro64
Location: Gerroa, NSW, Australia

Re: How to get web page working after v1 -> MX upgrade?

Post by DanielF »

HansR wrote: Tue 20 Jul 2021 1:18 pm Though for the display on the web I don't really see why the naming is important but then that might be me ;)
No, it's not at all important for web display. But important if a user wants to do something special with their data or report files on their PC. A typical example (from experience) is where a sensor/signal-conditioner in an AWS goes haywire (common if you live by the sea, due to salt corrosion!), and you end up with crazy data in various files (as Paul discovered in of my Jan-2017 data!).

If you have info about the files' contents/format (which we do for Cumulus), you can manually edit (or even automatically if you're a smart programmer) the data files to replace that crazy data with 'reasonable' values interpolated from before and after readings, or other methods. The first step is finding the affected files, and having them sorted into date order (in your file manager) helps a lot.

Another purpose is if someone requests a copy of a (say) NOAA report to send to their insurance company to back their claim for storm damage reimbursement. So they tell me the date of their 'incident' and I can just e-mail the relevant monthly text file. But first I need to find the applicable file, so again date sorting by name is useful. [You can't always rely on the file date shown in your file manager, since depending on how your file manager is set up, that might be the last modification date (e.g. when you made some manual corrections) rather than the creation date. I know you can change which date is displayed, but it's easier if you don't have to and can just use the sensible filenames.]
Daniel
Gerroa ('paradise'), Australia
Gerroa weather
User avatar
HansR
Posts: 5871
Joined: Sat 20 Oct 2012 6:53 am
Weather Station: GW1100 (WS80/WH40)
Operating System: Raspberry OS/Bullseye
Location: Wagenborgen (NL)
Contact:

Re: How to get web page working after v1 -> MX upgrade?

Post by HansR »

@DanielF:
I won't deny there is room for improvement in the file naming of both data and noaa files (or ini files for that matter). But having said that: if you sort the files alphabetically, data as well as noaa files are basically sorted on month. So you get NOAAMOmmyy which makes it pretty easy to find the files even they are not fully and correctly sorted, they are grouped by month. The yearly files are well sorted. It is also a matter of getting used to (which then could falsely become a reason not to change anything, but that's another story ;) ).

There probably are more important things to consider and I could imagine this being not too high on the list.
Hans

https://meteo-wagenborgen.nl
CMX build 4017+ ● RPi 3B+ ● Raspbian Linux 6.1.21-v7+ armv7l ● dotnet 8.0.3
User avatar
mcrossley
Posts: 12694
Joined: Thu 07 Jan 2010 9:44 pm
Weather Station: Davis VP2/WLL
Operating System: Bullseye Lite rPi
Location: Wilmslow, Cheshire, UK
Contact:

Re: How to get web page working after v1 -> MX upgrade?

Post by mcrossley »

HansR wrote: Tue 20 Jul 2021 10:01 am And maybe @mcrossley could take this as a hint to make the NOAA directory/filenames fixed (as I suggested myself some time ago).
v3.12 defaults to "/Reports" in both the FTP settings and the default web site NOAA script. The /webfiles folder also has an empty /Reports sub-folder so that should be created when users upload this folder.

As for the report names, I agree the default name is not how I would have done it. However some users have many years worth of data, changing it now means they would have to rename all their existing files. Same goes for other data files CMX uses.

The files are sorted by month/year, rather than year/month. Personally I don't think it is too hard to find the file you want! :roll:

The option exists to use a different report name format if you wish, but you are then on your own regarding the default web site. It's up to you to change that, it will not work "out of the box" as it is coded to use the default format. :|
User avatar
DanielF
Posts: 184
Joined: Tue 30 Dec 2008 12:53 pm
Weather Station: Davis Vantage Vue, serial logger
Operating System: Win10Pro64
Location: Gerroa, NSW, Australia

Re: How to get web page working after v1 -> MX upgrade?

Post by DanielF »

Mark,
mcrossley wrote: Tue 20 Jul 2021 4:13 pm ... However some users have many years worth of data, changing it now means they would have to rename all their existing files. Same goes for other data files CMX uses.
Renaming hundreds of data files in a directory is actually very simple, taking but a few minutes to create a batch file that does the job in seconds. :D
mcrossley wrote: Tue 20 Jul 2021 4:13 pmThe option exists to use a different report name format if you wish, but you are then on your own regarding the default web site. It's up to you to change that, it will not work "out of the box" as it is coded to use the default format. :|
Not being a JavaScript programmer, I can't be sure, but from a general programming perspective I imagine it shouldn't be too hard to write code that first checks the file formats and then uses the appropriate instruction lines to access them. Perhaps you could consider this at some future time, when there are no more pressing improvements to be done?

@beteljuice kindly showed me the error in my .js file edits, and got the NOAA reports displaying with 'sensible' filenames, but as I had already renamed my report files back to default, I have decided to bow to the experts and leave them that way for the time being, in the interest of simplifying future software update installations. But I live in hope that the default web files might one day be improved to handle all the name formats allowed by the current CMX software. ;)
Daniel
Gerroa ('paradise'), Australia
Gerroa weather
Post Reply