Welcome to the Cumulus Support forum.

Latest Cumulus MX V4 release 4.0.1 (build 4023) - 16 May 2024

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

Legacy Cumulus 1 release 1.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

Activate CMX web locally /

Other discussion about creating web sites for Cumulus that doesn't have a specific subforum

Moderator: daj

Post Reply
Zappastre
Posts: 10
Joined: Sat 25 Mar 2023 1:01 am
Weather Station: EasyWeatherPro Ultrasonic
Operating System: W10

Activate CMX web locally /

Post by Zappastre »

Hi,

After hour fighting i do not undertand how new web works.

In earlier versions if I open index.html in my PC with all the json files in the same folder, the web page worked.

Now i want to do the same, but theweb pages appears in blank.

i have enabled "Enable file copy of standard files" in web settins, files json are updatin every 5 minutes, but i don't undertand how are to be placed the files locally to see how looks like. I see in htm that varibales are in some kind of array called data-cmxdata, How is it solved?

Mi idea is undertand how it works and complete an ols page with some of the gauges or graph data.

Any help?
Zappastre
Posts: 10
Joined: Sat 25 Mar 2023 1:01 am
Weather Station: EasyWeatherPro Ultrasonic
Operating System: W10

Re: Activate CMX web locally /

Post by Zappastre »

Any help?

why webfiles locally do not solve data if json are well generated in folder web?
SamiS
Posts: 392
Joined: Sun 27 Feb 2011 5:13 pm
Weather Station: Ecowitt HP2551 & GW1100
Operating System: Raspberry Pi OS
Location: Kangasala, Finland

Re: Activate CMX web locally /

Post by SamiS »

I think it is not possible to open the new pages locally straight from filesystem, since the webpage can’t load the json data contained in separate file. Most likely it will need a webserver even for local access, just like the dashboard also is working. Not 100% sure though.
User avatar
HansR
Posts: 6027
Joined: Sat 20 Oct 2012 6:53 am
Weather Station: GW1100 (WS80/WH40)
Operating System: Raspberry OS/Bookworm
Location: Wagenborgen (NL)
Contact:

Re: Activate CMX web locally /

Post by HansR »

Could you check the the messages in the console (F12) in your browser when opening the website?
Give ctrl-F5 to restart and have a console refresh.

If anything relevant, please post a screen shot.
Hans

https://meteo-wagenborgen.nl
CMX build 4017+ ● RPi 3B+ ● Raspbian Linux 6.1.21-v7+ armv7l ● dotnet 8.0.3
Zappastre
Posts: 10
Joined: Sat 25 Mar 2023 1:01 am
Weather Station: EasyWeatherPro Ultrasonic
Operating System: W10

Re: Activate CMX web locally /

Post by Zappastre »

HansR wrote: Fri 31 Mar 2023 1:11 am Could you check the the messages in the console (F12) in your browser when opening the website?
Give ctrl-F5 to restart and have a console refresh.

If anything relevant, please post a screen shot.
Thanks,

Console (F12) result:

index.htm:1 Access to XMLHttpRequest at 'file:///C:/TEST%20WEB%20CUM%20New/websitedata.json?_=1680298317810' from origin 'null' has been blocked by CORS policy: Cross origin requests are only supported for protocol schemes: http, data, isolated-app, chrome-extension, chrome, https, chrome-untrusted.
Consolo errors.png
With restart same error occur.

I will investigate, but i'm not a web programmer ;). Any thoughts?
You do not have the required permissions to view the files attached to this post.
Zappastre
Posts: 10
Joined: Sat 25 Mar 2023 1:01 am
Weather Station: EasyWeatherPro Ultrasonic
Operating System: W10

Re: Activate CMX web locally /

Post by Zappastre »

As far as i see, I have to install a Webserver locally if i ant to test the web, do I?

Regards
User avatar
HansR
Posts: 6027
Joined: Sat 20 Oct 2012 6:53 am
Weather Station: GW1100 (WS80/WH40)
Operating System: Raspberry OS/Bookworm
Location: Wagenborgen (NL)
Contact:

Re: Activate CMX web locally /

Post by HansR »

Zappastre wrote: Fri 31 Mar 2023 9:49 pm As far as i see, I have to install a Webserver locally if i ant to test the web, do I?
I think so yes. The access to the URL is limited by the CORS strategy, I am not sure if that works with local files, apparently not. Maybe somebody else has a trick here? So far, from the users who implemented the local file do have a local server and FTP installed and I think they have no issues.

If you finally want to have a website hosted at a provider (i.e. not hosting it yourself) you might just as well use that hosted domain for the test as well.
Hans

https://meteo-wagenborgen.nl
CMX build 4017+ ● RPi 3B+ ● Raspbian Linux 6.1.21-v7+ armv7l ● dotnet 8.0.3
SamiS
Posts: 392
Joined: Sun 27 Feb 2011 5:13 pm
Weather Station: Ecowitt HP2551 & GW1100
Operating System: Raspberry Pi OS
Location: Kangasala, Finland

Re: Activate CMX web locally /

Post by SamiS »

One resolution could be using the old style legacy website, that was present for some time after the new website design was released in 3.10.0 b3115. I haven’t tried it with mx, but if a local webserver is not an option, then this would make some info available.

