More > JRiver Media Center 27 for Linux
Quick Start Guide for Installing an OLED display on rPi reading track info
(1/1)
Wheaten:
Install Raspberry PI OS (32 bit)
The installation is valid for the rPi4, installing on previous version haven’t been tested by me.
As always, I start with a clean install.
Pay attention. The installation script will default python to V3. If you don’t want this or relying on V2, don’t continue.
It’s just a very basic script displaying track data, feel free to modify to your needs. I am sure code could be more efficient (especially the attribute reading), but I am not a python programmer. (and def. not looking to master a 7th programming language :P)
I’ve assumed that you have JRiver running, with the media network enabled and protected with a password. If you don’t use a password, you need to modify the function. See scroll.py below. The script comes as is.
When Artist/track or album exceeds 16 chars, the lines will scroll.
Perform the needed setups:
- Enable wait for boot till network is available:
--- Code: ---sudo raspi-config
--- End code ---
--- Code: ---sudo apt-get update && sudo apt-get upgrade
--- End code ---
Add baudrate to boot config
--- Code: ---sudo echo "dtparam=i2c_arm_baudrate=800000" >> /boot/config.txt
--- End code ---
To setup JRiver on the rPi, read my other topic.
Setup drivers etc
I am not writing everything down, there are some good instructions that will setup all required libraries. Follow the instructions on:
Step 1:
Step 2:
Shut down your Pi and connect the display:
--- Code: ---sudo shutdown
--- End code ---
Connect display
Pi display
Pin3 (SDA) SDA
Pin1 (5V) VCC
Pin5 (SCL) SCL
Pin14 (GND) GND
Boot the Pi
Create a new directory in your home folder
--- Code: ---cd ~/
mkdir oled && cd oled
unzip OLED_V1.1.0.zip
--- End code ---
or
--- Code: ---unzip OLED_V1.1.0.zip
--- End code ---
Make the script executable
--- Code: ---Chmod a+X scroll.py
--- End code ---
There are only a few setting to review, I’ve listen then below.
--- Code: ---nano scroll.py
--- End code ---
--- Code: ---#Modify the url to your JRiver instance
sURL = 'http://xxx.xxx.xxx.xxx:52199/MCWS/v1/Playback/Info?Zone=-1'
#If you set the authentication in th emedia network, add the details below.
#If not modify function geturl(url), for the proper call
sUsername = 'username'
sPassword = 'password'
debug = 0
#Set the demensions of your OLED
WIDTH = 128
HEIGHT = 64
#Here you can rotate your display when needed, 0=0deg, 1=90deg, 2=180deg, 3=270deg
disp.rotation=2
def geturl(url):
#If you need credetials to access the media network use this line
r = requests.get(url, auth=(sUsername, sPassword))
#If you don't need credentials, use this line
#r = requests.get(url)
--- End code ---
Check if the script will run:
--- Code: ---python scroll.py
--- End code ---
If all went ok the screen should work.
Add script to startup of the Pi:
--- Code: ---sudo nano /etc/rc.local
--- End code ---
Add the following line BEFORE exit 0
--- Code: ---sudo python3 /home/pi/oled/scroll.py &
--- End code ---
Save with CTRL + o, ENTER, CTRL + x
Test if the script will work on reboot. Start JRiver and select a random song.
Go back to the terminal:
--- Code: ---cd /etc
sudo ./rc.local
--- End code ---
If all goes well, you see something like this:
Have fun
Change log: OLED_V1.1.0:
* When Status = 'Buffering...', 'Opening...', 'Waiting' or 'Aborting, Please wait' Show hourglass instead of JRiver logo
* With long text, only scroll that line instead of all three lines (Artist, track and Album)
Wheaten:
Change log: OLED_V1.1.0:
* When Status = 'Buffering...', 'Opening...', 'Waiting' or 'Aborting, Please wait' Show hourglass instead of JRiver logo
* With long text, only scroll that line instead of all three lines (Artist, track and Album)
Navigation
[0] Message Index
Go to full version