ThingPulse / esp8266-weather-station-color

ESP8266 Weather Station in Color using ILI9341 TFT 240x320 display
https://thingpulse.com/product/esp8266-wifi-color-display-kit-2-4/
MIT License
569 stars 222 forks source link

Moon Phases Appear Reversed #130

Closed SillyHats closed 3 years ago

SillyHats commented 3 years ago

In my location the the moon phase should be 88% illuminated as indicated by online calendars and the color weather clock itself. However the moon icon shows 88% dark with the left 12% illuminated. It looks like this could be fixed by switching between the upper and lowercase version of the font according the below font link.

How can I switch moon font case?

moon font

https://www.dafont.com/moon-phases.font

https://github.com/ThingPulse/esp8266-weather-station-color/blob/c18d41038ca91ed18cd461029128a90514fffa56/esp8266-weather-station-color.ino#L442-L445

marcelstoer commented 3 years ago

Ahh, these moon phases...You might get a better approximation if you replace 97 with 65. Unfortunately, it isn't as simple as using one value for the northern hemisphere and the other for the south. At some point I wanted to replace the font icon with a real and accurate image but failed or stopped mid-way; don't remember anymore: https://astronomy.stackexchange.com/questions/39828/what-are-p-and-r-wrt-the-moon

Is that a 3D-printed case you have there?

SillyHats commented 3 years ago

Thanks for the tip. I'll give it a try when I get a chance.

This is the case I printed https://www.thingiverse.com/thing:2172068

SillyHats commented 3 years ago

Now that we have gone from waning gibbous to new moon the 3% illumination shows correctly with the original 97. newmoon

Switching to 97 to 65 reverses it to appear incorrectly 97% illuminated at this point in the cycle. newmoon-reversedfonticon

What is the source of the moon parameter data you referenced on the stack exchange discussion?

marcelstoer commented 3 years ago

Turns I still had my playground code around; just pushed it: https://github.com/ThingPulse/esp8266-weather-station-color/compare/fix/moon. Not sure if it's any useful. I think I maneuvered myself into a dead-end with that determineMoonIcon() function. You can still opt to use the old method right there on this line https://github.com/ThingPulse/esp8266-weather-station-color/compare/fix/moon#diff-af80725fde10b4f3e4c3341c195be9f9e10cf47fbd2fb7d0c9cd2a55814874f8R442

What is the source of the moon parameter data you referenced on the stack exchange discussion?

I may not fully understand that question, let me try.

That branch I talked about above has me use the full SunMoonCalc from our weather station library rather than the simplified Astronomy class. Hence, I have a ton of moon properties available to work with: https://github.com/ThingPulse/esp8266-weather-station/blob/40861dc2c1040319a310a7e4fe1c2cd331889693/src/SunMoonCalc.h#L48-L65

I think there's everything there we would need to call that remote service to fetch a nice moon image but I didn't look into which properties we would need to use.