Difference between revisions of "Repeater Controller configuration"

From BATC Wiki
Jump to navigation Jump to search
 
(9 intermediate revisions by 2 users not shown)
Line 125: Line 125:
 
The configuration file is too comprehensive for all the functions to be edited from a simple menu and more advanced customisation will require the careful editing of the text file /home/pi/atv-rptr/config/repeater_config.txt
 
The configuration file is too comprehensive for all the functions to be edited from a simple menu and more advanced customisation will require the careful editing of the text file /home/pi/atv-rptr/config/repeater_config.txt
  
==Typical config file==
+
===Hand edit===
 +
You can hand-edit the configuration file with the command
 +
nano atv-rptr/config/repeater_config.txt
 +
Use the arrow keys to move about (not the mouse) and save by pressing ctrl-x, y and then enter.  Discard changes by simply pressing ctrl-x and then n.
 +
 
 +
If it has all gone wrong, you can start again with a factory-fresh configuration file using the command
 +
cp atv-rptr/config/repeater_config.txt atv-rptr/config/repeater_config.txt.factory
 +
Note that you will lose all of your previous edits.
 +
 
 +
===FTP===
 +
 
 +
Use a program such as WinSCP or Filezilla and either edit the config file in the RPi directory or copy it to a local drive, edit and then transfer it back.
 +
 
 +
==Actioning the changes==
 +
 
 +
After editing and saving, reload the controller by using item 1 in the SSH menu.
 +
 
 +
=Typical config file=
  
 
The following is an example of a typical config with comments on each function - some functions are also available in the SSH menu
 
The following is an example of a typical config with comments on each function - some functions are also available in the SSH menu
Line 155: Line 172:
 
audiokeepalivelevel=85
 
audiokeepalivelevel=85
  
===TX key logic - also in SSH menu (see above for description)===
+
===TX key and Power Saving logic - also in SSH menu (see above for description)===
 
  Enable/disable transmit ptt active? yes/no
 
  Enable/disable transmit ptt active? yes/no
 
transmitenabled=yes
 
transmitenabled=yes
Line 164: Line 181:
 
  Continuous TX or power-saving.  no/yes
 
  Continuous TX or power-saving.  no/yes
 
transmitwhennotinuse=yes
 
transmitwhennotinuse=yes
 +
 +
Control mains switch for rack (and allocate GPIOs?).  Not not compatible with use of input 7
 +
rackmainscontrol=yes
 +
 +
