Reply To: Amplifier Power On/Off GPIO output

6. Februar 2016 at 14:23 #18393

I’ve found a solution for this !!
https://code.google.com/archive/p/sbnetio/

This plugin runs on the Logitech media server and will send TCP commands to specified Squeezeboxes that are currently playing.
‚Commands‘ can be specified in the LMS settings for the plugin. You then need to create something executable on the players to turn on/off a GPIO pin. I wrote two .c files AmpLatchOn.c and AmpLatchOff.c and compiled them to AmpLatchOn and AmpLatchOff. The ‚commands‘ set in the plugin are simply AmpLatchOn and AmpLatchOff

AmpLatchOn.c :

#include <wiringPi.h>
int main (void)
{
  wiringPiSetup () ;
  pinMode (0, OUTPUT) ;
  digitalWrite (0, HIGH) ; delay (50);

  return 0;
}

You may also need to install wiringPi to get this working

From the bottom of the google code page (linked above), download netio_server_client.zip
Extract this to a new folder on each player
Set netio_server.py to run on startup (boot) (I created a bash script to run it and added with crontab I think). This will receive the TCP commands and run the command.
I had to modify this under “ def handle_command(self, line); “ I altered the command directory to “ Dir = ‚/home/pi/netio/./‘ “ as this is where my c-code executables are.

Takes a bit of setup, but it worked for me!
It’s exactly the kind of thing that could be made native to M2P/Squeezeplug

  • This reply was modified 4 years, 10 months ago by  Mark One.