lovebootcaptain / weatherpi_tft Goto Github PK
View Code? Open in Web Editor NEWa weather display for a raspberry pi and a TFT display written in python3 and pygame
License: Other
a weather display for a raspberry pi and a TFT display written in python3 and pygame
License: Other
hi,
after a reboot the UI for weather forecast is not starting - no icons displayed - AZ Touch TFT Display remains dark.
I can see all messages during startup, but when the UI shall start, nothing happens .
I have had the same issue 4 weeks ago: After several reboots the UI was starting again - everything seemed to work as usual...until yesterday.
Now I don't wont to wait for a miracle and that's why I kindly ask for your support. I haven't done any operating system upgrades because I have red this may have conflicts with the UI.
I would appreciate any kind of feedback and help. I did a look into the logfiles, but I was unable to find something helpful. Additional I tried to restart Weather TFT: sudo sh ./WeatherPiTFT.sh restart
[....] Stopping system WeatherPiTFT daemon:start-stop-daemon: warning: failed to kill 444: No such process
No process in pidfile '/var/run/WeatherPiTFT.pid' found running; none killed.
failed!
[ ok ] Starting system WeatherPiTFT daemon:.
Hi there,
I'm new to GitHub so am not sure if this is the best way to raise a bug report. In my understanding wind speed from Weatherbit.IO comes as m/s, which to convert to km/h you need to multiply by 3.6, similarly to convert from m/s to mph you need to multiply by 2.24, so in WeatherPiTFT.py the following line, line #731
wind_speed = wind_speed * 3.6 if METRIC else wind_speed
perhaps should be something like
wind_speed = wind_speed * 3.6 if METRIC else wind_speed * 2.2
BTW I love your work on this project,
g0ods.
Hello,
maybe i am making a mistake i don´t get, but i is it possible that the external display from the AZ-Touch Pi0 does not work with the current kernel version?
I tried several times to set the system up acccording to the readme and everything works fine (display has power, weatherdisplay on hdmi works well, variables are set properly....), except it does not show up on the external displayl.
I would be thankful for any hint.
regards
Matthias
weatherbit-api returns the sunset/down in UTC-time
Hello I have tired this project on Raspi 0W2 and I have no idea what I'm doing wrong, it is just not working. I did follow the instuctions and I did try it many many times with headless and desktop version of OS and I have failed. Please help if possible.
I have followed all the instructions on how to install WeatherPi_TFT but when i start the service nothing happens. The screen is still just on the command line prompt. I am using a generic ili9341 display with a raspberry pi 0 with Jessie minimal.
Any help would be appreciated!
... 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!)...
Originally posted by @fruitofgeorge in #25 (comment)
Hi Captain,
I've set up and updated a fresh new Raspbian. Then followed the instructions exactly.
My hardware is a Pi4 with an official 7 inch touchscreen.
I start the WeatherPiTFT service first and then the script but unfortunately the following error message:
pygame 1.9.6 Hello from the pygame community. https://www.pygame.org/contribute.html Traceback (most recent call last): File "/home/pi/WeatherPi_TFT/./WeatherPiTFT.py", line 68, in <module> config = json.loads(config_data) File "/usr/lib/python3.9/json/__init__.py", line 346, in loads return _default_decoder.decode(s) File "/usr/lib/python3.9/json/decoder.py", line 337, in decode obj, end = self.raw_decode(s, idx=_w(s, 0).end()) File "/usr/lib/python3.9/json/decoder.py", line 353, in raw_decode obj, end = self.scan_once(s, idx) json.decoder.JSONDecodeError: Expecting ',' delimiter: line 18 column 29 (char 429)
Solved.....
Wrong postal code.
I live in Saxony / Germany (04425 in Germany)
If the zip code begins with a 0 then the zip code must be in "" in config.json.
Wiki should be updated by me
Hello Everyone,
I got the kit for building the AZ Touch PI-Zero weather station. All the installation procedures went fine.
However, what if Weatherbit doesn't support the city where I am? I live in Novi Sad, Serbia, and I can't get weather info from Weatherbit. To be honest, I couldn't fid PIN codes for Serbia.
If I use the default configuration (Berlin, Germany) everything runs smooth. For instance, at the moment, I see on the display the information for Berlin. Actually, I'm writing this paragraph just to keep it clear that it's not a problem with configuration, Weatherbit API, hardware, and so on.
After saying this, my question is, is there support to other weather backend service?
Thanks!
The code does not run as a service, the file needs to be converted to use LF.
Current behavior:
$ sudo service WeatherPiTFT restart
$ sudo service WeatherPiTFT status
● WeatherPiTFT.service - LSB: WeatherPiTFT
Loaded: loaded (/etc/init.d/WeatherPiTFT; generated)
Active: active (exited) since Sat 2020-05-09 11:59:16 CEST; 10s ago
Docs: man:systemd-sysv-generator(8)
Process: 1266 ExecStart=/etc/init.d/WeatherPiTFT start (code=exited, status=0/SUCCESS)
Mai 09 11:59:16 piwetter systemd[1]: Starting LSB: WeatherPiTFT...
Mai 09 11:59:16 piwetter WeatherPiTFT[1266]: Starting system WeatherPiTFT daemon:.
Mai 09 11:59:16 piwetter systemd[1]: Started LSB: WeatherPiTFT.
Hi Captain
Have tried everything.
But unable to get the python script to recognise the file LC_ALL.
get this error
pygame 1.9.4.post1
Hello from the pygame community. https://www.pygame.org/contribute.html
Traceback (most recent call last):
File "/media/pi/rootfs/home/pi/WeatherPi_TFT/WeatherPiTFT.py", line 85, in
locale.setlocale(locale.LC_ALL, (config['LOCALE']['ISO'], 'UTF-8'))
File "/usr/lib/python3.7/locale.py", line 604, in setlocale
return _setlocale(category, locale)
locale.Error: unsupported locale setting
/etc/default/locale contains the following.
LC_ALL=en_GB.UTF-8
LANG=en_GB
I have read both closed items
#6
and
I am in the UK.
also if i try to set my postal code in the config.json
Uk uses alpha numeric postal codes...
mine is SO302SX, the script errors.
Can you please advise what i am doing wrong.
Many thanks
Perhaps I should add I am using a Raspberry pi 0 W. with San Disk Ultra PLUS 32GB memory.
I have tried Reformatting the card and reloading the image using RASPI Imager several times. I am using Putty SSH to edit.
@LoveBootCaptain
in order to have an icon for every state that weather.io delivers i have to draw a bunch of new ones... yeaha :)
tried to run WeatherPiTFT but i get the output:
File "WeatherPiTFT.py", line 118, in
pygame.display.init()
pygame.error: fbcon not available
hi @LoveBootCaptain ,
i saw your project by twitter, and at the same i see this project here.i'm a beginner in python,too. So i try to build this project. And i encounter an error:
Traceback (most recent call last):
File "C:\Users\Administrator\Desktop\WeatherPi_TFT-master\WeatherPi_TFT.py", line 16, in <module>
locale.setlocale(locale.LC_ALL, locale.getdefaultlocale())
File "D:\Python35\lib\locale.py", line 594, in setlocale
return _setlocale(category, locale)
locale.Error: unsupported locale setting
i dont know where is wrong.However,i annotate return _setlocale(category, locale)
in "D:\Python35\lib\locale.py", line 594
and the error is gone
But there is a new error:
Traceback (most recent call last):
File "C:\Users\Administrator\Desktop\WeatherPi_TFT-master\WeatherPi_TFT.py", line 637, in <module>
loop()
File "C:\Users\Administrator\Desktop\WeatherPi_TFT-master\WeatherPi_TFT.py", line 602, in loop
Update.run()
File "C:\Users\Administrator\Desktop\WeatherPi_TFT-master\WeatherPi_TFT.py", line 410, in run
Update.update_json()
File "C:\Users\Administrator\Desktop\WeatherPi_TFT-master\WeatherPi_TFT.py", line 212, in update_json
config = json.loads(config_data)
File "D:\Python35\lib\json\__init__.py", line 319, in loads
return _default_decoder.decode(s)
File "D:\Python35\lib\json\decoder.py", line 339, in decode
obj, end = self.raw_decode(s, idx=_w(s, 0).end())
File "D:\Python35\lib\json\decoder.py", line 355, in raw_decode
obj, end = self.scan_once(s, idx)
json.decoder.JSONDecodeError: Expecting property name enclosed in double quotes: line 3 column 1 (char 59)
i have no idea about it...
PS: i can get defaultlocale by locale.getdefaultlocale()
:
>>> locale.getdefaultlocale()
('zh_CN', 'cp936')
Do you have a idea?
I have a Raspberry Pi 3 Model B v1.2 running the latest (32-bit) version of Raspberry Pi OS:
Linux raspberrypi 5.4.51-v7+ #1333 SMP Mon Aug 10 16:45:19 BST 2020 armv7l GNU/Linux
and Python 3.7.3. For a display, I have a SPI-attached ILI9341-based TFT LCD panel, specifically this one:
http://www.lcdwiki.com/3.2inch_SPI_Module_ILI9341_SKU:MSP3218
that I do have working with a dtoverlay, creating /dev/fb1
upon which I can render images (via fbi
) or play movies (via mplayer
).
Pulling the latest WeatherPi_TFT, however, I cannot get it to display on /dev/fb1
. Instead, it always ends up rendering on the HDMI display (/dev/fb0
). The same is true for other Python programs that make use of pygame and rely, as WeatherPi_TFT appears to, upon the environment variables $SDL_FBDEV and $SDL_VIDEODRIVER to "direct" libSDL to make use of a framebuffer directly.
Googling around about the issue, I came across this posting from early 2019 on the Raspberry Pi forums:
Issue using Python3/pygame to output to /dev/fb1 targeting a 2.8" TFT screen
https://www.raspberrypi.org/forums/viewtopic.php?t=234087
In a follow-up post, that author states the following:
Why not using pygame/SDL1.2.x as instructed in many forums and the adafruit TFT manual?
First, it doesn't work, at all. I have tried a gazillion versions of libsdl and its dependencies and they all failed consistently. I've tried forcing some libsdl versions downgrades, same with pygame version, just to try to get back to what the software was when my TFT screen was released (~2014). Then I aslo tried switching to C and handle SDL2 primitives directly.
Furthermore, SDL1.2 is getting old and I believe it is bad practice to build new code on top of old one. That said, I am still using pygame-1.9.4...
So why not SDL2? Well, they have stopped (or are about to stop) supporting framebuffers. I have not tried their alternative to framebuffers, EGL, as it got more complex the further I digged and it did not look too engaging (so old it felt like necro-browsing). Any fresh help or advice on that would be greatly appreciated BTW.
I was wondering if you had any insights into this matter? Have you tried WeatherPi_TFT under the latest Raspberry Pi OS? Do you know if libSDL is indeed deprecating / dropping support for framebuffers?
I ask since I would like to get WeatherPi_TFT working on my RPi3, as well as figure out what changes are necessary for my small project (kodi_panel) to make use of /dev/fb1.
Thanks!
I have followed all the steps and it works. But the screen keeps disappearing. Maybe I'm missing something am still relatively new to the Raspberry Pi
in order to do some more development in this project i want to rewrite the app and modularize the code
at first just draw some new icons for the current implementation... cause there are a lot new ones to draw :)
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.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.