02-06-2021, 06:45 AM
(This post was last modified: 07-11-2021, 08:46 PM by DRONE7.
Edit Reason: updated link
)
This is prompted from a request here...
http://moodeaudio.org/forum/showthread.p...3#pid29933
Two oled displays...different i2c address by changing the solder bridge on one....Google that for a how-to.
Use them paralleled and with the Pi 5-volt dropped to their required 3.3-volt with a cheap Ams1117.
https://www.ebay.co.uk/itm/AMS1117-LDO-D...SwsaxfppOP
Set up the first oled as per Adrian's superb MoOde instructions...
https://github.com/antiprism/mpd_oled/bl...de7_deb.md
Use the default un-modified i2c address (probably 3c) for the mpd.oled file
and once you have that confirmed running and a second oled (with the bridge) now showing it as 3d connected then install this version (stats.py) (from the original here, modified for MoOde... David-Ka / Pi_stats_OLED)
Instruction...
Connect to your Pi via SSH
(Most of the dependencies are already present in MoOde 7.01 and will say that you have the most up to date version already but no problem to try and check)
---
Install some dependencies for the library
Install the RPI.GPIO library
Install the Python Imaging Library (Note- replaced by python-pil) and smbus library
Install git
Clone the Adafruit SSD1306 python library
Go to the cloned repository
and execute ...
reboot!!
Connect to your Pi via SSH
Clone this repository.
check the i2c address of your oleds (the un-modified would be usually default 3c and the modified 3d
(Booting and checking with only one at a time oled connected would give the information needed.)
example of both i2c oleds connected..
then..
and run..
and modify this line to show the i2c address of the 2nd oled
save and reboot.
Connect to your Pi via SSH
then..
and
should produce useful output as shown in the attached image. (Ctrl+c to halt)
If all is well and both displays work then to add the second oled to run at boot..
give permissions to execute.
Then edit rc.local
and add this line just before 'exit 0'
save and restart.
http://moodeaudio.org/forum/showthread.p...3#pid29933
Two oled displays...different i2c address by changing the solder bridge on one....Google that for a how-to.
Use them paralleled and with the Pi 5-volt dropped to their required 3.3-volt with a cheap Ams1117.
https://www.ebay.co.uk/itm/AMS1117-LDO-D...SwsaxfppOP
Set up the first oled as per Adrian's superb MoOde instructions...
https://github.com/antiprism/mpd_oled/bl...de7_deb.md
Use the default un-modified i2c address (probably 3c) for the mpd.oled file
Code:
mpd_oled -o 6 -a 3c -b 10 -g 1 -f 20
and once you have that confirmed running and a second oled (with the bridge) now showing it as 3d connected then install this version (stats.py) (from the original here, modified for MoOde... David-Ka / Pi_stats_OLED)
Instruction...
Connect to your Pi via SSH
(Most of the dependencies are already present in MoOde 7.01 and will say that you have the most up to date version already but no problem to try and check)
---
Install some dependencies for the library
Code:
sudo apt-get install build-essential python-dev python-pip
Code:
sudo pip install RPi.GPIO
Code:
sudo apt-get install python-pil python-smbus
Code:
sudo apt-get install git
Code:
git clone https://github.com/adafruit/Adafruit_Python_SSD1306.git
Code:
cd Adafruit_Python_SSD1306
and execute ...
Code:
sudo python setup.py install
Connect to your Pi via SSH
Clone this repository.
Code:
git clone https://github.com/David-Ka/Pi_stats_OLED
check the i2c address of your oleds (the un-modified would be usually default 3c and the modified 3d
(Booting and checking with only one at a time oled connected would give the information needed.)
example of both i2c oleds connected..
Code:
pi@moode:~ $ sudo i2cdetect -y 1
0 1 2 3 4 5 6 7 8 9 a b c d e f
00: -- -- -- -- -- -- -- -- -- -- -- -- --
10: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
20: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
30: -- -- -- -- -- -- -- -- -- -- -- -- 3c 3d -- --
40: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
50: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
60: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
70: -- -- -- -- -- -- -- --
then..
Code:
cd Pi_stats_OLED
and run..
Code:
sudo nano stats.py
Code:
# 128x64 display with hardware I2C:
disp = Adafruit_SSD1306.SSD1306_128_64(rst=RST, i2c_address=0x3d)
save and reboot.
Connect to your Pi via SSH
then..
Code:
cd Pi_stats_OLED
Code:
sudo python stats.py
If all is well and both displays work then to add the second oled to run at boot..
Code:
cd Pi_stats_OLED
Code:
chmod 755 launcher.sh
Code:
sudo nano /etc/rc.local
and add this line just before 'exit 0'
Code:
/home/pi/Pi_stats_OLED/launcher.sh &
----------
bob
bob