Closed MoJeeza closed 1 month ago
Hi @MoJeeza,
Have you installed the luma.oled Python3 library? As mentioned in Info uHAT docs it can be done with the following command:
pip3 install --upgrade luma.oled
Which example are you trying to get working?
Best regards, Leon
Thanks for the response...yes that solved the problem but now getting: `>> %Run testing_oled.py Unexpected error: <class 'OSError'>
Process ended with exit code 2. ` it is for this example code:
I don't see os When I try to find the package in Thonny. Isn't OS a built-in library for Python3?
OK, I found the issue: It's with this line: drawfont = "pixelmix.ttf"
where should this file be? I tried putting it in the same folder as the .py file and I also added the full path to the filename and no luck
OK, I found the issue: It's with this line: drawfont = "pixelmix.ttf"
where should this file be? I tried putting it in the same folder as the .py file and I also added the full path to the filename and no luck
Same directory where the Python script is, just like it is here: https://github.com/AnaviTechnology/anavi-examples/tree/master/peripherals/OLED-SSD1306/python
Best regards, Leon
/Documents/python/RPi/RPi5 $ python3 testing_oled.py Unexpected error: <class 'OSError'>
4x16_segment_led_test.py testing_led_blink.py testing_oled.py pixelmix.ttf testing_led_blink_v2.py
Even when I run it as an executable script: /Documents/python/RPi/RPi5 $ ./testing_oled.py Unexpected error: <class 'OSError'>
I tried with all three options: drawfont = "pixelmix.ttf"
No luck...both files in the same directory
Once you have cloned the repository and installed all dependencies, you need to run the Python3 script to show information on the OLED display:
cd ~/anavi-examples/peripherals/OLED-SSD1306/python/
python3 OLED-SSD1306.py
The IP address and "Hello, World!" will be shown on the display. Press Ctrl+C to terminate the Python3 script and clear the display.
More details are available at ANAVI Info uHAT user's manual: https://github.com/AnaviTechnology/anavi-docs/blob/main/anavi-info-uhat/anavi-info-uhat.md#python
Please note that testing_oled.py
from your logs is not part of this repository and I cannot comment as I have no idea what is the source code of this script.
Taking the example given on this repository - into Thonny on Rpi5 with Python 3.11 in a virtual env and after installing luma.core package I get the following error:
%Run -c $EDITOR_CONTENT Traceback (most recent call last): File "<string>", line 5, in <module> ModuleNotFoundError: No module named 'luma.oled'
Any suggestions?