Open mecaz opened 8 years ago
Probably you use Python 2.x. The project is written in Python 3 however.
If you don't want to dive deep into the code and rewrite the Python 3 parts, I would suggest you make sure you have Python 3 installed and try
python3 main.py
If you use the latest Raspbian, no sudo is needed.
Hope that helps!
Hello.
I got following smbus error. I tried to install that on volumio but couldnt make.
sudo python3 main.py
Traceback (most recent call last):
File "main.py", line 6, in
My only goal is make a mpd player has 20x4 irc lcd screen. please help it work. my tested my screen with this: http://www.recantha.co.uk/blog/?p=4849 and it work well.
Regards
Have you installed the package python3-smbus?
I solved smbus problem but stuck at mpd module.
sudo python3 main.py
Traceback (most recent call last):
File "main.py", line 7, in
I cant install mpd module because of following error.
pip install mpd Downloading/unpacking mpd Could not find any downloads that satisfy the requirement mpd Cleaning up... No distributions at all found for mpd Storing debug log for failure in /home/pi/.pip/pip.log
No problem. You just need to install this project https://github.com/Mic92/python-mpd2. But again you need to use the Python 3 pendant of pip: pip3. When you have the package python3-pip installed
sudo pip3 install python-mpd2
should do the job.
Thanks for your big help. I finally got worked my screen with mpd. I also edited main.py and make album name and artist name shown. Everything fine but some special characters.
Appreciated for your great care speendo. Regards
I'm glad that it worked.
The main.py as well as line_controller.py are not originally intended to work out of the box for every use case. I designed it to work with a web radio. If you want something else you will have to adapt the code for your needs.
But don't worry - this won't be very difficult and I will be there to help you.
If this is alright for you, I will close this issue now.
Oh, and you can adapt the special characters by creating your own local class (just take the other local files as a model).
If you make one, I can add it to my project.
ok. i will work on it. and one last question. at time string. counting time on right side dont start over when song changes. it count to infinitive. is it normal? or is it suppose to show track status?
Yes, for my usecase this is fine. I want to count the time since the radio was switched on.
Maybe this could be changed for your purpose...
I find lines to edit. but cant find proper code to show current playing song time
def update_time(self): self.clear_text()
self.set_text_left(self.time.strftime('%H:%M:%S'))
self.set_text_right(self.time.strftime("%H:%M:%S", self.time.gmtime(self.time.time() - self.start_time)))
I should adapt that lines. am i right?
That's right.
However I don't know where you can get the playing time of the song - is this something mpd "knows"? Then you could probably get it from the MPDClient
yes it is something about mpd. i want to see elapsed time of track or the rest of it. Probably MPDClient provides that info but i dont know how to get it. sorry.
you could leave the lcd for a moment and play around with the MPDClient.
go to python
# python3
and enter
from mpd import MPDClient
client = MPDClient()
client.timeout = 10
client.connect("localhost", 6600)
client.currentsong()
This should get you a step forward.
more information can be found here: http://pythonhosted.org/python-mpd2/topics/commands.html
I got following error please help. And couldnt make it work never.
sudo python main.py Traceback (most recent call last): File "main.py", line 7, in
from LineController import *
File "/home/pi/raspi-mpd-lcd/LineController.py", line 219, in
class FetchLine(TextLine):
File "/home/pi/raspi-mpd-lcd/LineController.py", line 220, in FetchLine
from urllib import request
ImportError: cannot import name request