mirror of
https://github.com/ElvishArtisan/rivendell.git
synced 2025-07-26 09:28:13 +02:00
pypad scripts for Inovonics 713 format in TCP mode
Changes pypad_ino713.py from UDP to TCP. Adds delay option. Also works with Nautel VS series transmitters.
This commit is contained in:
parent
7c33000a0b
commit
22f5a30c9d
100
apis/pypad/scripts/pypad_ino713_tcp.exemplar
Normal file
100
apis/pypad/scripts/pypad_ino713_tcp.exemplar
Normal file
@ -0,0 +1,100 @@
|
|||||||
|
; This is the configuration for the 'pypad_ino713_tcp.py' script for
|
||||||
|
; Rivendell, which can be used to output Now & Next data to one or more
|
||||||
|
; Inovonics model 713 RDS encoders or Nautel VS transmitters in TCP mode.
|
||||||
|
|
||||||
|
; Section Header
|
||||||
|
;
|
||||||
|
; One section per remote RDS unit is configured, starting with 'Rds1' and
|
||||||
|
; working up consecutively
|
||||||
|
[Rds1]
|
||||||
|
|
||||||
|
; *****************************************************************************
|
||||||
|
; TCP/IP Connection Settings
|
||||||
|
; IP Address
|
||||||
|
;
|
||||||
|
; The IP address of the TCP port to send updates to, in dotted-quad notation.
|
||||||
|
; If using a serial connection, leave this entry blank!
|
||||||
|
IpAddress=127.0.0.1
|
||||||
|
|
||||||
|
; TCP Port
|
||||||
|
;
|
||||||
|
; The TCP port number to send updates to, in the range 0 - 65,535.
|
||||||
|
TcpPort=10001
|
||||||
|
|
||||||
|
; *****************************************************************************
|
||||||
|
|
||||||
|
; Delay in seconds before sending the update
|
||||||
|
Delay=30
|
||||||
|
|
||||||
|
; *****************************************************************************
|
||||||
|
|
||||||
|
; 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 - %a
|
||||||
|
RadiotextString=%t - %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=Onair
|
||||||
|
Aux1Log=No
|
||||||
|
Aux2Log=No
|
||||||
|
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
|
||||||
|
;TcpPort=6789
|
||||||
|
;Delay=20
|
||||||
|
;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
|
86
apis/pypad/scripts/pypad_ino713_tcp.py
Normal file
86
apis/pypad/scripts/pypad_ino713_tcp.py
Normal file
@ -0,0 +1,86 @@
|
|||||||
|
#!/usr/bin/python3
|
||||||
|
|
||||||
|
# pypad_ino713_tcp.py
|
||||||
|
#
|
||||||
|
# Send Now & Next updates to an Inovonics 713 RDS encoder as TCP
|
||||||
|
#
|
||||||
|
# (C) Copyright 2018 Fred Gleason <fredg@paravelsystems.com>
|
||||||
|
# 2020 Eric Adler <eric@whrwfm.org>
|
||||||
|
#
|
||||||
|
# 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 pypad
|
||||||
|
import time
|
||||||
|
|
||||||
|
def eprint(*args,**kwargs):
|
||||||
|
print(*args,file=sys.stderr,**kwargs)
|
||||||
|
|
||||||
|
|
||||||
|
def ProcessPad(update):
|
||||||
|
n=1
|
||||||
|
section='Rds'+str(n)
|
||||||
|
while(update.config().has_section(section)):
|
||||||
|
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'
|
||||||
|
#
|
||||||
|
# Use TCP output
|
||||||
|
#
|
||||||
|
waittime=int(update.config().get(section,'Delay'))
|
||||||
|
time.sleep(waittime)
|
||||||
|
ipaddr=update.config().get(section,'IpAddress')
|
||||||
|
port=int(update.config().get(section,'TcpPort'))
|
||||||
|
if(len(dps)!=0):
|
||||||
|
send_sock=socket.socket(socket.AF_INET,socket.SOCK_STREAM)
|
||||||
|
send_sock.connect((ipaddr,port))
|
||||||
|
send_sock.sendall(dps.encode('utf-8'))
|
||||||
|
send_sock.close()
|
||||||
|
if(len(ps)!=0):
|
||||||
|
send_sock=socket.socket(socket.AF_INET,socket.SOCK_STREAM)
|
||||||
|
send_sock.connect((ipaddr,port))
|
||||||
|
send_sock.sendall(ps.encode('utf-8'))
|
||||||
|
send_sock.close()
|
||||||
|
if(len(text)!=0):
|
||||||
|
send_sock=socket.socket(socket.AF_INET,socket.SOCK_STREAM)
|
||||||
|
send_sock.connect((ipaddr,port))
|
||||||
|
send_sock.sendall(text.encode('utf-8'))
|
||||||
|
send_sock.close()
|
||||||
|
n=n+1
|
||||||
|
section='Rds'+str(n)
|
||||||
|
|
||||||
|
#
|
||||||
|
# 'Main' function
|
||||||
|
#
|
||||||
|
# Create Send Socket
|
||||||
|
#
|
||||||
|
|
||||||
|
rcvr=pypad.Receiver()
|
||||||
|
try:
|
||||||
|
rcvr.setConfigFile(sys.argv[3])
|
||||||
|
except IndexError:
|
||||||
|
eprint('pypad_inno713.py: USAGE: cmd <hostname> <port> <config>')
|
||||||
|
sys.exit(1)
|
||||||
|
rcvr.setPadCallback(ProcessPad)
|
||||||
|
rcvr.start(sys.argv[1],int(sys.argv[2]))
|
Loading…
x
Reference in New Issue
Block a user