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 4019) - 03 April 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

Moon Phases

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

water01
Posts: 3252
Joined: Sat 13 Aug 2011 9:33 am
Weather Station: Ecowitt HP2551
Operating System: Windows 10 64bit
Location: Burnham-on-Sea
Contact:

Re: Moon Phases

Post by water01 »

nitrx wrote:Can't you change the name of the images to the text ?
That won't work as I would have to have file named for each different image by each language which could get a bit horrendous!!

But I have solved it for all languages by using #MoonPercent and this table as suggested by Laurent.

New Moon 0% - 1%
Waxing Crescent 1% - 49%
First Quarter 49% - 50%
Waxing Gibbous 51% - 99%
Full Moon 99% to 100%
Waning Gibbous -99% to -51%
Last Quarter -50% to -49%
Waning Crescent -49% to -1%

So I have posted the new version in my original first release post (post 10 on Topic Page 1), this version should work for all MX users regardless of language. As always let me know if any problems and I will endeavour to fix them.
Last edited by water01 on Thu 17 Sep 2015 7:13 am, edited 2 times in total.
David
Image
willyweather
Posts: 54
Joined: Tue 15 May 2012 8:50 pm
Weather Station: WH 1080
Operating System: Windows 8.1 and Raspbian
Location: Assling

Re: Moon Phases

Post by willyweather »

Hi Water01,

thanks for the script - I'm just installing it right now.

One problem happens to me:

On my web page (created by Cumulus MX 3030 on a RasPi) there is no Moon-picture at all (has never been from the beginning).
I assume, that therefore there is simply no line that reads –

<td rowspan="3"><img src="images/moon.bmp" alt="Moon" width="64" align="left" border="0" height="64" style="margin: 0px 10px" /></td>

... at least I can't find it.

Where shall I put the line

<td rowspan="3"><img src="moonphase.php" alt="Moon" width="64" align="left" border="0" height="64" style="margin: 0px 10px" /></td>

in my indexT.htm ?

regards,

Wilfried

p.s.: Just for clarification a second question:

"... and the directory (directory not the contents)"

does mean:

"... and the complete directory "moon"(complete directory not only the contents)" right ?
Last edited by willyweather on Wed 16 Sep 2015 9:22 pm, edited 1 time in total.
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: Moon Phases

Post by beteljuice »

@David ...

Just had a quick look-see at your script. What do you do about the Southern hemisphere where the image needs to be 'mirrored' ? :groan:
Image
......................Imagine, what you will KNOW tomorrow !
water01
Posts: 3252
Joined: Sat 13 Aug 2011 9:33 am
Weather Station: Ecowitt HP2551
Operating System: Windows 10 64bit
Location: Burnham-on-Sea
Contact:

Re: Moon Phases

Post by water01 »

willyweather wrote:Hi Water01,


Where shall I put the line
<td rowspan="3"><img src="moonphase.php" alt="Moon" width="64" align="left" border="0" height="64" style="margin: 0px 10px" /></td>

in my indexT.htm ?

regards,

Wilfried

p.s.: Just for clarification a second question:

"... and the directory (directory not the contents)"

does mean:

"... and the complete directory "moon"(complete directory not only the contents)" right ?
The line needs to go after

Code: Select all

<td class="site_data" style="text-align: left;"><#moonrise></td>
Hadn't realised because I do not use the CumulusMX web files (mine is a PHP site) that Steve had removed the moon phase image. If you look here http://www.dmjsystems.co.uk/weather/index.php you can see it in action!!

Yes that is right about the Directory, your English is more correct I will alter my Word Doc.
David
Image
water01
Posts: 3252
Joined: Sat 13 Aug 2011 9:33 am
Weather Station: Ecowitt HP2551
Operating System: Windows 10 64bit
Location: Burnham-on-Sea
Contact:

Re: Moon Phases

Post by water01 »

beteljuice wrote:@David ...

Just had a quick look-see at your script. What do you do about the Southern hemisphere where the image needs to be 'mirrored' ? :groan:
Sigh, once you start these things you never think of all the likely permutations!!

So here is an updated version that should work in the Southern hemisphere (if I have understood mirroring right i.e. when we see waxing you see waning) and the Northern hemisphere.

Note for those of you who have already installed it there is an extra parameter in moonphasetagT.txt ($latitude) so you will have to copy that to the correct place (as in the Word doc in the zip) to get this to work otherwise you will get a PHP error or no image. You could also, if you are happy with the previous version just ignore this update as this is only to fix the Southern Hemisphere problem.

It has been pointed out I ought to have the new version always in the original post of this code's Topic so I have removed it and the latest version is in post 10 on Topic Page 1.
David
Image
water01
Posts: 3252
Joined: Sat 13 Aug 2011 9:33 am
Weather Station: Ecowitt HP2551
Operating System: Windows 10 64bit
Location: Burnham-on-Sea
Contact:

Re: Moon Phases

Post by water01 »

OK as per previous post I have updated the package in page 1 post 10 again as it was pointed out what I had done for the Southern Hemisphere wasn't exactly correct.

So there is an updated moonphase.php plus a new Moon directory containing 6 mirrored images of the waxing/waning/quarter phases mirrored for the Southern Hemisphere. So if you want that you must upload and overwrite the old moon directory with the new one.
David
Image
willyweather
Posts: 54
Joined: Tue 15 May 2012 8:50 pm
Weather Station: WH 1080
Operating System: Windows 8.1 and Raspbian
Location: Assling

