Thank you for your donation!


Cloudsmith graciously provides open-source package management and distribution for our project.


Instruction Guide 2 times i2c oled display
#1
This is prompted from a request here... Smile
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
Install the RPI.GPIO library
Code:
sudo pip install RPi.GPIO
Install the Python Imaging Library (Note- replaced by python-pil) and smbus library
Code:
sudo apt-get install python-pil python-smbus
Install git
Code:
sudo apt-get install git
Clone the Adafruit SSD1306 python library
Code:
git clone https://github.com/adafruit/Adafruit_Python_SSD1306.git
Go to the cloned repository
Code:
cd Adafruit_Python_SSD1306


and execute ...

Code:
sudo python setup.py install
reboot!!




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
and modify this line to show the i2c address of the 2nd oled
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
and

Code:
sudo python stats.py
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..
Code:
cd Pi_stats_OLED
give permissions to execute.

Code:
chmod 755 launcher.sh
Then edit  rc.local



Code:
sudo nano /etc/rc.local

and add this line just before 'exit 0'


Code:
/home/pi/Pi_stats_OLED/launcher.sh &
save and restart.


Attached Files Thumbnail(s)
   
----------
bob
Reply
#2
Thumbs Up 
THANK YOU@DRONE7

Looking forward for more mods like this with moode.
Reply
#3
Is that "her majesty" I see in the background?
----------------
Robert
Reply
#4
(02-08-2021, 04:05 PM)the_bertrum Wrote: Is that "her majesty" I see in the background?

She's a pretty nice girl!
Reply
#5
I'm stunned and amazed that such a partial fuzzy glimpse of Liz is recognised by the_bertrum.... yes, quite correct...she was possibly even waving ;-)
----------
bob
Reply
#6
Something about the way she was holding her bag...
----------------
Robert
Reply


Forum Jump: