2019-01-04 Fred Gleason <fredg@paravelsystems.com>

* Added a 'pypad_inno713.py' PyPAD script.
	* Removed the 'rlm_inno713' RLM.
This commit is contained in:
Fred Gleason
2019-01-04 12:25:09 -05:00
parent efc2a100a9
commit 5a57f51335
8 changed files with 226 additions and 498 deletions

View File

@@ -26,6 +26,8 @@ install-exec-am:
cp pypad_ando.exemplar $(DESTDIR)$(prefix)/@RD_LIB_PATH@/rivendell/PyPAD/pypad_ando.exemplar
../../../helpers/install_python.sh pypad_filewrite.py $(DESTDIR)$(prefix)/@RD_LIB_PATH@/rivendell/PyPAD/pypad_filewrite.py
cp pypad_filewrite.exemplar $(DESTDIR)$(prefix)/@RD_LIB_PATH@/rivendell/PyPAD/pypad_filewrite.exemplar
../../../helpers/install_python.sh pypad_inno713.py $(DESTDIR)$(prefix)/@RD_LIB_PATH@/rivendell/PyPAD/pypad_inno713.py
cp pypad_inno713.exemplar $(DESTDIR)$(prefix)/@RD_LIB_PATH@/rivendell/PyPAD/pypad_inno713.exemplar
../../../helpers/install_python.sh pypad_live365.py $(DESTDIR)$(prefix)/@RD_LIB_PATH@/rivendell/PyPAD/pypad_live365.py
cp pypad_live365.exemplar $(DESTDIR)$(prefix)/@RD_LIB_PATH@/rivendell/PyPAD/pypad_live365.exemplar
../../../helpers/install_python.sh pypad_liqcomp.py $(DESTDIR)$(prefix)/@RD_LIB_PATH@/rivendell/PyPAD/pypad_liqcomp.py
@@ -48,6 +50,8 @@ uninstall-local:
rm -f $(DESTDIR)$(prefix)/@RD_LIB_PATH@/rivendell/PyPAD/pypad_ando.py
rm -f $(DESTDIR)$(prefix)/@RD_LIB_PATH@/rivendell/PyPAD/pypad_filewrite.exemplar
rm -f $(DESTDIR)$(prefix)/@RD_LIB_PATH@/rivendell/PyPAD/pypad_filewrite.py
rm -f $(DESTDIR)$(prefix)/@RD_LIB_PATH@/rivendell/PyPAD/pypad_inno713.exemplar
rm -f $(DESTDIR)$(prefix)/@RD_LIB_PATH@/rivendell/PyPAD/pypad_inno713.py
rm -f $(DESTDIR)$(prefix)/@RD_LIB_PATH@/rivendell/PyPAD/pypad_live365.exemplar
rm -f $(DESTDIR)$(prefix)/@RD_LIB_PATH@/rivendell/PyPAD/pypad_live365.py
rm -f $(DESTDIR)$(prefix)/@RD_LIB_PATH@/rivendell/PyPAD/pypad_liqcomp.exemplar
@@ -69,6 +73,8 @@ EXTRA_DIST = pypad_ando.exemplar\
pypad_ando.py\
pypad_filewrite.exemplar\
pypad_filewrite.py\
pypad_inno713.exemplar\
pypad_inno713.py\
pypad_liqcomp.exemplar\
pypad_liqcomp.py\
pypad_live365.exemplar\

View File