Re: Moon Phases

Post by willyweather »

Hi David,
thanks for giving me the right position in the original indexT.htm - worked perfectly.

However, I ran into another, more severe problem - my website doesn't support php at all :o
I didn't know that before and just learned that from my provider.
Now I'm looking for other ways to do the job ...
The logic itself looks not too complicated (I'm an "older" SW-engineer and can read and basically understand the content of the file moonphase.php), but I don't have a clue about php, HTML or Java (that was after my time ;)

Does anyone have any hints how to change the php script method to e.g. an html or Java script?

regards,

Wilfried
User avatar
Ned
Posts: 258
Joined: Mon 19 Jul 2010 11:15 am
Weather Station: WS2083 (aspirated)
Operating System: Win 10
Location: Auckland NZ

Re: Moon Phases

Post by Ned »

If the images are mirrored (i.e back to front) that will not give correct results for the southern hemisphere - it's simply rotated 180 degrees.
We can see how the 'other half' sees the moon by standing on our heads, although I'm not advising anyone to do that literally :D
richard_newberry
Posts: 481
Joined: Tue 12 Apr 2011 10:23 pm
Weather Station: Watson W-8186
Operating System: Raspbian Bookworm & Debian 12
Location: Leicester
Contact:

Re: Moon Phases

Post by richard_newberry »

I've got a problem with this. I've done everything as instructed but i'm getting this in apache2 error logs.

[Sat Dec 05 01:14:34.430652 2015] [:error] [pid 10264] [client 86.184.218.138:1028] PHP Warning: copy(moon/moon.jpg): failed to open stream: Permission denied in /var/www/moonphase.php on line 37, referer: http://kirbymuxloe-weather.dyndns.org/index.htm

Any ideas?
Desford Weather (at parents)
https://desford-weather.co.uk

Countesthorpe Weather (at mine)
https://countesthorpe-weather.co.uk
water01
Posts: 3252
Joined: Sat 13 Aug 2011 9:33 am
Weather Station: Ecowitt HP2551
Operating System: Windows 10 64bit
Location: Burnham-on-Sea
Contact:

Re: Moon Phases

Post by water01 »

The permissions on /moon are incorrect so the file copy cannot be done.

Try sudo chmod /moon 777 to open up the permissions.
David
Image
richard_newberry
Posts: 481
Joined: Tue 12 Apr 2011 10:23 pm
Weather Station: Watson W-8186
Operating System: Raspbian Bookworm & Debian 12
Location: Leicester
Contact:

Re: Moon Phases

Post by richard_newberry »

Nope still getting the same message

[Sat Dec 05 11:16:54.212597 2015] [:error] [pid 18013] [client 86.184.218.138:1027] PHP Warning: copy(moon/moon.jpg): failed to open stream: Permission denied in /var/www/moonphase.php on line 37, referer: http://kirbymuxloe-weather.dyndns.org/
Desford Weather (at parents)
https://desford-weather.co.uk

Countesthorpe Weather (at mine)
https://countesthorpe-weather.co.uk
freddie
Posts: 2475
Joined: Wed 08 Jun 2011 11:19 am
Weather Station: Davis Vantage Pro 2 + Ecowitt
Operating System: GNU/Linux Ubuntu 22.04 LXC
Location: Alcaston, Shropshire, UK
Contact:

Re: Moon Phases

Post by freddie »

richard_newberry wrote:Nope still getting the same message

[Sat Dec 05 11:16:54.212597 2015] [:error] [pid 18013] [client 86.184.218.138:1027] PHP Warning: copy(moon/moon.jpg): failed to open stream: Permission denied in /var/www/moonphase.php on line 37, referer: http://kirbymuxloe-weather.dyndns.org/
Have you checked the permissions of the file moon.jpg? i.e that the user that is running PHP (likely to be the same user that runs the web server) has read and write permission on moon.jpg. You could try (after changing directory to where the file lives):

Code: Select all

chmod 666 moon.jpg
Freddie
Image
water01
Posts: 3252
Joined: Sat 13 Aug 2011 9:33 am
Weather Station: Ecowitt HP2551
Operating System: Windows 10 64bit
Location: Burnham-on-Sea
Contact:

Re: Moon Phases

Post by water01 »

Whoops got the syntax wrong.
Try sudo chmod /moon 777
should have been
Try sudo chmod 777 /moon
Also try Freddie's suggestion as it is PHP that has not got permissions to copy the file.
David
Image
richard_newberry
Posts: 481
Joined: Tue 12 Apr 2011 10:23 pm
Weather Station: Watson W-8186
Operating System: Raspbian Bookworm & Debian 12
Location: Leicester
Contact:

Re: Moon Phases

Post by richard_newberry »

working now cheers.
Desford Weather (at parents)
https://desford-weather.co.uk

Countesthorpe Weather (at mine)
https://countesthorpe-weather.co.uk
richard_newberry
Posts: 481
Joined: Tue 12 Apr 2011 10:23 pm
Weather Station: Watson W-8186
Operating System: Raspbian Bookworm & Debian 12
Location: Leicester
Contact:

Re: Moon Phases

Post by richard_newberry »

[Contents deleted due to false security alert]
Desford Weather (at parents)
https://desford-weather.co.uk

Countesthorpe Weather (at mine)
https://countesthorpe-weather.co.uk
Post Reply