LCD display and buttons in Python (tutorial and code)

Raspberry Pi related support

Re: LCD display and buttons in Python (tutorial and code)

Postby hondagx35 » 02 Oct 2016, 23:54

Hi mecaz,

please post your mpdlcd.service unit file.
The logs you have posted are not complete (lines are cut at the end)!

Frank
User avatar
hondagx35
 
Posts: 3042
Joined: 11 Sep 2014, 22:06
Location: Germany

Re: LCD display and buttons in Python (tutorial and code)

Postby mecaz » 03 Oct 2016, 19:08

hondagx35 wrote:Hi mecaz,

please post your mpdlcd.service unit file.
The logs you have posted are not complete (lines are cut at the end)!

Frank



My debug code: http://pastebin.com/mLxDscSZ



My journalctl: http://pastebin.com/x9ckRE2x
mecaz
 
Posts: 10
Joined: 11 Jan 2016, 19:38

Re: LCD display and buttons in Python (tutorial and code)

Postby hondagx35 » 03 Oct 2016, 21:49

Hi mecaz,

Code: Select all
Feb 22 15:40:18 runeaudio python2[204]: Traceback (most recent call last):
Feb 22 15:40:18 runeaudio python2[204]:   File "/root/RuneAudioLCD/start.py", line 108, in <module>
Feb 22 15:40:18 runeaudio python2[204]:     mpdcl = mpd_client.mpd_client(CON_ID, PASSWORD)
Feb 22 15:40:18 runeaudio python2[204]:   File "/root/RuneAudioLCD/mpd_client.py", line 13, in __init__
Feb 22 15:40:18 runeaudio python2[204]:     if (self.mpdConnect(self.client, con_id) == False):
Feb 22 15:40:18 runeaudio python2[204]:   File "/root/RuneAudioLCD/mpd_client.py", line 61, in mpdConnect
Feb 22 15:40:18 runeaudio python2[204]:     except SocketError:
Feb 22 15:40:18 runeaudio python2[204]: NameError: global name 'SocketError' is not defined
Feb 22 15:40:18 runeaudio systemd[1]: mpdlcd.service: Main process exited, code=exited, status=1/FAILURE
Feb 22 15:40:18 runeaudio systemd[1]: mpdlcd.service: Unit entered failed state.


AGAIN:
please post your mpdlcd.service unit file.

Frank
User avatar
hondagx35
 
Posts: 3042
Joined: 11 Sep 2014, 22:06
Location: Germany

Re: LCD display and buttons in Python (tutorial and code)

Postby mecaz » 04 Oct 2016, 18:51

hondagx35 wrote:Hi mecaz,

Code: Select all
Feb 22 15:40:18 runeaudio python2[204]: Traceback (most recent call last):
Feb 22 15:40:18 runeaudio python2[204]:   File "/root/RuneAudioLCD/start.py", line 108, in <module>
Feb 22 15:40:18 runeaudio python2[204]:     mpdcl = mpd_client.mpd_client(CON_ID, PASSWORD)
Feb 22 15:40:18 runeaudio python2[204]:   File "/root/RuneAudioLCD/mpd_client.py", line 13, in __init__
Feb 22 15:40:18 runeaudio python2[204]:     if (self.mpdConnect(self.client, con_id) == False):
Feb 22 15:40:18 runeaudio python2[204]:   File "/root/RuneAudioLCD/mpd_client.py", line 61, in mpdConnect
Feb 22 15:40:18 runeaudio python2[204]:     except SocketError:
Feb 22 15:40:18 runeaudio python2[204]: NameError: global name 'SocketError' is not defined
Feb 22 15:40:18 runeaudio systemd[1]: mpdlcd.service: Main process exited, code=exited, status=1/FAILURE
Feb 22 15:40:18 runeaudio systemd[1]: mpdlcd.service: Unit entered failed state.


AGAIN:
please post your mpdlcd.service unit file.

Frank


My mpdlcd unit file :

/usr/lib/systemd/system/mpdlcd.service

Code: Select all
[Unit]
Description=RuneAudio I2C LC-Display
After=mpd.service

[Service]
ExecStart=/usr/bin/python2 /root/RuneAudioLCD/start.py
TimeoutSec=0
Restart=always
RestartSec=1
StartLimitInterval=30
StartLimitBurst=20

[Install]
WantedBy=multi-user.target

mecaz
 
Posts: 10
Joined: 11 Jan 2016, 19:38

Re: LCD display and buttons in Python (tutorial and code)

Postby mecaz » 09 Oct 2016, 12:47

Hello,

I started over. flashed rune image again. and loaded RuneAudioLCD script.
I also edited mpdlcd.service unit file as "RestartSec=1" to "RestartSec=5" and now my lcd starts at boot.
I am using xbindkeys and airmouse to control mpd.

And want to ask that is there any command to change lcd display info.
I mean now my lcd shows Artist - Title, I saw at youtube they can change that to eplased time/total time or ip adres or system load..
how can i change displaying info? which command should i use?

Regards
mecaz
 
Posts: 10
Joined: 11 Jan 2016, 19:38

Re: LCD display and buttons in Python (tutorial and code)

Postby Cirrhosis » 17 Oct 2016, 14:40

