Help with pydPiper please

I’ve been fighting a 20x4 LCD & pydPiper of 3 weeks now

  • Finally worked out than when a pin is mentioned, it’s referring to the BCW Pin, NOT the pin on the 40 pin header - so that’s up and running

  • When using the excellent pydPiper addon there are several copies of the pages_lcd_20x4.py file, if your editing the wrong one it has no effect - who’d have thought that?

So I have nearly got the display working as I want with 2 exceptions

  1. Can someone tell me how to extract the “date” variable as I’d like this displayed adjacent to the album name

  2. I would like the file type (MP2, FLAC, APE etc) displayed on the bottom right of the 4th line, but all I can seem to get is “FLAC Stereo” etc

Thank you in advance

Andrew

Hi Andrew,

What informations pydPiper collect you can see in the file pydPiper\sources\musicdata_volumio2.py
in line 128 for example you can see

….
self.musicdata[u’artist’] = status[u’artist’] if u’artist’ in status else u""
self.musicdata[u’title’] = status[u’title’] if u’title’ in status else u""
self.musicdata[u’uri’] = status[u’uri’] if u’uri’ in status else u""
self.musicdata[u’bitdepth’] = status[u’bitdepth’] if u’bitdepth’ in status else u""
self.musicdata[u’tracktype’] = status[u’trackType’] if u’trackType’ in status else u""
self.musicdata[u’samplerate’] = status[u’samplerate’] if u’samplerate’ in status else u""
self.musicdata[u’bitrate’] = status[u’bitrate’] if u’bitrate’ in status else u""

to look, how the information will loo like, you can use
http://volumio.local/api/v1/getState

to display the informations you have to modify the pages_lcd_20x4.py file

1st in the Widget section, for example:

WIDGETS = {
….
‘samplerate’: { ‘type’:‘text’, ‘format’:’{0}’, ‘variables’:[‘samplerate’], ‘font’:‘small’, ‘just’:‘center’,‘varwidth’:True},
‘bitdepth’: { ‘type’:‘text’, ‘format’:’{0}’, ‘variables’:[‘bitdepth’], ‘font’:‘small’, ‘just’:‘center’,‘varwidth’:True},
‘stream’: { ‘type’:‘text’, ‘format’:’{0}’, ‘variables’:[‘stream’], ‘font’:‘small’, ‘just’:‘left’,‘varwidth’:True},
‘bitrate’: { ‘type’:‘text’, ‘format’:’{0}’, ‘variables’:[‘bitrate’], ‘font’:‘small’, ‘just’:‘left’,‘varwidth’:True},
….
}

2nd you have to modify the Canvases section, for example (this example is to a 16x2 display) :

CANVASES = {
….
‘playartist_flac’: { ‘widgets’: [ (‘artist’,0,8), (‘samplerate’,0,0), (‘bitdepth’,50,0) ], ‘size’:(80,16) },
‘playalbum_flac’: { ‘widgets’: [ (‘album’,0,8), (‘samplerate’,0,0), (‘bitdepth’,50,0) ], ‘size’:(80,16) },
‘playtitle_flac’: { ‘widgets’: [ (‘title’,0,8), (‘samplerate’,0,0), (‘bitdepth’,50,0) ], ‘size’:(80,16) },
‘playartist_radio’: { ‘widgets’: [ (‘artist’,0,8), (‘nowplaying’,40,0), (‘bitrate’,0,0) ], ‘size’:(80,16) },
‘playalbum_radio’: { ‘widgets’: [ (‘album’,0,8), (‘nowplaying’,40,0), (‘bitrate’,0,0) ], ‘size’:(80,16) },
‘playtitle_radio’: { ‘widgets’: [ (‘title’,0,8), (‘nowplaying’,40,0), (‘bitrate’,0,0) ], ‘size’:(80,16) },

}

3rd you have to modify the Sequences section, here you can configure different informations depending what format is playing (eg. Webradio, …)

SEQUENCES = [
{ ‘name’: ‘seqSplash’, ‘canvases’: [ { ‘name’:‘splash’, ‘duration’:4 } ], ‘conditional’:“db[‘state’]==‘starting’” },
{
‘name’: ‘seqPlay’,
‘canvases’: [
{ ‘name’:‘playartist’, ‘duration’:8, ‘conditional’:“not db[‘stream’]==‘webradio’ and not db[‘stream’]==‘flac’” },
{ ‘name’:‘playalbum’, ‘duration’:8, ‘conditional’:“not db[‘stream’]==‘webradio’ and not db[‘stream’]==‘flac’” },
{ ‘name’:‘playtitle’, ‘duration’:8, ‘conditional’:“not db[‘stream’]==‘webradio’ and not db[‘stream’]==‘flac’” },
{ ‘name’:‘playartist_flac’, ‘duration’:8, ‘conditional’:“db[‘stream’]==‘flac’” },
{ ‘name’:‘playalbum_flac’, ‘duration’:8, ‘conditional’:“db[‘stream’]==‘flac’” },
{ ‘name’:‘playtitle_flac’, ‘duration’:8, ‘conditional’:“db[‘stream’]==‘flac’” },
{ ‘name’:‘playartist_radio’, ‘duration’:8, ‘conditional’:“db[‘stream’]==‘webradio’” },
{ ‘name’:‘playalbum_radio’, ‘duration’:8, ‘conditional’:“db[‘stream’]==‘webradio’ and db[‘album’]” },
{ ‘name’:‘playtitle_radio’, ‘duration’:8, ‘conditional’:“db[‘stream’]==‘webradio’” },
],
‘conditional’: “db[‘state’]==‘play’”
},
….

Jens

Jens,

Thanks for the quick reply, I hadn’t found that resource, so will take a look later.

I’d already figured out the mods to the canvases & sequences

Regards

Andrew