@@ -0,0 +1,117 @@
; This is the configuration for the 'rlm_inno713.py' script for
; Rivendell, which can be used to output Now & Next data to one or more
; Innovonics model 713 RDS encoders.
; Section Header
;
; One section per remote RDS unit is configured, starting with 'Rds1' and
; working up consecutively
[Rds1]
; Two methods of connecting to the unit are supported: TCP/IP or serial.
;
; *****************************************************************************
; TCP/IP Connection Settings
; IP Address
;
; The IP address of the UDP port to send updates to, in dotted-quad notation.
; If using a serial connection, leave this entry blank!
IpAddress=127.0.0.1
; UDP Port
;
; The UDP port number to send updates to, in the range 0 - 65,535.
UdpPort=10001
; *****************************************************************************
; *****************************************************************************
; Serial Connection Settings
;
; The device file that corresponds to the serial device that is connected
; to the unit. If using a TCP/IP connection, leave this entry blank!
;Device=/dev/ttyS0
; Serial Baud Rate (in bps)
Speed=9600
; Parity (0=none, 1=even, 2=odd)
Parity=0
; Number of bits per data 'word'.
WordSize=8
; *****************************************************************************
; Output Strings. The PAD data to output each time RDAirPlay changes
; play state, including any wildcards as placeholders for metadata values.
;
; For the list of supported wildcards. see the 'Metadata Wildcards' section
; of the Rivendell Operations Guide.
PsString=
DynamicPsString=%t
RadiotextString=%a
; Log Selection
;
; Set the status for each log to 'Yes', 'No' or 'Onair' to indicate whether
; state changes on that log should be output on this udp port. If set
; to 'Onair', then output will be generated only if RDAirPlays OnAir flag
; is active.
MasterLog=Yes
Aux1Log=Yes
Aux2Log=Yes
VLog101=No
VLog102=No
VLog103=No
VLog104=No
VLog105=No
VLog106=No
VLog107=No
VLog108=No
VLog109=No
VLog110=No
VLog111=No
VLog112=No
VLog113=No
VLog114=No
VLog115=No
VLog116=No
VLog117=No
VLog118=No
VLog119=No
VLog120=No
; Additional RDS encoders can be configured by adding new sections...
;[Rds2]
;IpAddress=192.168.10.22
;UdpPort=6789
;Device=/dev/ttyS0
;Speed=9600
;Parity=0
;WordSize=8
;PsString=
;DynamicPsString=%t
;RadiotextString=%a
;MasterLog=Yes
;Aux1Log=No
;Aux2Log=Onair
;VLog101=No
;VLog102=No
;VLog103=No
;VLog104=No
;VLog105=No
;VLog106=No
;VLog107=No
;VLog108=No
;VLog109=No
;VLog110=No
;VLog111=No
;VLog112=No
;VLog113=No
;VLog114=No
;VLog115=No
;VLog116=No
;VLog117=No
;VLog118=No
;VLog119=No
;VLog120=No

View File

@@ -0,0 +1,99 @@
#!%PYTHON_BANGPATH%
# pypad_inno713.py
#
# Send Now & Next updates to an Innovonics 713 RDS encoder
#
# (C) Copyright 2018 Fred Gleason <fredg@paravelsystems.com>
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License version 2 as
# published by the Free Software Foundation.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public
# License along with this program; if not, write to the Free Software
# Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
#
import sys
import socket
import configparser
import serial
import PyPAD
def eprint(*args,**kwargs):
print(*args,file=sys.stderr,**kwargs)
def ProcessPad(update):
n=1
while(True):
section='Rds'+str(n)
try:
if update.shouldBeProcessed(section) and update.hasPadType(PyPAD.TYPE_NOW):
dps=''
if(len(update.config().get(section,'DynamicPsString'))!=0):
dps='DPS='+update.resolvePadFields(update.config().get(section,'DynamicPsString'),PyPAD.ESCAPE_NONE)+'\r\n'
ps=''
if(len(update.config().get(section,'PsString'))!=0):
ps='PS='+update.resolvePadFields(update.config().get(section,'PsString'),PyPAD.ESCAPE_NONE)+'\r\n'
text=''
if(len(update.config().get(section,'RadiotextString'))!=0):
text='TEXT='+update.resolvePadFields(update.config().get(section,'RadiotextString'),PyPAD.ESCAPE_NONE)+'\r\n'
try:
#
# Use serial output
#
tty_dev=update.config().get(section,'Device')
speed=int(update.config().get(section,'Speed'))
parity=serial.PARITY_NONE
if int(update.config().get(section,'Parity'))==1:
parity=serial.PARITY_EVEN
if int(update.config().get(section,'Parity'))==2:
parity=serial.PARITY_ODD
bytesize=int(update.config().get(section,'WordSize'))
dev=serial.Serial(tty_dev,speed,parity=parity,bytesize=bytesize)
if(len(dps)!=0):
dev.write(dps.encode('utf-8'))
if(len(ps)!=0):
dev.write(ps.encode('utf-8'))
if(len(text)!=0):
dev.write(text.encode('utf-8'))
dev.close()
except configparser.NoOptionError:
#
# Use UDP output
#
ipaddr=update.config().get(section,'IpAddress')
port=int(update.config().get(section,'UdpPort'))
if(len(dps)!=0):
send_sock.sendto(dps.encode('utf-8'),(ipaddr,port))
if(len(ps)!=0):
send_sock.sendto(ps.encode('utf-8'),(ipaddr,port))
if(len(text)!=0):
send_sock.sendto(text.encode('utf-8'),(ipaddr,port))
n=n+1
except configparser.NoSectionError:
return
#
# 'Main' function
#
# Create Send Socket
#
send_sock=socket.socket(socket.AF_INET,socket.SOCK_DGRAM)
rcvr=PyPAD.Receiver()
try:
rcvr.setConfigFile(sys.argv[3])
except IndexError:
eprint('pypad_inno713.py: you must specify a configuration file')
sys.exit(1)
rcvr.setCallback(ProcessPad)
rcvr.start(sys.argv[1],int(sys.argv[2]))