XploD wrote:Sorry for my late response, I wasn't here on the forum for a while.

Cirrhosis wrote:Hello!
I have Raspberi Pi B rev.2 and 2B. Also, there is a simple display 16X2 and 16X2 bus i2c. I tried to do by steps as described XPLOD. But a lot of links does not work. Linux for me to complete darkness. Does anyone have a working image of what would be written on the SD, connect the display and that everything would work? Controls not necessary.
Sorry for the English. This is Google Translate.


If you still need it, PM me and I can send you my image for 2B. Or give you some help with additional steps. Which links doesn't work?


Hi.
Excuse me. I went for a long time.
I do not have the file usr / lib / python2.7 / site-packages / Adafruit_GPIO-0.9.3-py2.7.egg / Adafruit_GPIO / MCP230xx.py
What to do?
Cirrhosis
 
Posts: 4
Joined: 17 Mar 2016, 18:41

Re: LCD display and buttons in Python (tutorial and code)

Postby XploD » 05 Nov 2016, 22:46

Cirrhosis wrote:
XploD wrote:Sorry for my late response, I wasn't here on the forum for a while.

Cirrhosis wrote:Hello!
I have Raspberi Pi B rev.2 and 2B. Also, there is a simple display 16X2 and 16X2 bus i2c. I tried to do by steps as described XPLOD. But a lot of links does not work. Linux for me to complete darkness. Does anyone have a working image of what would be written on the SD, connect the display and that everything would work? Controls not necessary.
Sorry for the English. This is Google Translate.


If you still need it, PM me and I can send you my image for 2B. Or give you some help with additional steps. Which links doesn't work?


Hi.
Excuse me. I went for a long time.
I do not have the file usr / lib / python2.7 / site-packages / Adafruit_GPIO-0.9.3-py2.7.egg / Adafruit_GPIO / MCP230xx.py
What to do?


Did you pay attention on the versions of your Python and Adafruit? Try to go to /usr/lib and see which python version you have. Maybe you don't have python 2.7 directory but python 2.8 or some other instead. The same for Adafruit library.
Music taste: xplodmusic @ Last.fm
Audio source: Raspberry Pi 2 + Sabre ES9023 DAC + WD 500 GB HDD + TP-Link TL-WN722N Wi-Fi + D-LINK Dub H7 USB hub
Hi-Fi: Phillips DCD-7010
Mixer: Nady Audio MM-242
Misc: Tube Stereo Vumeter (Magic Eye)
User avatar
XploD
 
Posts: 77
Joined: 24 Mar 2015, 18:32
Location: Croatia

Re: LCD display and buttons in Python (tutorial and code)

Postby Cirrhosis » 11 Nov 2016, 13:53

XploD wrote:Did you pay attention on the versions of your Python and Adafruit? Try to go to /usr/lib and see which python version you have. Maybe you don't have python 2.7 directory but python 2.8 or some other instead. The same for Adafruit library.


I'm doing it:

wget https://github.com/adafruit/Adafruit_Py ... master.zip
pacman -S unzip
unzip master.zip
cd Adafruit_Python_CharLCD-master
python2 setup.py install


obtained:

Installed /usr/lib/python2.7/site-packages/Adafruit_CharLCD-1.1.1-py2.7.egg
Processing dependencies for Adafruit-CharLCD==1.1.1
Searching for Adafruit-GPIO>=0.4.0
Downloading https://github.com/adafruit/Adafruit_Py ... GPIO-0.4.0
error: Download error for https://github.com/adafruit/Adafruit_Py ... GPIO-0.4.0: unknown url type: https
Cirrhosis
 
Posts: 4
Joined: 17 Mar 2016, 18:41

Re: LCD display and buttons in Python (tutorial and code)

Postby Cirrhosis » 11 Nov 2016, 14:05

XploD wrote:Did you pay attention on the versions of your Python and Adafruit? Try to go to /usr/lib and see which python version you have. Maybe you don't have python 2.7 directory but python 2.8 or some other instead. The same for Adafruit library.


Installation Adafruit LCD library:

Installed /usr/lib/python2.7/site-packages/Adafruit_CharLCD-1.1.1-py2.7.egg
Processing dependencies for Adafruit-CharLCD==1.1.1
Searching for Adafruit-GPIO>=0.4.0
Downloading https://github.com/adafruit/Adafruit_Py ... GPIO-0.4.0
error: Download error for https://github.com/adafruit/Adafruit_Py ... GPIO-0.4.0: unknown url type: https
Cirrhosis
 
Posts: 4
Joined: 17 Mar 2016, 18:41

Re: LCD display and buttons in Python (tutorial and code)

Postby 05x » 06 Dec 2016, 16:58

XploD wrote:
If you're not using an remote, you will have to use a physical button or something. You have to call 'change_screen()' method from display.py class and the screen will get changed.


At first thank you for your awesome script.
I want to call it from a button instead of IR, but a am a complete novice and don't know how to achieve this.
Maybe some of you Guys can help me, if its not too complicated.
05x
 
Posts: 1
Joined: 24 Nov 2016, 08:51
Location: Germany

support RuneAudio Donate with PayPal

PreviousNext

Return to Raspberry Pi

Who is online

Users browsing this forum: Google [Bot] and 13 guests