Finally I found my way... even mangaged to assign a double function to
the IQAudio push button:

1. installing sbpd
2. creating two bash scripts:
*phono.sh:* Short press powers up the Denon amp and starts playback of
the Zero's streaming URL, via main LMS Raspi (... .135)

Code:
--------------------
    #!/bin/sh
  telnet 192.168.50.135 9090 <<EOF
  aa%3Aaa%3Acd%3A84%3A4c%3A59 playlist play 
http%3A%2F%2F192.168.50.108%3A9100%2FS32_LE%2F44100%2F2%2FM
  aa%3Aaa%3Acd%3A84%3A4c%3A59  mixer volume 50
  quit
  EOF
  
--------------------

*shutdown.sh:* Long press starts shutdown

Code:
--------------------
    #!/bin/sh
  sudo /sbin/poweroff
  exit 0.
--------------------

3. putting

Code:
--------------------
    sbpd b,27,SCRIPT:/home/tc/phono.sh,2,0,SCRIPT:/home/tc/shutdown.sh,1000
--------------------

as User command #3 in PCP. 

Seems to work nicely, even if I'm sure that there are more elegant ways
to achieve this goal ;)
Now I'll try to connect another push button to GPIO3 - GND. As far as I
understand, this should power up the zero from standby, adding

Code:
--------------------
    dtoverlay=gpio-shutdown,gpio_pin=3, active_low=1,gpio_pull=up
--------------------
 to config.txt
Regards
Martin



PCP (always latest version) on RasPi 3 with PhatDac (player & server)
PCP on several RasPis 2 +3
2 Airplay speakers (Sony SA-NS510) integrated via Airplay Bridge Plugin
------------------------------------------------------------------------
streampunk's Profile: http://forums.slimdevices.com/member.php?userid=66210
View this thread: http://forums.slimdevices.com/showthread.php?t=117119

_______________________________________________
unix mailing list
[email protected]
http://lists.slimdevices.com/mailman/listinfo/unix

Reply via email to