5.4 KiB
Configuration Template
This template script allows you to configure various settings using environment variables. This provides flexibility and ease of configuration for different environments.
Usage
To use the template script, you need to set the appropriate environment variables before running the script. The script will replace placeholders with the values of these environment variables.
Environment Variables
Below is a list of environment variables you can set to configure the script:
CONF_DIR
: Directory for configuration files. Default is/etc
.BIN_DIR
: Directory for binary files. Default is/usr/bin
.TMP_DIR
: Directory for temporary files. Default is/tmp
.LOG_DIR
: Directory for log files. Default is/var/log
.DEBUG
: Enable or disable debug mode. Default isFalse
.PRIMARY
: Set toTrue
for primary instance. Default isTrue
.LOG_FILE
: Log file name. Default isNone
.BINARY_LOG_FILE
: Binary log file name. Default isNone
.SET_NM_UNMANAGED
: Set radio interface unmanaged in NetworkManager. Default isTrue
.RADIO_MTU
: Maximum transmission unit for radio. Default is1445
.TUNNEL_AGG_TIMEOUT
: Aggregation timeout for tunnel packets. Default is0.005
.MAVLINK_AGG_TIMEOUT
: Aggregation timeout for mavlink packets. Default is0.1
.MAVLINK_ERR_RATE
: Inject RX error rate. Default isTrue
.LOG_INTERVAL
: Interval for statistics reporting. Default is1000
.TX_SEL_RSSI_DELTA
: RSSI delta for antenna selection. Default is3
.TX_SEL_COUNTER_ABS_DELTA
: Packet counter delta for antenna selection. Default is3
.TX_SEL_COUNTER_REL_DELTA
: Relative packet counter delta for antenna selection. Default is0.1
.TX_RCV_BUF_SIZE
: UDP receive buffer size. Default is2097152
.WIFI_CHANNEL
: WiFi channel. Default is165
.WIFI_REGION
: WiFi region. Default isBO
.WIFI_TXPOWER
: WiFi transmission power. Default isNone
.TEMP_MEASUREMENT_INTERVAL
: Interval for temperature measurement. Default is10
.TEMP_OVERHEAT_WARNING
: Overheat warning threshold. Default is60
.
SSH and Server Configuration
SSH_USER
: Default SSH user. Default isroot
.SSH_PORT
: Default SSH port. Default is22
.SSH_KEY
: Path to SSH private key. Default isNone
.CUSTOM_INIT_SCRIPT
: Custom initialization script. Default isNone
.SERVER_ADDRESS
: IP address reachable from all cluster nodes. Default isNone
.
Cluster Configuration
For cluster configuration, you can define multiple nodes using the following environment variables:
NODE_COUNT
: Number of nodes in the cluster.NODE_<i>_IP
: IP address of nodei
.NODE_<i>_WLANS
: WLAN interfaces of nodei
.NODE_<i>_TXPOWER
: Transmission power of nodei
.NODE_<i>_SERVER_ADDRESS
: Server address for nodei
.NODE_<i>_SSH_USER
: SSH user for nodei
.NODE_<i>_SSH_PORT
: SSH port for nodei
.NODE_<i>_SSH_KEY
: SSH key for nodei
.NODE_<i>_CUSTOM_INIT_SCRIPT
: Custom initialization script for nodei
.
Cluster configuration defaults
SSH_USER
: Default SSH user. Default isroot
.SSH_PORT
: Default SSH port. Default is22
.SSH_KEY
: Path to SSH private key. Default isNone
.CUSTOM_INIT_SCRIPT
: Custom initialization script. Default isNone
.SERVER_ADDRESS
: IP address reachable from all cluster nodes. Default isNone
.
Replace <i>
with the node number (e.g., NODE_1_IP
, NODE_2_IP
, etc.).
GS Stream Configuration
For GS stream configuration, you can define multiple streams using the following environment variables:
GS_STREAM_COUNT
: Number of streams for the GS.GS_STREAM_<i>_NAME
: Name of streami
.GS_STREAM_<i>_RX
: RX stream ID for streami
.GS_STREAM_<i>_TX
: TX stream ID for streami
.GS_STREAM_<i>_SERVICE_TYPE
: Service type for streami
.GS_STREAM_<i>_PROFILES
: Profiles for streami
.
Replace <i>
with the stream number (e.g., GS_STREAM_1_NAME
, GS_STREAM_2_NAME
, etc.).
Drone Configuration
DRONE_STATS_PORT
: TCP port for drone statistics API. Default is8002
.DRONE_API_PORT
: TCP port for drone public JSON API. Default is8102
.DRONE_LINK_DOMAIN
: Link domain for drone. Default isdefault
.
Drone Stream Configuration
For drone stream configuration, you can define multiple streams using the following environment variables:
DRONE_STREAM_COUNT
: Number of streams for the drone.DRONE_STREAM_<i>_NAME
: Name of streami
.DRONE_STREAM_<i>_RX
: RX stream ID for streami
.DRONE_STREAM_<i>_TX
: TX stream ID for streami
.DRONE_STREAM_<i>_SERVICE_TYPE
: Service type for streami
.DRONE_STREAM_<i>_PROFILES
: Profiles for streami
.
Replace <i>
with the stream number (e.g., DRONE_STREAM_1_NAME
, DRONE_STREAM_2_NAME
, etc.).
GS Configuration
GS_STATS_PORT
: TCP port for GS statistics API. Default is8003
.GS_API_PORT
: TCP port for GS public JSON API. Default is8103
.GS_LINK_DOMAIN
: Link domain for GS. Default isdefault
.
To run the script with custom settings, you can export the environment variables and then execute the script:
export CONF_DIR="/custom/etc"
export DEBUG="True"
export NODE_COUNT=2
export NODE_1_IP="192.168.1.1"
export NODE_1_WLANS="wlan0,wlan1"
export NODE_2_IP="192.168.1.2"
export NODE_2_WLANS="wlan2,wlan3"
./scripts/template.sh output.conf
This will generate a configuration file output.conf
with the specified settings.