adafruit lcd plate (success) - systemd (fail)

Raspberry Pi related support

adafruit lcd plate (success) - systemd (fail)

Postby rupi » 19 Dec 2014, 20:47

Hi,

I'm currently writing a small python program utilizing an adafruit lcd plate (http://www.adafruit.com/product/1110) to add simple controls to my raspi running rune audio 0.3beta. The program works fine so far (https://git.devlol.org/rupi/mpdplate/tree/master if anyone is interested). I have a lot of troubles with systemd (this project is my first contact with arch linux as well as systemd).
I post this message here because I'm not sure if some of my troubles aren't specific to rune audio startup tunings...

The problem seems to originate in a failure with time.sleep(n) and system time..

A mpdisplay.service file with

[Service]
Type=simple
User=mpdisplay
ExecStart=/usr/src/mpdplate/mpdisplay
RestartSec=60
Restart=always

does not restart my service:
Active: failed (Result: exit-code) since Thu 1970-01-01 01:00:24 CET; 44 years 11 months ago

I have no idea why. If I later restart the service it runs fine. It also restarts fine if I kill it.

I have how to get some debugging info,

[Service]
StandardError=kmsg

doesn't seem to work.

Any help would be appreciated.

rupi

[EDIT]
I found this forum post:
auto-play-music-t694.html#p4402

So I added the following line to rune_SY_wrk:
sysCmd('systemctl start mpdisplay');

It now works. For some values of works anyway.
rupi
 
Posts: 5
Joined: 19 Dec 2014, 20:34

Re: adafruit lcd plate (success) - systemd (fail)

Postby hondagx35 » 19 Dec 2014, 22:42

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

Re: adafruit lcd plate (success) - systemd (fail)

Postby rupi » 19 Dec 2014, 23:01

Thx.. indeed it does the trick. No dirty patching necessary anymore. It is however puzzling (Journal now reveals that mpdisplay failed because I didn't catch the initial connection request to mpd). I assume some magic startup tricks with rune audio mpd is involved.. it was running after all.

Anyways.. still harbour strong thoughts about Poetterings latest attempt to make all sysadmins misserable.
rupi
 
Posts: 5
Joined: 19 Dec 2014, 20:34

Re: adafruit lcd plate (success) - systemd (fail)

Postby hondagx35 » 19 Dec 2014, 23:17

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

Re: adafruit lcd plate (success) - systemd (fail)

Postby rupi » 20 Dec 2014, 14:25

Hi,
granted... it's not magic. But it is a weird logic. After all I needed to remove the hard dependecy on a service that my programm really needs to work to have it restarted after the service is finally starting in a useable fashion.
And systemd is not really helpfull.. The final startup of mpd is done in rune_SY_wrk. I get why rune audio does start/stop it - there may be the spotify player selected which potentially clashes. And since systemd doesn't trigger that on it's own it would be dangerous to have it trigger all potential dependecies.
But it is pretty painfull to disect the boot sequence and find out why something is done at what point.
I really don't look forward to next year.. when Debian Jessie will be stable and I have to migrate a 3 digit number of systems to a systemd bootup..

Thanks anyway and excuse the flamebait (blame frustration).

rupi
rupi
 
Posts: 5
Joined: 19 Dec 2014, 20:34

Now working..

Postby rupi » 24 Dec 2014, 00:57

So.. in case somebody else wants this. My little program now works pretty fine.
https://git.devlol.org/rupi/mpdplate/tree/master
rupi
 
Posts: 5
Joined: 19 Dec 2014, 20:34

Re: adafruit lcd plate (success) - systemd (fail)

Postby pba » 29 Dec 2014, 18:18

Hi rupy

Thanks for sharing the little program, perfect for my needs and saved me a lot of hassle (didn't found a suitable script for my needs). The deactivated display in stop-mode is real nice, didn't found this anywhere else.
Setup is a Pi B with Hifiberry DAC and the Adafruit LCD.

Two points I'd like to discuss:
- Your Howto is perfect, just had to install additionally binutils and gcc to get makepkg working (no big deal).
- If there is a umlaut or another special sign (e.g. äöüéèà) in the Artist or Title, the display will only show a ? instead of the correct letter, Motörhead gets Mot?orhead, Queensrÿche becomes Queensr?che etc.

Sometimes MPD on my Pi B crashes when using the buttons, but ist's also crashing when using the Rune webui. My B+ does not have this issue, might be a hardware problem on my side.

For optical reasons, i changed myself the separator between Artist and Track to - instead of / :-D

Perfect would be if the webradio and the not-updating-title could be eliminated, however it's no show stopper.

Now with a working display my next project is a remote control (prefered with , have a spare one) and then a case made out of beech wood.

Thanks,
Michael
pba
 
Posts: 15
Joined: 17 Nov 2014, 23:47

Re: adafruit lcd plate (success) - systemd (fail)

Postby cyber7 » 02 Jul 2015, 05:21

To err is human, to err again is machine!
User avatar
cyber7
 
Posts: 28
Joined: 04 Feb 2014, 14:49
Location: Cape Town, South Africa

support RuneAudio Donate with PayPal


Return to Raspberry Pi

Who is online

Users browsing this forum: No registered users and 30 guests