Difference between revisions of "Install AVR 3808 telnet"
From xPL
(→Install xPL audio-video controller) |
(→Install xPL audio-video controller) |
||
(5 intermediate revisions by one user not shown) | |||
Line 7: | Line 7: | ||
su | su | ||
perl -MFile::Find=find -MFile::Spec::Functions -Tlw -e 'find { wanted => sub { print canonpath $_ if /\.pm\z/ }, no_chdir => 1 }, @INC' 2> /dev/null | grep -i telnet | perl -MFile::Find=find -MFile::Spec::Functions -Tlw -e 'find { wanted => sub { print canonpath $_ if /\.pm\z/ }, no_chdir => 1 }, @INC' 2> /dev/null | grep -i telnet | ||
− | apt | + | apt install libnet-telnet-perl |
Download the [http://www.dspc.ch/xPL/Downloads/xpl-avController-DenonAVR-telnet.pl AVR controller] script. | Download the [http://www.dspc.ch/xPL/Downloads/xpl-avController-DenonAVR-telnet.pl AVR controller] script. | ||
Line 13: | Line 13: | ||
su | su | ||
SCRIPTS_BASE_DIR=/home/control/Documents/Controls | SCRIPTS_BASE_DIR=/home/control/Documents/Controls | ||
− | + | wget http://www.dspc.ch/xPL/Downloads/xpl-avController-DenonAVR-telnet.pl -C $SCRIPTS_BASE_DIR | |
chown control:users $SCRIPTS_BASE_DIR/*.pl | chown control:users $SCRIPTS_BASE_DIR/*.pl | ||
chmod 775 $SCRIPTS_BASE_DIR/*.pl | chmod 775 $SCRIPTS_BASE_DIR/*.pl | ||
Line 32: | Line 32: | ||
$SCRIPTS_BASE_DIR/xpl-send.pl -d dspc-ampDenon.loungeAmp -c media.basic mute=on | $SCRIPTS_BASE_DIR/xpl-send.pl -d dspc-ampDenon.loungeAmp -c media.basic mute=on | ||
$SCRIPTS_BASE_DIR/xpl-send.pl -d dspc-ampDenon.loungeAmp -c media.basic mute=off | $SCRIPTS_BASE_DIR/xpl-send.pl -d dspc-ampDenon.loungeAmp -c media.basic mute=off | ||
+ | $SCRIPTS_BASE_DIR/xpl-send.pl -d dspc-ampDenon.loungeAmp -c media.basic audio=dvr | ||
+ | $SCRIPTS_BASE_DIR/xpl-send.pl -d dspc-ampDenon.loungeAmp -c media.basic volume=50 | ||
= Launch the script at startup = | = Launch the script at startup = | ||
− | == Ubuntu == | + | The xPL AV controller is to be launched after the xPL hub. |
+ | |||
+ | == Debian with SystemD == | ||
+ | |||
+ | On Debian with [https://wiki.debian.org/systemd systemd] (such as [https://www.raspbian.org/ Raspbian] | ||
+ | or [https://www.ubuntu.com/ Ubuntu]), the scripts can be defined as services. | ||
+ | |||
+ | Edit <code>/lib/systemd/system/xpl-loungeAvController.service</code>: | ||
+ | [Unit] | ||
+ | Description=xPL lounge AV controller | ||
+ | After=xpl-hub.service | ||
+ | |||
+ | [Service] | ||
+ | Type=simple | ||
+ | User=control | ||
+ | Group=users | ||
+ | ExecStart=/home/control/Documents/Controls/xpl-avController-DenonAVR-telnet.pl -n loungeAmp | ||
+ | Restart=always | ||
+ | |||
+ | [Install] | ||
+ | WantedBy=multi-user.target | ||
+ | |||
+ | Activate the service: | ||
+ | su | ||
+ | systemctl enable xpl-loungeAvController.service | ||
+ | service xpl-loungeAvController start | ||
+ | |||
+ | Reboot and check: | ||
+ | ps aux | grep -v grep | grep -i xpl | ||
+ | ps ax | grep -i xpl | grep -v grep | sed 's/.*\/Controls\///' | ||
+ | systemctl list-units --type=service --state=running | grep xpl | ||
+ | service xpl-loungeAvController status | ||
+ | |||
+ | == Ubuntu with Upstart == | ||
+ | |||
+ | On Ubuntu, the AV controller starts-up once <code>xpl-hub_started</code> has been emitted. | ||
+ | |||
+ | Edit <code>/etc/init/xpl-loungeAvController.conf</code>: | ||
+ | # xPL Denon AVR controller | ||
+ | # | ||
+ | description "xPL lounge audio-video controller" | ||
+ | version "1.0" | ||
+ | author "Francois Corthay" | ||
+ | |||
+ | #------------------------------------------------------------------------------- | ||
+ | # Configuration variables | ||
+ | # | ||
+ | env SCRIPTS_DIR='/home/control/Documents/Controls' | ||
+ | env SCRIPT_NAME='xpl-avController-DenonAVR-telnet.pl' | ||
+ | env PARAMETERS='-n loungeAmp' | ||
+ | |||
+ | #------------------------------------------------------------------------------- | ||
+ | # Start and stop conditions | ||
+ | # | ||
+ | start on xpl-hub_started | ||
+ | stop on shutdown | ||
+ | respawn | ||
+ | setuid control | ||
+ | setgid users | ||
+ | |||
+ | #------------------------------------------------------------------------------- | ||
+ | # Start daemon | ||
+ | # | ||
+ | exec $SCRIPTS_DIR/$SCRIPT_NAME $PARAMETERS | ||
+ | |||
+ | Start the screen controller and test it: | ||
+ | su root | ||
+ | service xpl-loungeAvController start | ||
+ | service xpl-loungeAvController status | ||
+ | initctl list | sort | grep xpl | ||
+ | |||
+ | [[Category: all]] [[Category: install]] [[Category:xPL]] |
Latest revision as of 15:22, 3 June 2021
The Denon AV receivers can be controlled via a serial port or via Ethernet.
Contents
Install xPL audio-video controller
Install CPAN Net::Telnet:
su perl -MFile::Find=find -MFile::Spec::Functions -Tlw -e 'find { wanted => sub { print canonpath $_ if /\.pm\z/ }, no_chdir => 1 }, @INC' 2> /dev/null | grep -i telnet apt install libnet-telnet-perl
Download the AVR controller script. Move it to xPL scripts directory:
su SCRIPTS_BASE_DIR=/home/control/Documents/Controls wget http://www.dspc.ch/xPL/Downloads/xpl-avController-DenonAVR-telnet.pl -C $SCRIPTS_BASE_DIR chown control:users $SCRIPTS_BASE_DIR/*.pl chmod 775 $SCRIPTS_BASE_DIR/*.pl
Monitor xPL messages:
su control SCRIPTS_BASE_DIR=/home/control/Documents/Controls $SCRIPTS_BASE_DIR/xpl-monitor.pl -vfd
In a second window, test the AVR controller:
su control SCRIPTS_BASE_DIR=/home/control/Documents/Controls $SCRIPTS_BASE_DIR/xpl-avController-DenonAVR-telnet.pl -v -n loungeAmp
In a 3rd window, test the commands:
su control SCRIPTS_BASE_DIR=/home/control/Documents/Controls $SCRIPTS_BASE_DIR/xpl-send.pl -d dspc-ampDenon.loungeAmp -c media.basic mute=on $SCRIPTS_BASE_DIR/xpl-send.pl -d dspc-ampDenon.loungeAmp -c media.basic mute=off $SCRIPTS_BASE_DIR/xpl-send.pl -d dspc-ampDenon.loungeAmp -c media.basic audio=dvr $SCRIPTS_BASE_DIR/xpl-send.pl -d dspc-ampDenon.loungeAmp -c media.basic volume=50
Launch the script at startup
The xPL AV controller is to be launched after the xPL hub.
Debian with SystemD
On Debian with systemd (such as Raspbian or Ubuntu), the scripts can be defined as services.
Edit /lib/systemd/system/xpl-loungeAvController.service
:
[Unit] Description=xPL lounge AV controller After=xpl-hub.service [Service] Type=simple User=control Group=users ExecStart=/home/control/Documents/Controls/xpl-avController-DenonAVR-telnet.pl -n loungeAmp Restart=always [Install] WantedBy=multi-user.target
Activate the service:
su systemctl enable xpl-loungeAvController.service service xpl-loungeAvController start
Reboot and check:
ps aux | grep -v grep | grep -i xpl ps ax | grep -i xpl | grep -v grep | sed 's/.*\/Controls\///' systemctl list-units --type=service --state=running | grep xpl service xpl-loungeAvController status
Ubuntu with Upstart
On Ubuntu, the AV controller starts-up once xpl-hub_started
has been emitted.
Edit /etc/init/xpl-loungeAvController.conf
:
# xPL Denon AVR controller # description "xPL lounge audio-video controller" version "1.0" author "Francois Corthay" #------------------------------------------------------------------------------- # Configuration variables # env SCRIPTS_DIR='/home/control/Documents/Controls' env SCRIPT_NAME='xpl-avController-DenonAVR-telnet.pl' env PARAMETERS='-n loungeAmp' #------------------------------------------------------------------------------- # Start and stop conditions # start on xpl-hub_started stop on shutdown respawn setuid control setgid users #------------------------------------------------------------------------------- # Start daemon # exec $SCRIPTS_DIR/$SCRIPT_NAME $PARAMETERS
Start the screen controller and test it:
su root service xpl-loungeAvController start service xpl-loungeAvController status initctl list | sort | grep xpl