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 » 28 Jan 2017, 11:16

Hi Yatsushiro,

you have the patience of a saint.

I am a teacher (electronics), maybe this helps a lot.

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

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

Postby TommyBoy » 28 Jan 2017, 14:00

your smart google "help" was of no help,
since it is runeaudio specific commands i am looking for
not basic linux stuff.
so i think it is better just to give up and drop the idea to add a display.
since it is made as complex as possible.
User avatar
TommyBoy
 
Posts: 111
Joined: 29 Mar 2016, 14:04
Location: Copenhagen Denmark

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

Postby Yatsushiro » 28 Jan 2017, 14:14

It really is true, there are none so blind as those that will not see.
Yatsushiro
 
Posts: 90
Joined: 11 May 2016, 10:30

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

Postby hondagx35 » 28 Jan 2017, 14:31

Hi TommyBoy,

since it is runeaudio specific commands i am looking for
not basic linux stuff.

The redis commands i told you are the "runeaudio specific" ones.
And yes way do not update automatically, but this should not the problem at all.
The remaining play time can be calculated within your script (rune does it like this)

If you like to get other information you have to use
- mpd for all info belonging to the Music Player Daemon
- spopd for the spotify plugin

so i think it is better just to give up and drop the idea to add a display.

Why? It is not that complicated.
Please explain what your goal is.

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

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

Postby TommyBoy » 28 Jan 2017, 17:32

>Why? It is not that complicated.
>Please explain what your goal is.

I be happy to explain:
number one wish for christmas : LCD support in the standard image file,
all people need to do is solder a 1602 2002 1604 or 2004 display directly to GBIO pins 4 bit mode prefered.
and then ENABLE this by one line in the config file,
maybe even make it nice by having 2-3 lines of lcd config, chars and lines
and what kind of info to write, where..

as far as i see, people need to be allready deep into linux, to be able to figure out how to get multible updates installed
configured and even programmed. tons of threads reveal how hard and troublesome it really is.
and see how many visits this thread got ? so many users cry for this ..
try to understand, most users have never ever played with a PI or linux before. and they dont really give a darn,
this runeaudio player, is their first PI project, and first time with Linux.
it took me weeks to figure out what a console is, and then to figure how how to access it, and how to modify files.
now i need to learn python and spend another 3 weeks before my first LCD will display just a name of a song,
if any luck initializing it correctly.
User avatar
TommyBoy
 
Posts: 111
Joined: 29 Mar 2016, 14:04
Location: Copenhagen Denmark

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

Postby hondagx35 » 28 Jan 2017, 18:55

Hi TommyBoy,

number one wish for christmas : LCD support in the standard image file

OK, so until next Christmas there should be enought time to implement this.

It should not that hard to install one of these repos:
https://github.com/RandyCupic/RuneAudioLCD
https://github.com/lukazgur/RuneAudioLCDMod

I will see what i can do.

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

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

Postby c@bbie45 » 28 Jan 2017, 19:51

Hi all.
This is a really helpful forum, so many thanks to all.
I couldn't find exactly what I was looking for here but by using a lot of trial and error (no linux or coding experience), as well as the Xplod guide and a couple of other websites hagensieker.com and andypi.co.uk; I've finally managed to get my 16x2 serial LCD to display the song and artist information using lcdproc and mpdlcd. The problem that I have though is that I can only get it working in Volumio - I'm going to keep trying to adapt the process to RuneAudio but so far no joy. I'll write up a guide which might help noobs like myself - is it ok to post it here and maybe someone could adapt for RuneAudio? (Don't want to get banned for posting a Volumio guide here, just wanting to share and help)
c@bbie45
 
Posts: 2
Joined: 23 Jan 2017, 20:56

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

Postby DennisPi » 28 Jan 2017, 20:50

Hi

My name is Dennis and I am new here.
Today i have received my raspberry with an HifiBerry + with 4x20 LCD with interface (4pins)
I have installed the latest version of Runeaudio and it works perfect with my Raspberry+Hifiberry

Now i will install the LCD with a few buttons, but i have read this whole post, but i don't know what i have to do now, is here an tutorial available with the steps to do ?

My LCD is already connected to my raspberry on pins VCC/GND and GPIO3 en 4

thanks Dennis (Netherlands)
DennisPi
 
Posts: 2
Joined: 28 Jan 2017, 20:42

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

Postby s.k. » 28 Jan 2017, 22:30

Ok
As I said in the "IR remote problems" topic, my skills are limited but after a lot of tries and errors I ended up with the following guide.
I use a 16x2 LCD display with I2C backpack and the newer version of XploD's solution (https://github.com/RandyCupic/RuneAudioLCD ).
Works pretty well on a Pi2.

1) Edit the /boot/config.txt file
Find this line:
#dtparam=i2c_arm=on
and remove the # at the beginning

2) Edit /boot/cmdline.txt file
and at the end of the file, add this:
, bcm2708.vc_i2c_override=1

3) Edit /etc/modules-load.d/raspberrypi.conf
and at the bottom of the file, add this:
i2c-bcm2708
i2c-dev

4) Install I2C tools
pacman -Sy
pacman -S i2c-tools

5) Turn off your Raspberry Pi 2 and connect your device

6) Turn on your Pi and detect your I2C device
type the following command:
i2cdetect -y 1
You should get something like this
27 on 20:|7
(This means that the I2C DISPLAY ADDRESS of the backpack is : 0x27)

7) Put the uncompressed folder RuneAudioLCD (https://github.com/RandyCupic/RuneAudioLCD)
In the root directory (/root/RuneAudioLCD)

8) Open the start.py file and correct the I2C_DISPLAY_ADDRESS, LCD_COLUMNS & LCD_ROWS according to your display. Correct also everything else that you need (i.e. buttons, remote)

9) Create a startup service “ rune_lcd.service” in /usr/lib/systemd/system/
Type in the following command:
nano /usr/lib/systemd/system/rune_lcd.service
and paste
#######################################################
[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
#######################################################

10) enable the new service :
systemctl enable rune_lcd.service

11) reboot

I hope it make sense

Regards
Stavros
s.k.
 
Posts: 70
Joined: 04 Jan 2017, 08:38

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

Postby TommyBoy » 28 Jan 2017, 23:10

great SK, but how about a STANDARD 1602 with out I2C module,
the cpu on the pi can easyly bit-bang the needed info out on some GPIO
and you see all sorts of cool and cheap displays are super easy to find all over the world,
the most normal is offcourse the 1602, but 2002 2402 or even 4 line variants are also very easy to find.
User avatar
TommyBoy
 
Posts: 111
Joined: 29 Mar 2016, 14:04
Location: Copenhagen Denmark

support RuneAudio Donate with PayPal

PreviousNext

Return to Raspberry Pi

Who is online

Users browsing this forum: No registered users and 4 guests