Technically it would still also be possible to modify the new website at least partially to work as before, by replacing json data values with webtags and make the file as a processable template again. But it would need quite a bit tinkering.
User avatar
HansR
Posts: 6027
Joined: Sat 20 Oct 2012 6:53 am
Weather Station: GW1100 (WS80/WH40)
Operating System: Raspberry OS/Bookworm
Location: Wagenborgen (NL)
Contact:

Re: Activate CMX web locally /

Post by HansR »

SamiS wrote: Sat 01 Apr 2023 7:47 am One resolution could be using the old style legacy website, that was present for some time after the new website design was released in 3.10.0 b3115. I haven’t tried it with mx, but if a local webserver is not an option, then this would make some info available.
Yes, any HTML (no javascript [data]file loading) would work without a server, loads just as a file.
SamiS wrote: Sat 01 Apr 2023 7:47 am Technically it would still also be possible to modify the new website at least partially to work as before, by replacing json data values with webtags and make the file as a processable template again. But it would need quite a bit tinkering.
I am not sure of my English proverbs but wouldn't that be shooting a mosquito with a cannon? I would apply a variation to Occam's Razor: of all solutions possible choose the simplest. So without a server, leave the new standard website out.
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: 12904
Joined: Thu 07 Jan 2010 9:44 pm
Weather Station: Davis VP2/WLL
Operating System: Bullseye Lite rPi
Location: Wilmslow, Cheshire, UK
Contact:

Re: Activate CMX web locally /

Post by mcrossley »

What is the web site giving you locally that the dashboard doesn't - apart from a different presentation?
User avatar
mcrossley
Posts: 12904
Joined: Thu 07 Jan 2010 9:44 pm
Weather Station: Davis VP2/WLL
Operating System: Bullseye Lite rPi
Location: Wilmslow, Cheshire, UK
Contact:

Re: Activate CMX web locally /

Post by mcrossley »

And there are lots of "mini" web servers that will serve up simple HTML from a command line program without having to install a full blown web server. I often use one for testing the default web site.
water01
Posts: 3294
Joined: Sat 13 Aug 2011 9:33 am
Weather Station: Ecowitt HP2551
Operating System: Windows 10 64bit
Location: Burnham-on-Sea
Contact:

Re: Activate CMX web locally /

Post by water01 »

shooting a mosquito with a cannon?
Never heard of that one Hans but you might mean "using a sledgehammer to crack a nut"!!
David
Image
SamiS
Posts: 392
Joined: Sun 27 Feb 2011 5:13 pm
Weather Station: Ecowitt HP2551 & GW1100
Operating System: Raspberry Pi OS
Location: Kangasala, Finland

Re: Activate CMX web locally /

Post by SamiS »

mcrossley wrote: Sat 01 Apr 2023 8:38 am What is the web site giving you locally that the dashboard doesn't - apart from a different presentation?
For me the different presentation would be the main thing. To see the same data that is on website’s index page, on dashboard you probably need to open four different pages (dashboard, now, gauges and today/yesterday), and for example consecutive dry/wet days is not presented at all.
SamiS
Posts: 392
Joined: Sun 27 Feb 2011 5:13 pm
Weather Station: Ecowitt HP2551 & GW1100
Operating System: Raspberry Pi OS
Location: Kangasala, Finland

Re: Activate CMX web locally /

Post by SamiS »

HansR wrote: Sat 01 Apr 2023 8:23 am I am not sure of my English proverbs but wouldn't that be shooting a mosquito with a cannon? I would apply a variation to Occam's Razor: of all solutions possible choose the simplest. So without a server, leave the new standard website out.
I agree to that metaphor. But I’m not sure if this would be much a bigger job than many of us have done by translating the website to our own language. I’m not saying anyone should do the website code modification from json to old processable templates. But if a webserver would not be an option for some reason, and you still would want the default website, this would be one way to get it at least partially. Is there any sense in it, probably not. But I’m not here to judge how people want to spend their time. :lol:
User avatar
HansR
Posts: 6027
Joined: Sat 20 Oct 2012 6:53 am
Weather Station: GW1100 (WS80/WH40)
Operating System: Raspberry OS/Bookworm
Location: Wagenborgen (NL)
Contact:

Re: Activate CMX web locally /

Post by HansR »

water01 wrote: Sat 01 Apr 2023 8:41 am
shooting a mosquito with a cannon?
Never heard of that one Hans but you might mean "using a sledgehammer to crack a nut"!!
That's the one I was looking for. The mosquito/cannon one is the literal translation of Dutch analogon :)
SamiS wrote: Sat 01 Apr 2023 10:04 am I agree to that metaphor [...] But I’m not here to judge how people want to spend their time.
Agreed. But then the easiest way out is probably: make a simple site yourself.
I would say: if you still want the default website, get a (simple) server. Along what Mark says.
But even Apache is not that difficult to install, it only starts being complex when you start configuring.
Hans

https://meteo-wagenborgen.nl
CMX build 4017+ ● RPi 3B+ ● Raspbian Linux 6.1.21-v7+ armv7l ● dotnet 8.0.3
Post Reply