You should write a shell script that sets the environment and defines
the buttons for SqueezeButtonPi.

Write a text file with the following content (the last line defines the
GPIOs for NEXT, PREV and PLAY):

Code:
--------------------
    #!/bin/sh
  
  # start pigpiod daemon
  pigpiod -t 0 -f -l -s 10
  
  # wait for pigpiod to initialize - indicated by 'pigs t' exit code of zero
  count=10 # approx time limit in seconds
  while ! pigs t >/dev/null 2>&1 ; do
  if [ $((count--)) -le 0 ]; then
  printf "\npigpiod failed to initialize within time limit\n"
  exit 1 # or however you want to deal with failure
  fi
  #    printf "\nWaiting for pigpiod to initialize\n"
  sleep 1
  done
  printf "\npigpiod is running\n"
  
  # load uinput module - required to be able to send keystrokes
  # then set the permission to group writable, so you don't need to run sbpd 
with root permissions
  sudo modprobe uinput
  sudo chmod g+w /dev/uinput
  
  # issue the sbpd command
  sbpd -d b,16,NEXT b,13,PLAY b,26,PREV
--------------------


Name it "start-sbpd.sh" and save it in /home/tc/.

Ensure that the file survives a reboot by executing "pcp bu".

Add "/home/tc/start-sbpd.sh" in user command #1.


------------------------------------------------------------------------
jd68's Profile: http://forums.slimdevices.com/member.php?userid=30795
View this thread: http://forums.slimdevices.com/showthread.php?t=116271

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

Reply via email to