GPIO pins for controlled rack shutdown (front panel button, shutdown signal and mains switch
 +
racksdbuttongpiopin=21
 +
racksdsignalgpiopin=24
 +
rackmainspwrgpiopin=15
 +
 +
Turn off receiver rack and encoder to save power?  Times UTC
 +
rackpowersave=yes
 +
rackpoweron1=1500
 +
rackpoweroff1=2300
 +
Set second times to be equal for one power-on period only
 +
rackpoweron2=0000
 +
rackpoweroff2=0000
  
 
  Continuous operation or active hours only. yes/no
 
  Continuous operation or active hours only. yes/no
Line 192: Line 225:
  
 
fpsdgpiopin=26
 
fpsdgpiopin=26
 
===Local audio===
 
(144.75 FM from usb audio dongle) audio could be inserted on carousel
 
Options are off, both, left right (mono from USB dongle)
 
carouselusbaudiomode=off
 
 
carouselusbaudiogain=100
 
  
 
===DTMF repeater control===
 
===DTMF repeater control===
Line 227: Line 253:
 
dtmfquadview=04
 
dtmfquadview=04
  
  Select input
+
  Select input (when finished, use *00# to return to normal operation)
  
 
dtmfselectinput0=10
 
dtmfselectinput0=10
Line 365: Line 391:
  
 
Note that the 4th image above is located in the /home/pi/custom_media folder.  It is recommended that site-specific images are saved in that folder, which will not be over-written during software updates.
 
Note that the 4th image above is located in the /home/pi/custom_media folder.  It is recommended that site-specific images are saved in that folder, which will not be over-written during software updates.
 +
 +
===Analogue Talkback Audio on Carousel===
 +
 +
If using an i2c analogue audio switcher, the talkback audio can be enabled during the carousel
 +
 +
# Analogue talkback audio (144.75) can be turned on or off using the MCP23008 i2c switcher
 +
talkbackaudio=on
 +
talkbackaudioi2cbit=7
 +
 +
If using hdmi audio, the talkback can be input on the USB mic dongle (along with the DTMF) and output on the HDMI audio during the carousel.  The audio gain is set by the dtmfaudiogain parameter as they both use the same input.  Facility introduced in release 202402190.
 +
 +
# Talkback audio on DTMF input can also be output on the controller (k/cw ident) audio channel
 +
# Volume is set by dtmfaudiogain above
 +
controllertalkbackaudio=on
  
 
===Input configuration===
 
===Input configuration===

Latest revision as of 14:56, 19 February 2024

Back to repeater controller main page

This page describes the setup of the BATC repeater controller - it should only be attempted by advanced users.

Note not all functions listed in the config file are currently implemented.

SSH Menu

Some configuration and some real-time control is possible using the ssh Console Menu.

To enter the repeater controller menu log in to the RPi by SSH using a program such as Putty and type menu.

Controller main.JPG

Reload

Loads the configuration changes you have made and restarts the controller

1 Behaviour

1 - Audio keepalive. Some HDMI switches permanently shut down the audio channel is no audio is present. This option puts low-level white noise on the controller audio out to prevent this from happening.

2 - Transmit enable. Enables transmit key line on pin xx

3 - Beacon mode. Enables the controller to just run in beacon mode and ignore all inputs.

4 - Power save. Enables transmit key line to be on continuously or just when the controller sees a valid input signal or when sending an ident.

5 - Operating hours. Selection of transmit key line to be active continuously or just during a timed period to save power. If timed, select the start and stop times. Note time is set using UTC time, not local time.

6 - Quiet hours repeat. If Timed operation was selected in menu 5, you can set if the repeater should repeat an input signal during the quiet time.

7 - Quiet hours ident. If Timed operation was selected in menu 5, you can set if the repeater should send the ident signal during the quiet time.

8 - Half hour. If enabled, the transmitter will only be keyed in beacon mode during the first 30 minutes of every hour and not during the 2nd half hour to save power.

9 - Quad auto enable. Enables the quad display to be automatically displayed when more than 1 selected inputs are present.

10 - Enable DTMF input. Enables over air DTMF control of the repeater

11 - Apply changes

12 - Return to main menu

2 Callsign

Entry of the repeater callsign and QRA locator for display on generated captions.

3 Inputs

1 - 7 Input. Enables priority of each input to be set

8 - Input count. Set this to the total number of inputs on the video switcher - Do NOT include the controller in this number.

9 - Active Hold. Determines if a higher priority input will override the currently selected input.

10 - Apply

11 - Main Menu

4 Control

Enables direct selection of any input source

5 Update

Check s/w version and update if needed.

6 Settings

1 - Reset factory defaults

2 - Check HDMI. Lists the HDMI settings for fault finding

3 - Main menu.

7 Diagnostics

8 Reboot

Does exactly that!

Controlling the Repeater During Testing

Stopping the Controller

The controller can be stopped by entering

stop

at the command line. This tells all the repeater processes to stop and should show a "Controller Software Not Running" caption on the HDMI output.

Restarting the Controller for Testing

You can restart the controller for testing by entering

rptr

You will see a running commentary of what the repeater is doing in the console window. However, if you close the window, the repeater will stop. You can also stop it and get back to the command prompt by pressing ctrl-c.

You can start the repeater so that it runs and keeps a log of what it is doing (even if you close the controller window) by entering this command:

nohup atv-rptr/utils/run_rptr_nohup_with_log.sh &

Then press ctrl-c to get back to the command prompt.

If you see behaviour that you want to investigate, enter

stop

to force the last bit of the log to be written to the file, and then enter

tail -25 log.txt

to see the last 25 lines of the log.

Do not run the repeater for normal use using these test modes. The log file will grow over time and eventually fill the SD Card, causing the repeater to fail.

Getting Back to Normal Use

At the end of a maintenance session, you should always reboot the repeater to check that it is working properly and put it in its normal mode. Do this by typing

sudo reboot now

Close the SSH window, watch the repeater output and if all is well, walk away.

Advanced Commands

If you need to edit the C code, you can recompile it and run the repeater software with the command

urptr

This will also show you any errors if the compilation fails.

If you need to troubleshoot the output display settings, use

tvservice -s

Editing the config file

The configuration file is too comprehensive for all the functions to be edited from a simple menu and more advanced customisation will require the careful editing of the text file /home/pi/atv-rptr/config/repeater_config.txt

Hand edit

You can hand-edit the configuration file with the command

nano atv-rptr/config/repeater_config.txt

Use the arrow keys to move about (not the mouse) and save by pressing ctrl-x, y and then enter. Discard changes by simply pressing ctrl-x and then n.

If it has all gone wrong, you can start again with a factory-fresh configuration file using the command

cp atv-rptr/config/repeater_config.txt atv-rptr/config/repeater_config.txt.factory

Note that you will lose all of your previous edits.

FTP

Use a program such as WinSCP or Filezilla and either edit the config file in the RPi directory or copy it to a local drive, edit and then transfer it back.

Actioning the changes

After editing and saving, reload the controller by using item 1 in the SSH menu.

Typical config file

The following is an example of a typical config with comments on each function - some functions are also available in the SSH menu

Introduction

Text file defining behaviour and config of the BATC HDMI Repeater Design
Comments must be on their own line
Read at boot time and only modified from console menu or text editor except transmitenabled which is amended by dtmfkeepertxoff or dtmfkeepertxon

Station Details - also in SSH menu

callsign=GB3HV

locator=IO91LD

Video output

Used to size captions and layout display only.  It does NOT set the output to hdmi720, hdmi1080, pal, ntsc 

vidout=hdmi1080

Ident and K CW audio output

This is used to set the output port (but not the hdmi keep-alive)
hdmi, jack or usb

audioout=hdmi

Low level audio - also in SSH menu

Turn on low level audio noise to keep hdmi audio active? yes/no

audiokeepalive=yes

audiokeepalivelevel=85

TX key and Power Saving logic - also in SSH menu (see above for description)

Enable/disable transmit ptt active? yes/no

transmitenabled=yes

Beacon mode only transmits carousel with ident.  Set to no for rptr operation. yes/no

beaconmode=no

Continuous TX or power-saving.  no/yes

transmitwhennotinuse=yes

Control mains switch for rack (and allocate GPIOs?).  Not not compatible with use of input 7

rackmainscontrol=yes

GPIO pins for controlled rack shutdown (front panel button, shutdown signal and mains switch

racksdbuttongpiopin=21 racksdsignalgpiopin=24 rackmainspwrgpiopin=15

Turn off receiver rack and encoder to save power?  Times UTC

rackpowersave=yes rackpoweron1=1500 rackpoweroff1=2300

Set second times to be equal for one power-on period only

rackpoweron2=0000 rackpoweroff2=0000

Continuous operation or active hours only. yes/no

24houroperation=yes

Power save during second half hour in active hours?  Default no.
Repeat and Ident are available/active during this time

halfhourpowersave=no

Operating times are UTC.  Ignored for 24/7 operation

operatingtimestart=1300

operatingtimefinish=2330

Quiet hours behaviour:

repeatduringquiethours=no

identduringquiethours=no

Transmit PTT Demand physical pin

Recommended pin 40

pttgpiopin=40

Front Panel Shutdown Enabled?

Physical GPIO Pin (recommended 26)

fpshutdown=no

fpsdgpiopin=26

DTMF repeater control

Uses white "Portsdown/Langstone" USB dongle input
These are just example commands - see DATV repeater DTMF commands for more details
Control is on/off.  Gain is %.  Timeout is in seconds

dtmfcontrol=on

dtmfaudiogain=62

dtmfactiontimeout=600


All dtmf codes are of the format *xx#.  Only xx isdefined below.  Examples:

dtmfreset=00

To display the controller status screen - includes GPIO pin status (see below)

dtmfstatusview=01

Select quad view

dtmfquadview=04

Select input (when finished, use *00# to return to normal operation)

dtmfselectinput0=10

dtmfselectinput1=11

dtmfselectinput2=12

dtmfselectinput3=13

dtmfselectinput4=14

dtmfselectinput5=15

dtmfselectinput6=16

dtmfselectinput7=17

DTMF Keeper codes

In this example keeper codes are 5 digit and must start with 9 (*9xxxx#)
Turns Tx key on / off

dtmfkeepertxoff=97350

dtmfkeepertxon=97351

Reboot controller

dtmfkeeperreboot=97359

DTMF Accessory Control examples

DTMF input can also be used to control external equipment via the GPIO pins - a maximum of 10 devices can be connected.
Number of outputs

dtmfoutputs=1

Pin allocations

dtmfgpioout1pin=8

Label for status screen

dtmfgpioout1label=shack_light

DTMF commands to turn on and off

dtmfgpioout1on=31

dtmfgpioout1off=41

GPIO inputs

The controller can monitor GPIO pins and display their status on the status screen, displayed by DTMF *01#  Note: Due to an error in coding, these functions are called "dtmf"gpio inputs.
Number of inputs

dtmfinputs=1

Pin allocationa

dtmfgpioin1pin=8

Label for status screen

dtmfgpioin1label=cabinet_door

Background image for Caption Slides

Caption cards such as "K" and input identification are built by the controller on this back ground - to change this, replace the .jpg with a different file of the same resolution

backimage=/home/pi/atv-rptr/media/batc_background.jpg

Ident info

Audio is on/off, Pitch in Hz, speed in wpm, level is %

identinterval=900

identmediatype=jpg

identmediaduration=5

identmediafile=/home/pi/tmp/ident.jpg

identcwaudio=on

identcwspeed=15

identcwpitch=800

identcwlevel=50

identcwfile=/home/pi/tmp/ident.wav

K information

Pitch in Hz, speed in wpm, level is %

kmediatype=jpg

kmediaduration=5

kmediafile=/home/pi/tmp/k.jpg

kcwaudio=on

kcwspeed=20

kcwpitch=800

kcwlevel=50

kcwfile=/home/pi/tmp/k.wav

Carousel information

The carousel can have up to 99 scenes. Each scene can either be jpg, (mp4 not implemented in current release), status screen or a video source on the switcher.  Jpeg images are read each time the file is displayed.  For a video source, "file" is source number which can be an individual source or the multi grid, if supported by the video switch.
carouselscenes=5

carousel01mediatype=jpg
carousel01file=/home/pi/atv-rptr/media/HVtest.jpg
carousel01mediaduration=10

carousel02mediatype=jpg
carousel02file=/home/pi/atv-rptr/media/weather.JPG
carousel02mediaduration=10

carousel03mediatype=jpg
carousel03file=/home/pi/atv-rptr/media/75cbw.jpg
carousel03mediaduration=5

carousel04mediatype=jpg
carousel04file=/home/pi/custom_media/tropo.JPG
carousel04mediaduration=10

carousel05mediatype=source
carousel05file=4
carousel05mediaduration=30

The example above has 4 images and one source (so 5 scenes). The 5th scene is the quad view; source 4 is set up below to show the Quad to enable its inclusion in the carousel.

Note that the 4th image above is located in the /home/pi/custom_media folder. It is recommended that site-specific images are saved in that folder, which will not be over-written during software updates.

Analogue Talkback Audio on Carousel

If using an i2c analogue audio switcher, the talkback audio can be enabled during the carousel

# Analogue talkback audio (144.75) can be turned on or off using the MCP23008 i2c switcher
talkbackaudio=on
talkbackaudioi2cbit=7

If using hdmi audio, the talkback can be input on the USB mic dongle (along with the DTMF) and output on the HDMI audio during the carousel. The audio gain is set by the dtmfaudiogain parameter as they both use the same input. Facility introduced in release 202402190.

# Talkback audio on DTMF input can also be output on the controller (k/cw ident) audio channel
# Volume is set by dtmfaudiogain above
controllertalkbackaudio=on

Input configuration

Recommended gpio pins for "input active" are 32, 35, 18, 22, 16, 19 and 21. The availableinputs number must be set to the number of possibly active (external, in addition to the controller) video sources. activeinputhold (yes/no) means that lower priority inputs do not get replaced by higher priority active inputs (except priority 1 inputs). If showquadformultipleinputs is set to yes, then the quad is sleected when 2 or more if its inputs are active.

Cascaded switches refers to whether 2 4-input switches are daisy chaned t get 7 (controller plus 6 external) inputs.

 availableinputs=6
 activeinputhold=no
 showquadformultipleinputs=yes
 cascadedswitches=no

Output video switch config

The output video switch configuration is defined by this block. The switching method is defined by outputswitchcontrol=. This can be ir, gpio or html. For ir or html, the gpio outputs can also be active if showoutputongpio= is set to yes.

The ir code to reset the hdmi switch (not currently used) is set in outputhdmiresetcode. The ir code to select a second (daisy-chained) hdmi switch is set in output2ndhdmicode. The ir code to select a quad view is set in outputhdmiquadcode.

The outputi2caddress is the base address for an i2c video switch, and the outputi2cquadchannel is the quad select for an i2c video switch. Neither of these codes are currently implemented.

outputswitchcontrol=ir
showoutputongpio=yes
outputhdmiresetcode=nec:0x17
output2ndhdmicode=nec:0x17
outputhdmiquadcode=nec:0x18
outputi2caddress=3
outputi2cquadchannel=9

Bitfocus Companion Server Settings

# Bitfocus Companion (html) server address & port (no trailing slash)
networkctrlurl=http://192.0.1.176:8888
# Other net commands have leading slash
outputquadnetcommand=/press/bank/1/11

Configure input 0 - always allocated to controller

The configuration for the controller output 6 elements (currently).

The input0name is the text name displayed on the Configuration screen.

The IR code required to select the controller video and send it to the repeater output is stated in output0code. The format is protocol:hex code. A 2 is added to the beginning of the string if the the input is on the second, daisy-chained, hdmi switch (ie 2nec:0x17). If GPIO switching of outputs is used, the output0hdmiswitchpin indicates which pin should be used. If an i2c-controlled video switcher is used, output0i2cchannel indicates which channel should be selected to display that input. Similarly, if network commands are being used to control an ATEM switch through BitFocus companion, the tail end of the network command is defined by output0netcommand.

For audio i2c switching, the correct bit is set by output0audioi2cbit.

input0name=Controller
output0code=nec:0x17
#output0code=2nec:0x17 (daisy chain)
output0hdmiswitchpin=36
output0i2cchannel=1
output0netcommand=/press/bank/1/8
output0audioi2cbit=0

Configuration of External Inputs

The configuration for each input has 11 elements (currently).

The inputxname is the text name displayed on the "announce" caption and on the Configuration screen. The priority level can be set from 1 to 9. A priority level of 9 means that the input is not displayed unless it is viewed as part of the quad or is directly selected by a DTMF command.

The inputxactivegpiopin is the physical pin number that the attached receiver sets high to indicate that a signal is present. The IR code required to select the input and send it to the repeater output is stated in outputxcode. The format is protocol:hex code. A 2 is added to the beginning of the string if the the input is on the second, daisy-chained, hdmi switch (ie 2nec:0x12). If GPIO switching of outputs is used, the outputxhdmiswitchpin indicates which pin should be used. If an i2c-controlled video switcher is used, outputxi2cchannel indicates which channel should be selected to display that input. Similarly, if network commands are being used to control an ATEM switch through BitFocus companion, the tail end of the network command is defined by outputxnetcommand.

For audio i2c switching, the correct bit is set by outputxaudioi2cbit.

The default announce media settings work with the captions that are generated during repeater start-up. The can be cahnge for custom media if required.

Configure input 1

input1name=Stream Input
input1prioritylevel=1
input1activegpiopin=32
output1code=nec:0x12
output1hdmiswitchpin=37
output1i2cchannel=2
output1netcommand=/press/bank/1/1
output1audioi2cbit=1
input1announcemediatype=jpg
input1announcemediafile=/home/pi/tmp/input1.jpg
input1announcemediaduration=3

Configure input 2

input2name=QO-100 RX
input2prioritylevel=2
input2activegpiopin=35
output2code=nec:0x59
output2hdmiswitchpin=38
output2i2cchannel=3
output2netcommand=/press/bank/1/2
output2audioi2cbit=2
input2announcemediatype=jpg
input2announcemediafile=/home/pi/tmp/input2.jpg
input2announcemediaduration=3

Configure input 3

input3name=3.4 GHz Ryde
input3prioritylevel=3
input3activegpiopin=18
output3code=nec:0x08
output3hdmiswitchpin=33
output3i2cchannel=4
output3netcommand=/press/bank/1/3
output3audioi2cbit=3
input3announcemediatype=jpg
input3announcemediafile=/home/pi/tmp/input3.jpg
input3announcemediaduration=3

Configure input 4

Input 4 is set to display the quad view. This enables it to be included in the carousel (as source 4).

input4name=Quad View
input4prioritylevel=7
input4activegpiopin=22
output4code=nec:0x18
#output4code=2nec:0x12 (daisy chain, not quad)
output4hdmiswitchpin=31
output4i2cchannel=5
output4netcommand=/press/bank/1/4
output4audioi2cbit=4
input4announcemediatype=jpg
input4announcemediafile=/home/pi/tmp/input4.jpg
input4announcemediaduration=3

Configure input 5

input5name=Mast Camera
input5prioritylevel=7
input5activegpiopin=16
output5code=2nec:0x59
output5hdmiswitchpin=29
output5i2cchannel=6
output5netcommand=/press/bank/1/5
output5audioi2cbit=5
input5announcemediatype=jpg
input5announcemediafile=/home/pi/tmp/input5.jpg
input5announcemediaduration=10

Configure input 6

input6name=Unused 6
input6prioritylevel=9
input6activegpiopin=19
output6code=2nec:0x08
#output6code=2nec:0x08 (daisy chain)
output6hdmiswitchpin=23
output6i2cchannel=7
output6netcommand=/press/bank/1/6
output6audioi2cbit=6
input6announcemediatype=jpg
input6announcemediafile=/home/pi/tmp/input6.jpg
input6announcemediaduration=3

Configure input 7

input7name=Unused 7
input7prioritylevel=9
input7activegpiopin=21
output7code=2nec:0x08
#output7code=2nec:0x12 (daisy chain)
output7hdmiswitchpin=24
output7i2cchannel=8
output7netcommand=/press/bank/1/7
output7audioi2cbit=7
input7announcemediatype=jpg
input7announcemediafile=/home/pi/tmp/input7.jpg
input7announcemediaduration=3