I would like to control a 1.3" OLED display via the i2c interface of the Raspberry 4B.
It should be a status display of the Pi.
Can someone tell me how to proceed with the installation.
I have instructions for an installation, but I do not know how to load the files.
Where do I have to activate the interface and how can I use Sudo to load and install the files.
How can I run the following commands:
Now we select under "Interfacing Options" the item "I2C" and confirm with <Yes>.
After that we need some system programs:
sudo apt-get install -y python-dev python3-dev python-imaging python-smbus i2c-tools git python3-pip python-setuptools build-essential git-core libi2c-dev i2c-tools lm-sensors python-pip
With the command i2cdetect -y 1 we get the following output if the display was wired correctly:
If the display was successfully detected, we can now download and install the required libraries:
git clone git://github.com/rm-hull/ssd1306.git
sudo python setup.py install
git clone https://github.com/rm-hull/luma.examples.git
If all this is done now we can start different demos:
Analog clock with date python clock.py --display sh1106
Text and logo (animated) python crawl.py --display sh1106
3D animation python sprite_animation.py --display sh1106
gif (animated) player python animated_gif.py --display sh1106
To display system info we need psutil:
sudo pip install psutil
python sys_info.py --display sh1106
I look forward to your answers and greetings to all
root@Fileserver:~# git clone
fatal: You must specify a repository to clone.
usage: git clone  [–] 
-v, --verbose be more verbose
-q, --quiet be more quiet
–progress force progress reporting
-n, --no-checkout don’t create a checkout
–bare create a bare repository
–mirror create a mirror repository (implies bare)
-l, --local to clone from a local repository
–no-hardlinks don’t use local hardlinks, always copy
-s, --shared setup as shared repository
initialize submodules in the clone
-j, --jobs number of submodules cloned in parallel
directory from which templates will be used
–reference reference repository
–dissociate use --reference only while cloning
-o, --origin use instead of ‘origin’ to track upstream
checkout instead of the remote’s HEAD
path to git-upload-pack on the remote
–depth create a shallow clone of that depth
create a shallow clone since a specific time
deepen history of shallow clone, excluding rev
–single-branch clone only one branch, HEAD or --branch
–no-tags don’t clone any tags, and make later fetches not to follow them
–shallow-submodules any cloned submodules will be shallow
separate git dir from working tree
-c, --config <key=value>
set config inside the new repository
-4, --ipv4 use IPv4 addresses only
-6, --ipv6 use IPv6 addresses only
–filter object filtering
first a thank you to Joulinar for the help so far.
I am a little further, but it still does not work as desired.
how can i delete a complete with content?
the command rmdir does not work:
rmdir: failed to remove ‘/pi’: No such file or directory
My thought was to delete the created folders and then redo everything.
I attach the manual I got with my display. The display is recognized correctly.
Maybe you can help me.
Under the normal Raspian it worked.
Here are the instructions:
For the display of shapes, text and images we will use a Pythonlibrary
to use. On the current Raspberry Pi OS Python3, pip3
and git are already preinstalled, but if this is not the case, you can
you can install it with the following commands:
sudo apt-get install python3-dev libffi-dev libssl-dev
python3-pil libjpeg-dev zlib1g-dev libfreetype6-dev
liblcms2-dev libopenjp2-7 libtiff5 -y
sudo apt-get install python3-rpi.gpio python3-pip -y
sudo apt-get install git -y
As library we use the “luma.oled” this can be installed with the following
command to install it:
sudo -H pip3 install luma.oled
In the folder “pi” we now create a folder named “oled” and
go to this folder
sudo mkdir oled
luma.oled offers many examples and we can download them with the following
command to download them:
sudo git clone https://github.com/rm-hull/luma.examples
we change to the folder where the examples are located.
we can start one of the examples. If there is a white noise on the display
white noise on the display, we have to pass the correct controller.
this can be done with:
python3 demo.py --device [controller]
luma.oled takes the SSD1306 by default, if you have for example
SH1106 the start of the script would look like this:
python3 demo.py --device ssh1106
There are more examples in the folder.
With the command:
you can see them.
Try more examples.
sudo nano [example script]
you can edit the scripts.