18:46
Sorry if this is in the wrong play.
I am looking to add a small LCD character display connected to the GPIO pins to display "now playing" information.
Anyone got any ideas how i might go about this?
12:00
Hi Mattbed,
I was thinking about the same and got accros this litte one here: http://learn.adafruit.com/char…..em-monitor which works with usb? Would also be nice because Michelangelo (the developer of raspyfi) thinks about using the gpio for connecting a dac in the future.
Du you have any ideas about the programming of the display?
Cheers,
Tim
10:21
You can use any HD44780 compatible lcd; one example is http://andypi.co.uk/. His instructions are usable for any similar HD44780 lcd.
You then need to install lcdproc and mpdlcd (and maybe some other stuff, I can't remember), run mpdlcd and start playing music (edit: you also have to configure lcdproc – andypi has nice example of his configuration.
The result looks something like this:
Of course a big-ass VFD would be far better, something like a Noritake-Itron CU20045-UW5J (which is HD44780 compatible). The problem is that it costs ~38€ in the US and ~100€ from the Noritake distributor in Italy (and the US company won't sell directly to Europe, obviously).
15:33
andrejg said
You can use any HD44780 compatible lcd; one example is http://andypi.co.uk/. His instructions are usable for any similar HD44780 lcd.
You then need to install lcdproc and mpdlcd (and maybe some other stuff, I can't remember), run mpdlcd and start playing music (edit: you also have to configure lcdproc – andypi has nice example of his configuration.
The result looks something like this:
Of course a big-ass VFD would be far better, something like a Noritake-Itron CU20045-UW5J (which is HD44780 compatible). The problem is that it costs ~38€ in the US and ~100€ from the Noritake distributor in Italy (and the US company won't sell directly to Europe, obviously).
Hi Andrejg…
It's AndyPi here! I've just been asked by a potential customer about using my LCDs with Raspyfi – I've never come accross this distribution until today – does the picture show my LCD working with RaspyFI? I'd be interested to know if you had to do any additional steps – how different is RaspyFI to RASPBMC? Will it interface with LCD proc? Any info appreciated!
Thanks
Andy
Hello Andy,
I used your setup on the raspyFi beta version and it works great. But now on the 1.0 version it does not function.
Maybe I could paste my way of using your code.
The wiring is the same you used for XMBC. This is very good to swap between XBMC and RaspyFi by only swap the SD-card.
Here is what I did:
sudo apt-get update
sudo apt-get install lcdproc python-mpd python-pip
mkdir mpdlcd
cd mpdlcd/
wget https://pypi.python.org/packages/source/m/mpdlcd/mpdlcd-0.3.1.tar.gz#md5=e2f642b5aced3339a06bc3601a4a03bf
tar -xzf mpdlcd-0.3.1.tar.gz (Archiv entpacken)
cd mpdlcd-0.3.1/
sudo pip install mpdlcd
sudo pip install lcdproc
sudo reboot
sudo /etc/init.d/LCDd start
sudo update-rc.d LCDd defaults
cd
cd mpdlcd/mpdlcd-0.3.1/
sudo cp mpdlcd.conf /etc/mpdlcd.conf
sudo wget http://andypi.co.uk/downloads/LCDd.conf
cp /etc/LCDd.conf /etc/LCDd.old
rm /etc/LCDd.conf
cd
sudo cp /mpdlcd/mpdlcd-0.3.1/LCDd.conf /etc/LCDd.conf
mpdlcd
As I wrote in the beta it works at this point.
In the actually 1.0 version I get some errors at sudo pip install (something about --upgrade …. Maybe you could help to fix it)
[email protected]:~$ mpdlcd
Traceback (most recent call last):
File "/usr/local/bin/mpdlcd", line 10, in
cli.main(sys.argv)
File "/usr/local/lib/python2.7/dist-packages/mpdlcd/cli.py", line 465, in main
'logfile', 'loglevel', 'debug'))
File "/usr/local/lib/python2.7/dist-packages/mpdlcd/cli.py", line 360, in _setup_logging
handler = logging_handlers.SysLogHandler(address, facility=syslog_facility)
File "/usr/lib/python2.7/logging/handlers.py", line 758, in __init__
self._connect_unixsocket(address)
File "/usr/lib/python2.7/logging/handlers.py", line 775, in _connect_unixsocket
self.socket.connect(address)
File "/usr/lib/python2.7/socket.py", line 224, in meth
return getattr(self._sock,name)(*args)
socket.error: [Errno 2] No such file or directory
Hi,
Regarding to your log, the error comes because mpdlcd is not able to open the logfile which seems normal because log files have been disabled on v1.0 release.
You might just have to enable it back.
02:31
Hey everyone,
I've written a tutorial now to get the LCD's up and running. The fix was pretty straightforward to get mpdlcd working without logging… see here:
http://andypi.co.uk/?p=334
Andy
16:36
Hi,
thank you for updating your guide. I tried it, but it won't work. I have a very strange behavior. The Pi boots up, but i can only access it via ssh. Neither the webinterface nor the smartphone app are able to connect.
The nginx and mpd daemons are running. And there seem to be no errors in the logs. At least in the logs that i've checked.
I could really use some guidance here.
Greetings
10:16
I followed your very helpful guide Andy and managed to get it working. Thank you for this.Did have one very strange thing happening though. I added the sudo mpdlcd --no-syslog & line to the rc.local file and saved it and checked it was there. But on rebooting the line disappears from rc.local every time and the LCD shows an error! Only way to fix this is to SSH into the Pi and then run sudo mpdlcd --no-syslog & from the command line. It then works fine – any idea how to stop rc.local removing the line at reboot? Also it took me a while to realize from your guide that sudo mpdlcd –no-syslog & really should be sudo mpdlcd --no-syslog & (ie need double dash -- and not a single – ) shown in your guide.
One other question – is it possible to display the radio station name? When streaming, the top line of the display (which is set for artist) shows while the bottom line shows the artist and song.
Many thanks
Chris
If have some troubles to getting the LCD working corect. I have a 40 x 2 display and i have the LCDproc working. The only thing is that when i start the mpdlcd the i get the following error:
————————————————————————————————————————-
[email protected]:~$ sudo mpdlcd --no-syslog &
[1] 2720
[email protected]:~$ INFO mpdlcd.lcdrunner LCD screen is 40x2
INFO mpdlcd.lcdrunner MPD screen added to lcdproc.
INFO mpdlcd.mpdwrapper Connecting to MPD server at localhost:6600
INFO mpd Calling MPD connect('localhost', 6600, timeout=None)
INFO mpdlcd.lcdrunner Starting update loop.
ERROR mpdlcd.lcdrunner Found exception coercing to Unicode: need string or buffer, list found, exiting.
Traceback (most recent call last):
File "/usr/local/lib/python2.7/dist-packages/mpdlcd/lcdrunner.py", line 89, in run
self.update()
File "/usr/local/lib/python2.7/dist-packages/mpdlcd/utils.py", line 64, in decorated
return fun(instance, *args, **kwargs)
File "/usr/local/lib/python2.7/dist-packages/mpdlcd/lcdrunner.py", line 77, in update
updated, new_data = hook.handle(self.client, subhooks)
File "/usr/local/lib/python2.7/dist-packages/mpdlcd/mpdhooks.py", line 77, in handle
new_data = self.fetch(client)
File "/usr/local/lib/python2.7/dist-packages/mpdlcd/mpdhooks.py", line 130, in fetch
return client.current_song
File "/usr/local/lib/python2.7/dist-packages/mpdlcd/utils.py", line 64, in decorated
return fun(instance, *args, **kwargs)
File "/usr/local/lib/python2.7/dist-packages/mpdlcd/mpdwrapper.py", line 112, in current_song
song_tags = self._decode_dict(self._client.currentsong())
File "/usr/local/lib/python2.7/dist-packages/mpdlcd/mpdwrapper.py", line 43, in _decode_dict
(k, self._decode_text(v)) for k, v in data.items())
File "/usr/local/lib/python2.7/dist-packages/mpdlcd/mpdwrapper.py", line 43, in
(k, self._decode_text(v)) for k, v in data.items())
File "/usr/local/lib/python2.7/dist-packages/mpdlcd/mpdwrapper.py", line 39, in _decode_text
return unicode(text, 'utf8')
TypeError: coercing to Unicode: need string or buffer, list found
————————————————————————————————————————————————————--
Could use some guidance here
After I encounter a corrupted SD card i reinstalled the raspyfi image and installed everything. Now it is working!
chrisr said
I followed your very helpful guide Andy and managed to get it working. Thank you for this.Did have one very strange thing happening though. I added the sudo mpdlcd --no-syslog & line to the rc.local file and saved it and checked it was there. But on rebooting the line disappears from rc.local every time and the LCD shows an error! Only way to fix this is to SSH into the Pi and then run sudo mpdlcd --no-syslog & from the command line. It then works fine – any idea how to stop rc.local removing the line at reboot? Also it took me a while to realize from your guide that sudo mpdlcd –no-syslog & really should be sudo mpdlcd --no-syslog & (ie need double dash -- and not a single – ) shown in your guide.
Chris
I had the same problem. You have to be SU before edit RC.LOCAL
Leopoldo
Hi everyone,
If you have an Adafruit 16x2 Char LCD Plate for your Pi I have written a tutorial how to use it with RaspyFi. It is basically a Python script with the following features:
* Presentation of play mode (playing/paused/stopped), Artist and Song name scrolling on line 1
* The elapsed song time, total song time and percentage of song played on line 2.
* Left button: Skip back
* Right button: Skip forward
* Up button: Play
* Down button: Stop
* Select button: Toggle Play/Pause
You can find the source code and a video of the display in action on: http://didtheypush.blogspot.se…..plate.html
-R.U.Sirius
00:22
R.U.Sirius said
Hi everyone,
If you have an Adafruit 16x2 Char LCD Plate for your Pi I have written a tutorial how to use it with RaspyFi. It is basically a Python script with the following features:
* Presentation of play mode (playing/paused/stopped), Artist and Song name scrolling on line 1
* The elapsed song time, total song time and percentage of song played on line 2.
* Left button: Skip back
* Right button: Skip forward
* Up button: Play
* Down button: Stop
* Select button: Toggle Play/Pause
You can find the source code and a video of the display in action on: http://didtheypush.blogspot.se…..plate.html
-R.U.Sirius
Excellent! Thanks for the info, I might have a go at that at some point when I get some time, maybe over christmas. I notice that us UK folks can get the LCD display + all the tools required from pimoroni (e.g. http://shop.pimoroni.com/produ…..spberry-pi)
The only trouble is that I haven't used a soldering iron in a very long time… and the last time I tried to do something serious with one (maybe 20 years ago?) an electrical engineer took pity on me and re-soldered the mess that I had made. Still, how hard can it be, right?
Cheers,
Karli
13:03
R.U.Sirius said
Hi everyone,
If you have an Adafruit 16x2 Char LCD Plate for your Pi I have written a tutorial how to use it with RaspyFi. It is basically a Python script with the following features:
* Presentation of play mode (playing/paused/stopped), Artist and Song name scrolling on line 1
* The elapsed song time, total song time and percentage of song played on line 2.
* Left button: Skip back
* Right button: Skip forward
* Up button: Play
* Down button: Stop
* Select button: Toggle Play/Pause
You can find the source code and a video of the display in action on: http://didtheypush.blogspot.se…..plate.html
-R.U.Sirius
Hi. I tried your code, but i got a line 5 error. Thanks by your efforts.
20:50
celeo said
chrisr said
I followed your very helpful guide Andy and managed to get it working. Thank you for this.Did have one very strange thing happening though. I added the sudo mpdlcd --no-syslog & line to the rc.local file and saved it and checked it was there. But on rebooting the line disappears from rc.local every time and the LCD shows an error! Only way to fix this is to SSH into the Pi and then run sudo mpdlcd --no-syslog & from the command line. It then works fine – any idea how to stop rc.local removing the line at reboot? Also it took me a while to realize from your guide that sudo mpdlcd –no-syslog & really should be sudo mpdlcd --no-syslog & (ie need double dash -- and not a single – ) shown in your guide.
ChrisI had the same problem. You have to be SU before edit RC.LOCAL
Leopoldo
Many thanks for your comment Leopoldo. I logged in as SU and tried this, but on reboot the rc.local still lost the line. Would you please be kind enough to post your rc.local file so I can see if I am doing something daft. Was there anything else you had to change to get the modified file to stay modified?
Many thanks, Chris
stotomas said
R.U.Sirius said
Hi everyone,
If you have an Adafruit 16x2 Char LCD Plate for your Pi I have written a tutorial how to use it with RaspyFi. It is basically a Python script with the following features:
* Presentation of play mode (playing/paused/stopped), Artist and Song name scrolling on line 1
* The elapsed song time, total song time and percentage of song played on line 2.
* Left button: Skip back
* Right button: Skip forward
* Up button: Play
* Down button: Stop
* Select button: Toggle Play/Pause
You can find the source code and a video of the display in action on: http://didtheypush.blogspot.se…..plate.html
-R.U.SiriusHi. I tried your code, but i got a line 5 error. Thanks by your efforts.
I found the problem, if you just select the code on the blog and paste it in an textfile the indentation will be messed up. This is caused by the java-script that embeds source-code on blogger-pages (I autogenerated that part at another webpage where I just pasted my code). I have manually fixed the code on the page, i.e. removed one white-space in the beginning of each row.
Try to copy the code from the blog again and it will hopefully work.
Don't forget to put the showSongInfo.py file with the code in /home/pi/Adafruit-Raspberry-Pi-Python-Code/Adafruit_CharLCDPlate/ (or wherever you installed the Adafruit libs), otherwise the import of Adafruit_CharLCDPlate will not work.
Thank you for pointing out the problem.
-R.U.Sirius
Chrisr said
celeo said
chrisr said
I followed your very helpful guide Andy and managed to get it working. Thank you for this.Did have one very strange thing happening though. I added the sudo mpdlcd --no-syslog & line to the rc.local file and saved it and checked it was there. But on rebooting the line disappears from rc.local every time and the LCD shows an error! Only way to fix this is to SSH into the Pi and then run sudo mpdlcd --no-syslog & from the command line. It then works fine – any idea how to stop rc.local removing the line at reboot? Also it took me a while to realize from your guide that sudo mpdlcd –no-syslog & really should be sudo mpdlcd --no-syslog & (ie need double dash -- and not a single – ) shown in your guide.
ChrisI had the same problem. You have to be SU before edit RC.LOCAL
LeopoldoMany thanks for your comment Leopoldo. I logged in as SU and tried this, but on reboot the rc.local still lost the line. Would you please be kind enough to post your rc.local file so I can see if I am doing something daft. Was there anything else you had to change to get the modified file to stay modified?
Many thanks, Chris
You're right, the RC. LOCAL does not work well. If you do shutodown in the command console is cleared.
The command remains if you turn off the power supply.
So I found another way. You must edit the filebootmisc.sh in / etc / init.d, get to the bottom and after: write a new line like this:
su pi -c "mpdlcd &"
where pi is the user, and the command is in quotes, the debug option is no longer needed.
The only limitation is if you restart MPD, because, of course, the connection between LCDMPD and MPD is broken.
When the raspberry restart everything works again
Leopoldo
Most of the System settings are reset on boot have a look in /var/www/_OS_SETTINGS/etc. In here you will find rc.local. Have a look at the github: https://github.com/Tsunamp/RaspyFi/tree/master/_OS_SETTINGS/etc
Most Users Ever Online: 200
Currently Online:
7 Guest(s)
Currently Browsing this Page:
1 Guest(s)
Top Posters:
Gyp: 82
yoghurtlidlicker: 37
PaulM: 36
icai: 35
Derek: 29
Karsten: 27
tc-fi: 22
Ronaldo: 21
ENSen: 21
chriz: 20
Member Stats:
Guest Posters: 3619
Members: 569
Moderators: 0
Admins: 1
Forum Stats:
Groups: 4
Forums: 10
Topics: 469
Posts: 13163
Newest Members: polo2016, dongdong8, wlpwlp, Sager, ninestab123, lmx66, lmx, jlgg, chenyan, guoyanying
Administrators: admin (401)