mklements / oled_stats Goto Github PK
View Code? Open in Web Editor NEWOLED Stats Display Script For Raspberry Pi
License: MIT License
OLED Stats Display Script For Raspberry Pi
License: MIT License
Hello,
i´m setting OLED I2C display on RPi4. I follow your tutorial step after step, Every command ends succsesfully but I stuck on command git clone..... OLED_Stats.git without this step I can´t go to another step.
github
Using RPi4 with Raspbian Bulllseye lite 64bit. Is this just because i use version without? I connect to terminal via ssh from windows 10 ultimate x64
Where can be the problem?
Thanks a million for this code! Just got it up & running.
Quick question, what is the purpose of the "LA" string is this line?
Thanks in advance!
https://github.com/mklements/OLED_Stats/blame/f153be2a4971081e70037520e3094461925a4852/stats.py#L6
I am getting the following error when I try to use stats.py
(venv) pi@MyPi:~/OLED_Stats $ python3 stats.py
Traceback (most recent call last):
File "/home/pi/OLED_Stats/stats.py", line 6, in
import board
ModuleNotFoundError: No module named 'board'
If you are trying to use this and your display shows junk instead of actual text - you got lucky and bought the display that supports the sh1106 driver instead of more common ssd1306. This script ONLY works for ssd1306 displays. Pay close attention when choosing your display, but in case you already bought the incompatible display, follow this guide instead: https://www.youtube.com/watch?v=LdOKXUDw2NY
Took am an entire evening to figure out.
I tried having the file simply in /home/pj but it didn't won't even I tried to run after reboot manually. Now I have it in oled dir with other files like PixelOperator.ttf and the script will start if triggered manually. But after reboot it always throws the attached log
Crontab
@reboot python3 /home/pj/oled/stats.py >> /home/pj/oled/cron.log 2>&1
Error cat log:
Traceback (most recent call last):
File "/home/pj/oled/stats.py", line 44, in <module>
font = ImageFont.truetype('PixelOperator.ttf', 16)
File "/usr/lib/python3/dist-packages/PIL/ImageFont.py", line 852, in truetype
return freetype(font)
File "/usr/lib/python3/dist-packages/PIL/ImageFont.py", line 849, in freetype
return FreeTypeFont(font, size, index, encoding, layout_engine)
File "/usr/lib/python3/dist-packages/PIL/ImageFont.py", line 209, in __init__
self.font = core.getfont(
OSError: cannot open resource
OS: rasberry pi lite
Hello,
I tried to follow your tutorial on a Raspberry Pi 5 and Raspbian bookworm.
I found out that a virtual environment is required for pip3 installations. I created a venv "project" folder.
This is what I got:
`Successfully installed setuptools-69.0.3
(project) pi@raspberrypi:~ $ pip3 install --upgrade adafruit-python-shell
Looking in indexes: https://pypi.org/simple, https://www.piwheels.org/simple
Requirement already satisfied: adafruit-python-shell in ./project/lib/python3.11/site-packages (1.8.0)
Requirement already satisfied: clint in ./project/lib/python3.11/site-packages (from adafruit-python-shell) (0.5.1)
Requirement already satisfied: Adafruit-PlatformDetect in ./project/lib/python3.11/site-packages (from adafruit-python-shell) (3.58.0)
Requirement already satisfied: args in ./project/lib/python3.11/site-packages (from clint->adafruit-python-shell) (0.1.0)
(project) pi@raspberrypi:~ $ wget https://raw.githubusercontent.com/adafruit/Raspberry-Pi-Installer-Scripts/master/raspi-blinka.py
--2024-01-18 09:50:28-- https://raw.githubusercontent.com/adafruit/Raspberry-Pi-Installer-Scripts/master/raspi-blinka.py
Auflösen des Hostnamens raw.githubusercontent.com (raw.githubusercontent.com)... 2606:50c0:8003::154, 2606:50c0:8000::154, 2606:50c0:8001::154, ...
Verbindungsaufbau zu raw.githubusercontent.com (raw.githubusercontent.com)|2606:50c0:8003::154|:443 ... verbunden.
HTTP-Anforderung gesendet, auf Antwort wird gewartet ... 200 OK
Länge: 5481 (5,4K) [text/plain]
Wird in »raspi-blinka.py.1« gespeichert.
raspi-blinka.py.1 100%[===================>] 5,35K --.-KB/s in 0,004s
2024-01-18 09:50:28 (1,33 MB/s) - »raspi-blinka.py.1« gespeichert [5481/5481]
(project) pi@raspberrypi:~ $ python3 raspi-blinka.py
Installer must be run as root.
Try 'sudo python3 raspi-blinka.py'
(project) pi@raspberrypi:~ $ sudo python3 raspi-blinka.py
Traceback (most recent call last):
File "/home/pi/raspi-blinka.py", line 12, in
from adafruit_shell import Shell
ModuleNotFoundError: No module named 'adafruit_shell'
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "/home/pi/raspi-blinka.py", line 14, in
raise RuntimeError("The library 'adafruit_shell' was not found. To install, try typing: sudo pip3 install adafruit-python-shell")
RuntimeError: The library 'adafruit_shell' was not found. To install, try typing: sudo pip3 install adafruit-python-shell
(project) pi@raspberrypi:~ $`
It seems I’m caught in a loop because Adafruit Python Shell is not installed (properly).
Btw I’m wondering why I shall use sudo in the virtual environment. Normally this shouldn’t be used here as far as I know.
As you can see adafruit-python-shell is installed but adafruit_shell is not found (see above).
`(project) pi@raspberrypi:~ $ pip3 list
Package Version
Adafruit-PlatformDetect 3.58.0
adafruit-python-shell 1.8.0
args 0.1.0
clint 0.5.1
pip 23.0.1
setuptools 66.1.1
wheel 0.38.4
(project) pi@raspberrypi:~ $ pip3 list | grep -i adafruit
Adafruit-PlatformDetect 3.58.0
adafruit-python-shell 1.8.0
(project) pi@raspberrypi:~ $`
See also adafruit/Adafruit_Blinka/issues here on GitHub
Hello,
i´m setting OLED I2C display on RPi4. I follow your tutorial step after step, Every command ends succsesfully but I stuck on command git clone..... OLED_Stats.git without this step I can´t go to another step.
Using RPi4 with Raspbian Bulllseye lite 64bit. Is this just because i use version without? I connect to terminal via ssh from windows 10 ultimate x64
Where can be the problem?
Thank you very much
I had to do the following steps (which are not mentionned in the README) to make the scripts work :
sudo apt-get install python3-rpi.gpio libopenjp2-7 libtiff5
sudo pip3 install Pillow
After that, they work perfectly.
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.