LoveBootCaptain / WeatherPi_TFT

a weather display for a raspberry pi and a TFT display written in python3 and pygame
Other
80 stars 24 forks source link

Pygame version #25

Closed fruitofgeorge closed 4 years ago

fruitofgeorge commented 4 years ago

In the readme you state pygame version 2.0.0.dev8 is required but in the requirements.txt is
pygame~=2.0.0.dev8. Which is it? If that version is indeed required, using pip won't work as the latest version I see on PyPI is 1.9.6. Needless to say my python installation is a wreck trying to figure out all the things that went wrong after following this installation guide.

LoveBootCaptain commented 4 years ago

hi @fruitofgeorge and thx for the interest in my little project. i ran in some issues with pygame 1.9.6 and fixed it with upgrading to 2.0.0.dev8 which wasn't such a pain a thought but it takes a long time to build everything from source. especially on the PiZero. for me it worked straight foreward following the guides i put into the readme. but they require some time and linux know how. it is hard to set this up, that's for sure and I'm not happy with it.

after i fixed a lot of performance issues I just tested the current version I have on my testbench I can confirm that it will work without issues with 1.9.6 again. at least for me that was an issue.

you can just try it out if it will work with 1.9.6 and if so please let me know. I will update the master branch and the readme this evening with my current code I have running on my unit here in the living room.

LoveBootCaptain commented 4 years ago

back to where it was... changed some filenames and revered back to init.d service, cause the systemd service mages troubles with pygame. so back to old school.

fruitofgeorge commented 4 years ago

Nice, I got it up and running. Even managed to Americanize it with imperial units and date/time formatting. (Was like a needle in a haystack looking to change that C to an F!) I wanted to point out your bit of python code in the guide for updating all modules is no longer supported in pip versions 10+. Unfortunately I was unable to find any suitable replacement that still functions either. One last question is why use a touchscreen for this project? Is there supposed to be interactive input? (Would be really cool if you could tap the date to toggle to the 16 day forecast or tap the current weather icon for additional forecast info, for example.)

LoveBootCaptain commented 4 years ago

i always forget that option when adding a new setting to the config.json or theme. i will add a string to configure the right unit for the delivered temp.

i guess when you call the api with your locale and language you will get the temps already converted to fahrenheit, right? or do i have to add a calculation too? never tested it for myself and you are the first american who opened a ticket in that project :D

the next update on the master branch (today or tomorrow) will have that feature as configuration ( have a look on #26 )

thx as well for the hint and the code fragment. i think it is really not used anymore. as I wrote the first version of the dashboard the raspbian images have way to old debian packages installed. Nowadays it's a little better but since I only 3 dependencies outside the standard library that should be easily improved by adding some explicit versions in the requirements.txt. the latest raspbian buster comes only with a preview version of pygame 1.9.4 for example.

and last but not least ... yes... there is touchscreen support planned for the hyperpixel. don't know if i get it running on all ili9341 displays cause they are way to different and i only have an adafruit TFT for testing and a hardware sample og @HWHardsoft AZ-Touch Pi0 but in the driver the touchscreen is inverted and can't be changed without writing to much code for it to support all kind of displays. i will start with the hyperpixel4 cause it's working right out of the box, than let's have a look on the adafruit hardware (cause it's officially supported by raspbian images) and than maybe all the other cheap ili9341 TFT's.... maybe @HWHardsoft comes up with a new driver so that i can test it with different TFT's... maybe it's possible to support some displays with a simple config.

it is planned to have different screens, like menü for restart, reboot, shutdown and I will have a look what I can do with the weather data. some 7 or 16 days forecasts sounds great and easy to to, if I finally get the modularisation done in #13 . I already have a nice prototype up and running where I managed to have different screens. It's just a matter of free time for the project.

so keep support up and suggest new features... that always helps to find time to work on it.

kind regards from berlin

fruitofgeorge commented 4 years ago

When I was looking at the weatherbit API it said metric units were default but I guess it could be smart enough to change depending on locale. To be safe, what I did was add &unit=I to the end of the json options string. Then manually changed C to F and km/h to mph. There was also some math where you convert m/s to km/h which I removed to keep the mph data accurate. Lastly in the theme, I used %b%d%Y date format and %I with %p for 12 hour time.

For reference, I'm running a rPi 1 B with the old Adafruit PiTFT 2.8" resistive touchscreen that plugs directly onto the headers. Looking forward to what you do with this project!

LoveBootCaptain commented 4 years ago

Thx for the testing and looking into the imperial system stuff. great ! I was a little fast in brinning that option live. Yesterday I only changed the unit on the current temp. seems that was not enough, since I've had a look into weatherbit api docs again.

I added the units as a new parameter to the options string for the request parameters. It's triggered by the same config value ["LOCALE"]["METRIC"] which can be true or false.

For the wind speed it triggers the conversion in km/h when METRIC is true because api delivers in METRIC wind speed in m/s (but I like it in km/h) and of IMPERIAL it already converted it to mph.

The time and date formating I won't touch, but will put your values in the README.md for others who want to change to a 12h clock. Thx for the right values :)

I reopend the PR and the branch again and will update it asap.

thx again for your support kind regards and stay safe and healthy