dhrone / pydPiper

A general purpose program to display song metadata on LCD and OLED devices
MIT License
78 stars 36 forks source link

Re1.x install (RuneAudio 0.5 Rern editon) #73

Open Alien8ions opened 4 years ago

Alien8ions commented 4 years ago

Hi

I just like to inform anyone interested : the latest versions of RuneAudio (Rern's images) no longer make use of the redis server for sending status messages so the 'normal' Rune0.5 install script is no longer working Additionally I personally chose to go back to the dockerized version for now

That means a couple of changes have to be made. I'll try to outline them so anyone can follow the steps

use pacman manager to install docker

pacman -Sy docker #

Run pydPiper configure script

python2 configure.py #

Place pydpiper.service file into systemd directory

cp pydpiper.service /usr/lib/systemd/system/ #

Enable and start the pydpiper service

systemctl daemon-reload systemctl enable pydpiper.service systemctl start pydpiper.service

echo "Wait a quite a few minutes on first load, docker pull needs to complete"


- modify the configure.py file to reflect the docker settings for the rune installation : 
line 373 and following should now be (take care of proper indentation)
elif config.get('SOURCE', 'source_type') == 'rune':
    serviceconfig.set('Unit', 'Requires', 'docker.service')
    serviceconfig.set('Unit', 'After', 'network.target')
    serviceconfig.set('Service', 'ExecStart', '/usr/bin/docker run --rm --network=host --privileged -v /var/log:/var/log:rw -v /root/pydPiper:/app:rw dhrone/pydpiper:v0.31-alpha python /app/pydPiper.py')

- The mpd can be used as a source for the status/song info, but an old oversight hasn't been changed so
change the file pydPiper/sources/musicdata_mpd.py lines 161 and following to (take care of proper indentation)
    if self.musicdata[u'uri'].split(u':')[0] == u'http':
        stream = u'webradio'
        encoding = u"webradio {0}".format(self.musicdata[u'bitrate'])
    elif self.musicdata[u'uri'].split(u':')[0] == u'https':
        stream = u'webradio'
        encoding = u"webradio {0}".format(self.musicdata[u'bitrate'])
    else:
        encoding = self.musicdata[u'uri'] 
        encoding = encoding[-4:].strip(u'.')
        stream = u'not_webradio'

    self.musicdata[u'encoding'] = encoding
    self.musicdata[u'stream'] = stream

(Yes I know, these changes are a bit more than strictly necessary) but for now, the 'stream' variable is used in all other 'sources' to differentiate between a webradio and a music file, this solves that issue, otherwise compatibility is compromised

- now you can run the abovementioned install script
it'll install the docker files, and run the pydpiper configuration script
now select mpd as the 'source' instead of rune, all other settings are the same for eg. volumio or older RuneAudio versions
As indicated, it'll take some time the first time you run the main script as the docker files need to download

I'll leave this issue open for a while as there seems no option to keep it 'visible' and the closed issues probably won't get noticed that easily (but for me obviously this 'issue' could be closed)
maybe dhrone could incorporate this into the main branch

I hope this can help fellow pydPiper users along
A8