Also Das Plugin selbst arbeitet korrekt und auf anhieb auch ohne eingetragene GA in der WG Adressverwaltung.
Den Streamoutput muss ich mal noch testen.
@Sean: Hier mal eine leicht umgeschreibene Version mit einigen Debugzeilen um herauszufinden ob das Plugin bei dir korrekt arbeitet...
EDIT: Gerade bei mir getestet. Funktioniert so bei mir.
Den Streamoutput muss ich mal noch testen.
@Sean: Hier mal eine leicht umgeschreibene Version mit einigen Debugzeilen um herauszufinden ob das Plugin bei dir korrekt arbeitet...
Code:
# This plugin handles the mpg123 to stream music # do all configs here: my $knx_addr = '14/5/4'; # address to start/stop the mpg123 my $mpg123_fifo = '/tmp/mpg123_fifo'; # NOTE: mpg123 currently has a bug that causes it not to be # able to use the .M3U (container-)format. # => you have to download it and look inside yourself # Bug report: https://sourceforge.net/tracker/?fun...04&atid=733194 my $stream = 'http://gffstream.ic.llnwd.net/stream/gffstream_w12b'; # Bayern3 ################################################################# # do not change anything below, all config stays above ################################################################# # subscribe plugin and call it only when necessary $plugin_subscribe{$knx_addr}{$plugname} = 1; $plugin_info{$plugname.'_cycle'} = 0; # handle telegrams return if ($msg{'dst'} ne $knx_addr); # early exit if the message wasn't meant for us if ($msg{'apci'} eq 'A_GroupValue_Write') # state of mpg123 { plugin_log($plugname, ""); plugin_log($plugname, $msg{'data'} . " von GA: " . $knx_addr . " empfangen"); if( $msg{'data'} eq '00' ) # stop mpg123 { plugin_log($plugname, "mpg123 stop"); my $debug = `echo "Q" > $mpg123_fifo` if( -p $mpg123_fifo ); return $debug; } else { # start mpg123 plugin_log($plugname, "mpg123 Start"); if( -p $mpg123_fifo ){return "nothing todo"}; # nothing to do if( -e $mpg123_fifo ){unlink( $mpg123_fifo )}; # delete if it's a file and not a named pipe (see check above) my $debug = `echo "run"; nohup mpg123 -R --fifo $mpg123_fifo > /dev/null &`; sleep 1; # wait a bit so that it can start up... # run stream after sanity check if( -p $mpg123_fifo ){`echo "L $stream" > $mpg123_fifo`}; return $debug; } }

Kommentar