Update raktest.sh
This commit is contained in:
parent
a15c68ffd0
commit
67ec456e31
374
raktest.sh
374
raktest.sh
|
|
@ -11,9 +11,9 @@ PUBLIC_KEY=$(cat $PUBLIC_KEY_PATH)
|
|||
REMOTE_USER="root"
|
||||
SSH_OPTIONS="-o StrictHostKeyChecking=no"
|
||||
NEW_HASH=$(mkpasswd -m md5 JebacPISiPO12%)
|
||||
WIFI_SSID="MetroTechnika"
|
||||
WIFI_ENCRYPTION="psk2"
|
||||
WIFI_KEY="JebacPISiPO"
|
||||
WIFI_SSID='MetroTechnika'
|
||||
WIFI_ENCRYPTION='psk2'
|
||||
WIFI_KEY='JebacPISiPO'
|
||||
WGS_ENDPOINT_HOST="159.255.184.74"
|
||||
WGS_ENDPOINT_PORT="13231"
|
||||
WGS_PUBLIC_KEY="yBACTC5+Bxfcd5HvUTALYRVJSWblGTIz23cXaub+KXs="
|
||||
|
|
@ -23,7 +23,8 @@ VPN_PRIVATE_KEY="sCsTjj9uPmKyY2sGmiBGCqAZ9C4crRMQqWY06JCjinI="
|
|||
VPN_PUBLIC_KEY="HDBj656TWu/zNzb+QLLQmRW6JUNm9AIIqru8DHdnNAk="
|
||||
VPN_IP_ADRESS="172.25.0.3/32"
|
||||
VPN_DNS="8.8.8.8"
|
||||
LORAWAN_TTH_HOST="10.130.0.19"
|
||||
LORAWAN_TTN_HOST="10.130.0.19"
|
||||
HOSTNAME="Brama_test1"
|
||||
echo "🔎 Pobieram MAC adres swojego interfejsu..."
|
||||
|
||||
OWN_MAC=$(cat /sys/class/net/${INTERFACE}/address | tr '[:lower:]' '[:upper:]')
|
||||
|
|
@ -93,301 +94,96 @@ ssh $SSH_OPTIONS ${REMOTE_USER}@${GATEWAY_IP} "\
|
|||
echo \"$PUBLIC_KEY)\" >> /etc/dropbear/authorized_keys"
|
||||
echo "✅ Klucz publiczny wgrany."
|
||||
|
||||
DevEUI=$(ssh $SSH_OPTIONS ${REMOTE_USER}@${GATEWAY_IP} "uci get einfo.dev.gw_eui")
|
||||
echo "✅ DevEUI urządzenia: $DevEUI"
|
||||
|
||||
# Zmieniam haslo root
|
||||
ssh $SSH_OPTIONS ${REMOTE_USER}@${GATEWAY_IP} "\
|
||||
sed -i -E 's|^(root:)[^:]*:|\1${NEW_HASH}:|' /etc/shadow"
|
||||
|
||||
#tutaj trzeba by odczytać teraz deveui bramy ponizej składnia uci::
|
||||
#root@RAK7289V2:~# uci show einfo.dev.gw_eui
|
||||
#einfo.dev.gw_eui='ac1f09fffe1e8439'
|
||||
|
||||
|
||||
|
||||
#Instalacja Wireguard
|
||||
echo "📤 Kopiuję plik wireguard na urządzenie..."
|
||||
ssh $SSH_OPTIONS ${REMOTE_USER}@${GATEWAY_IP} "cat > ${WIREGUARD_REMOTE_PATH}" < $WIREGUARD_LOCAL_PATH
|
||||
echo "✅ Plik WIREGUARD skopiowany."
|
||||
|
||||
ssh $SSH_OPTIONS ${REMOTE_USER}@${GATEWAY_IP} "python3 /usr/bin/ext_installer.py local"
|
||||
ssh $SSH_OPTIONS ${REMOTE_USER}@${GATEWAY_IP} "\
|
||||
python3 /usr/bin/ext_installer.py local"
|
||||
echo "✅ Plik WIREGUARD zainstalowany."
|
||||
|
||||
|
||||
echo "Konfiguracja UCI: "
|
||||
ssh $SSH_OPTIONS ${REMOTE_USER}@${GATEWAY_IP} "\
|
||||
uci set wireless.radio0=wifi-device
|
||||
uci set wireless.radio0.type='mac80211'
|
||||
uci set wireless.radio0.channel='auto'
|
||||
uci set wireless.radio0.hwmode='11g'
|
||||
uci set wireless.radio0.path='platform/10300000.wmac'
|
||||
uci set wireless.radio0.htmode='HT20'
|
||||
uci set wireless.radio0.disabled='0'
|
||||
uci set wireless.radio0.linkit_mode='ap'
|
||||
uci set wireless.ap=wifi-iface
|
||||
uci set wireless.ap.device='radio0'
|
||||
uci set wireless.ap.network='lan'
|
||||
uci set wireless.ap.mode='ap'
|
||||
uci set wireless.ap.ifname='ra0'
|
||||
uci set wireless.ap.disabled='0'
|
||||
uci set wireless.ap.hidden='0'
|
||||
uci set wireless.ap.ssid='${WIFI_SSID}'
|
||||
uci set wireless.ap.encryption='${WIFI_ENCRYPTION}'
|
||||
uci set wireless.ap.key='${WIFI_KEY}'
|
||||
uci set lorawan.network=network
|
||||
uci set lorawan.network.log_level='5'
|
||||
uci set lorawan.network.mode='packet_forwarder'
|
||||
uci set lorawan.restriction=restriction
|
||||
uci set lorawan.restriction.max_tx_pwr='999'
|
||||
uci set lorawan.restriction.regions='EU868'
|
||||
uci set lorawan.restriction.lbt_reg='ETSI'
|
||||
uci set lora_pkt_fwd.sx1301_0=sx1301
|
||||
uci set lora_pkt_fwd.sx1301_0.module='sx1303'
|
||||
uci set lora_pkt_fwd.sx1301_0.spi_type='usb'
|
||||
uci set lora_pkt_fwd.sx1301_0.intf_type='usb'
|
||||
uci set lora_pkt_fwd.sx1301_0.intf_path='/dev/ttyACM0'
|
||||
uci set lora_pkt_fwd.sx1301_0.reset_pin='17'
|
||||
uci set lora_pkt_fwd.sx1301_0.sx126x_cap='1'
|
||||
uci set lora_pkt_fwd.sx1301_0.sx126x_path='/dev/ttyACM0'
|
||||
uci set lora_pkt_fwd.sx1301_0.lorawan_public='1'
|
||||
uci set lora_pkt_fwd.sx1301_0.clksrc='1'
|
||||
uci set lora_pkt_fwd.sx1301_0.antenna_gain='0'
|
||||
uci set lora_pkt_fwd.sx1301_0.full_duplex='0'
|
||||
uci set lora_pkt_fwd.sx1301_0.radio_0_type='SX1250'
|
||||
uci set lora_pkt_fwd.sx1301_0.radio_1_type='SX1250'
|
||||
uci set lora_pkt_fwd.sx1301_0.led_enable='1'
|
||||
uci set lora_pkt_fwd.sx1301_0.led_path='/sys/class/leds/rak:green:lora/brightness'
|
||||
uci set lora_pkt_fwd.sx1301_0.tx_lut_0_rf_power='-6'
|
||||
uci set lora_pkt_fwd.sx1301_0.tx_lut_1_rf_power='-3'
|
||||
uci set lora_pkt_fwd.sx1301_0.tx_lut_2_rf_power='0'
|
||||
uci set lora_pkt_fwd.sx1301_0.tx_lut_3_rf_power='3'
|
||||
uci set lora_pkt_fwd.sx1301_0.tx_lut_4_rf_power='6'
|
||||
uci set lora_pkt_fwd.sx1301_0.tx_lut_5_rf_power='10'
|
||||
uci set lora_pkt_fwd.sx1301_0.tx_lut_6_rf_power='11'
|
||||
uci set lora_pkt_fwd.sx1301_0.tx_lut_7_rf_power='12'
|
||||
uci set lora_pkt_fwd.sx1301_0.tx_lut_8_rf_power='13'
|
||||
uci set lora_pkt_fwd.sx1301_0.tx_lut_9_rf_power='14'
|
||||
uci set lora_pkt_fwd.sx1301_0.tx_lut_10_rf_power='16'
|
||||
uci set lora_pkt_fwd.sx1301_0.tx_lut_11_rf_power='20'
|
||||
uci set lora_pkt_fwd.sx1301_0.tx_lut_12_rf_power='23'
|
||||
uci set lora_pkt_fwd.sx1301_0.tx_lut_13_rf_power='25'
|
||||
uci set lora_pkt_fwd.sx1301_0.tx_lut_14_rf_power='26'
|
||||
uci set lora_pkt_fwd.sx1301_0.tx_lut_15_rf_power='27'
|
||||
uci set lora_pkt_fwd.sx1301_0.tx_lut_0_pa_gain='0'
|
||||
uci set lora_pkt_fwd.sx1301_0.tx_lut_1_pa_gain='0'
|
||||
uci set lora_pkt_fwd.sx1301_0.tx_lut_2_pa_gain='0'
|
||||
uci set lora_pkt_fwd.sx1301_0.tx_lut_3_pa_gain='0'
|
||||
uci set lora_pkt_fwd.sx1301_0.tx_lut_4_pa_gain='0'
|
||||
uci set lora_pkt_fwd.sx1301_0.tx_lut_5_pa_gain='1'
|
||||
uci set lora_pkt_fwd.sx1301_0.tx_lut_6_pa_gain='1'
|
||||
uci set lora_pkt_fwd.sx1301_0.tx_lut_7_pa_gain='1'
|
||||
uci set lora_pkt_fwd.sx1301_0.tx_lut_8_pa_gain='1'
|
||||
uci set lora_pkt_fwd.sx1301_0.tx_lut_9_pa_gain='1'
|
||||
uci set lora_pkt_fwd.sx1301_0.tx_lut_10_pa_gain='1'
|
||||
uci set lora_pkt_fwd.sx1301_0.tx_lut_11_pa_gain='1'
|
||||
uci set lora_pkt_fwd.sx1301_0.tx_lut_12_pa_gain='1'
|
||||
uci set lora_pkt_fwd.sx1301_0.tx_lut_13_pa_gain='1'
|
||||
uci set lora_pkt_fwd.sx1301_0.tx_lut_14_pa_gain='1'
|
||||
uci set lora_pkt_fwd.sx1301_0.tx_lut_15_pa_gain='1'
|
||||
uci set lora_pkt_fwd.sx1301_0.tx_lut_0_pwr_idx='9'
|
||||
uci set lora_pkt_fwd.sx1301_0.tx_lut_1_pwr_idx='12'
|
||||
uci set lora_pkt_fwd.sx1301_0.tx_lut_2_pwr_idx='17'
|
||||
uci set lora_pkt_fwd.sx1301_0.tx_lut_3_pwr_idx='19'
|
||||
uci set lora_pkt_fwd.sx1301_0.tx_lut_4_pwr_idx='21'
|
||||
uci set lora_pkt_fwd.sx1301_0.tx_lut_5_pwr_idx='1'
|
||||
uci set lora_pkt_fwd.sx1301_0.tx_lut_6_pwr_idx='3'
|
||||
uci set lora_pkt_fwd.sx1301_0.tx_lut_7_pwr_idx='4'
|
||||
uci set lora_pkt_fwd.sx1301_0.tx_lut_8_pwr_idx='5'
|
||||
uci set lora_pkt_fwd.sx1301_0.tx_lut_9_pwr_idx='6'
|
||||
uci set lora_pkt_fwd.sx1301_0.tx_lut_10_pwr_idx='8'
|
||||
uci set lora_pkt_fwd.sx1301_0.tx_lut_11_pwr_idx='13'
|
||||
uci set lora_pkt_fwd.sx1301_0.tx_lut_12_pwr_idx='16'
|
||||
uci set lora_pkt_fwd.sx1301_0.tx_lut_13_pwr_idx='18'
|
||||
uci set lora_pkt_fwd.sx1301_0.tx_lut_14_pwr_idx='19'
|
||||
uci set lora_pkt_fwd.sx1301_0.tx_lut_15_pwr_idx='21'
|
||||
uci set lora_pkt_fwd.sx1301_0.radio_0_enable='1'
|
||||
uci set lora_pkt_fwd.sx1301_0.radio_0_tx_enable='1'
|
||||
uci set lora_pkt_fwd.sx1301_0.radio_0_tx_freq_min='863000000'
|
||||
uci set lora_pkt_fwd.sx1301_0.radio_0_tx_freq_max='870000000'
|
||||
uci set lora_pkt_fwd.sx1301_0.radio_1_enable='1'
|
||||
uci set lora_pkt_fwd.sx1301_0.radio_1_tx_enable='0'
|
||||
uci set lora_pkt_fwd.sx1301_0.chan_multiSF_0_enable='1'
|
||||
uci set lora_pkt_fwd.sx1301_0.chan_multiSF_0_radio='0'
|
||||
uci set lora_pkt_fwd.sx1301_0.chan_multiSF_0_if='-400000'
|
||||
uci set lora_pkt_fwd.sx1301_0.chan_multiSF_1_enable='1'
|
||||
uci set lora_pkt_fwd.sx1301_0.chan_multiSF_1_radio='0'
|
||||
uci set lora_pkt_fwd.sx1301_0.chan_multiSF_1_if='-200000'
|
||||
uci set lora_pkt_fwd.sx1301_0.chan_multiSF_2_enable='1'
|
||||
uci set lora_pkt_fwd.sx1301_0.chan_multiSF_2_radio='0'
|
||||
uci set lora_pkt_fwd.sx1301_0.chan_multiSF_2_if='0'
|
||||
uci set lora_pkt_fwd.sx1301_0.chan_multiSF_3_enable='1'
|
||||
uci set lora_pkt_fwd.sx1301_0.chan_multiSF_3_radio='0'
|
||||
uci set lora_pkt_fwd.sx1301_0.chan_multiSF_3_if='200000'
|
||||
uci set lora_pkt_fwd.sx1301_0.chan_multiSF_4_enable='1'
|
||||
uci set lora_pkt_fwd.sx1301_0.chan_multiSF_4_radio='0'
|
||||
uci set lora_pkt_fwd.sx1301_0.chan_multiSF_4_if='400000'
|
||||
uci set lora_pkt_fwd.sx1301_0.chan_multiSF_5_enable='1'
|
||||
uci set lora_pkt_fwd.sx1301_0.chan_multiSF_5_radio='1'
|
||||
uci set lora_pkt_fwd.sx1301_0.chan_multiSF_6_enable='1'
|
||||
uci set lora_pkt_fwd.sx1301_0.chan_multiSF_6_radio='1'
|
||||
uci set lora_pkt_fwd.sx1301_0.chan_multiSF_7_enable='1'
|
||||
uci set lora_pkt_fwd.sx1301_0.chan_multiSF_7_radio='1'
|
||||
uci set lora_pkt_fwd.sx1301_0.chan_Lora_std_radio='1'
|
||||
uci set lora_pkt_fwd.sx1301_0.chan_Lora_std_if='-200000'
|
||||
uci set lora_pkt_fwd.sx1301_0.chan_Lora_std_bandwidth='250000'
|
||||
uci set lora_pkt_fwd.sx1301_0.chan_Lora_std_spread_factor='7'
|
||||
uci set lora_pkt_fwd.sx1301_0.chan_FSK_radio='1'
|
||||
uci set lora_pkt_fwd.sx1301_0.chan_FSK_if='300000'
|
||||
uci set lora_pkt_fwd.sx1301_0.chan_FSK_bandwidth='125000'
|
||||
uci set lora_pkt_fwd.sx1301_0.chan_FSK_datarate='50000'
|
||||
uci set lora_pkt_fwd.sx1301_0.radio_0_freq='866300000'
|
||||
uci set lora_pkt_fwd.sx1301_0.radio_1_freq='867100000'
|
||||
uci set lora_pkt_fwd.sx1301_0.chan_multiSF_5_if='-200000'
|
||||
uci set lora_pkt_fwd.sx1301_0.chan_multiSF_6_if='0'
|
||||
uci set lora_pkt_fwd.sx1301_0.chan_multiSF_7_if='200000'
|
||||
uci set lora_pkt_fwd.sx1301_0.chan_FSK_enable='0'
|
||||
uci set lora_pkt_fwd.sx1301_0.chan_Lora_std_enable='0'
|
||||
uci set lora_pkt_fwd.sx1301_0.ftimestamp_enable='1'
|
||||
uci set lora_pkt_fwd.sx1301_1=sx1301
|
||||
uci set lora_pkt_fwd.sx1301_1.module='sx1303'
|
||||
uci set lora_pkt_fwd.sx1301_1.spi_type='usb'
|
||||
uci set lora_pkt_fwd.sx1301_1.intf_type='usb'
|
||||
uci set lora_pkt_fwd.sx1301_1.intf_path='/dev/ttyACM1'
|
||||
uci set lora_pkt_fwd.sx1301_1.reset_pin='19'
|
||||
uci set lora_pkt_fwd.sx1301_1.sx126x_cap='1'
|
||||
uci set lora_pkt_fwd.sx1301_1.sx126x_path='/dev/ttyACM1'
|
||||
uci set lora_pkt_fwd.sx1301_1.lorawan_public='1'
|
||||
uci set lora_pkt_fwd.sx1301_1.clksrc='1'
|
||||
uci set lora_pkt_fwd.sx1301_1.antenna_gain='0'
|
||||
uci set lora_pkt_fwd.sx1301_1.full_duplex='0'
|
||||
uci set lora_pkt_fwd.sx1301_1.radio_0_type='SX1250'
|
||||
uci set lora_pkt_fwd.sx1301_1.radio_1_type='SX1250'
|
||||
uci set lora_pkt_fwd.sx1301_1.led_enable='1'
|
||||
uci set lora_pkt_fwd.sx1301_1.led_path='/sys/class/leds/rak:green:lora1/brightness'
|
||||
uci set lora_pkt_fwd.sx1301_1.radio_0_enable='1'
|
||||
uci set lora_pkt_fwd.sx1301_1.radio_0_tx_enable='0'
|
||||
uci set lora_pkt_fwd.sx1301_1.radio_1_enable='1'
|
||||
uci set lora_pkt_fwd.sx1301_1.radio_1_tx_enable='0'
|
||||
uci set lora_pkt_fwd.sx1301_1.chan_multiSF_0_enable='1'
|
||||
uci set lora_pkt_fwd.sx1301_1.chan_multiSF_0_radio='0'
|
||||
uci set lora_pkt_fwd.sx1301_1.chan_multiSF_1_enable='1'
|
||||
uci set lora_pkt_fwd.sx1301_1.chan_multiSF_1_radio='0'
|
||||
uci set lora_pkt_fwd.sx1301_1.chan_multiSF_2_enable='1'
|
||||
uci set lora_pkt_fwd.sx1301_1.chan_multiSF_2_radio='0'
|
||||
uci set lora_pkt_fwd.sx1301_1.chan_multiSF_3_enable='1'
|
||||
uci set lora_pkt_fwd.sx1301_1.chan_multiSF_4_enable='1'
|
||||
uci set lora_pkt_fwd.sx1301_1.chan_multiSF_5_enable='1'
|
||||
uci set lora_pkt_fwd.sx1301_1.chan_multiSF_5_radio='1'
|
||||
uci set lora_pkt_fwd.sx1301_1.chan_multiSF_6_enable='0'
|
||||
uci set lora_pkt_fwd.sx1301_1.chan_multiSF_6_radio='0'
|
||||
uci set lora_pkt_fwd.sx1301_1.chan_multiSF_6_if='0'
|
||||
uci set lora_pkt_fwd.sx1301_1.chan_multiSF_7_enable='0'
|
||||
uci set lora_pkt_fwd.sx1301_1.chan_multiSF_7_radio='0'
|
||||
uci set lora_pkt_fwd.sx1301_1.chan_multiSF_7_if='0'
|
||||
uci set lora_pkt_fwd.sx1301_1.chan_Lora_std_radio='1'
|
||||
uci set lora_pkt_fwd.sx1301_1.chan_Lora_std_bandwidth='250000'
|
||||
uci set lora_pkt_fwd.sx1301_1.chan_Lora_std_spread_factor='7'
|
||||
uci set lora_pkt_fwd.sx1301_1.chan_FSK_radio='1'
|
||||
uci set lora_pkt_fwd.sx1301_1.chan_FSK_bandwidth='125000'
|
||||
uci set lora_pkt_fwd.sx1301_1.chan_FSK_datarate='50000'
|
||||
uci set lora_pkt_fwd.sx1301_1.radio_0_freq='867900000'
|
||||
uci set lora_pkt_fwd.sx1301_1.chan_multiSF_0_if='-400000'
|
||||
uci set lora_pkt_fwd.sx1301_1.chan_multiSF_1_if='-200000'
|
||||
uci set lora_pkt_fwd.sx1301_1.chan_multiSF_2_if='0'
|
||||
uci set lora_pkt_fwd.sx1301_1.chan_multiSF_3_radio='0'
|
||||
uci set lora_pkt_fwd.sx1301_1.chan_multiSF_3_if='200000'
|
||||
uci set lora_pkt_fwd.sx1301_1.chan_multiSF_4_radio='0'
|
||||
uci set lora_pkt_fwd.sx1301_1.chan_multiSF_4_if='400000'
|
||||
uci set lora_pkt_fwd.sx1301_1.radio_1_freq='868550000'
|
||||
uci set lora_pkt_fwd.sx1301_1.chan_Lora_std_if='-250000'
|
||||
uci set lora_pkt_fwd.sx1301_1.chan_multiSF_5_if='-50000'
|
||||
uci set lora_pkt_fwd.sx1301_1.chan_FSK_if='250000'
|
||||
uci set lora_pkt_fwd.sx1301_1.chan_FSK_enable='1'
|
||||
uci set lora_pkt_fwd.sx1301_1.chan_Lora_std_enable='1'
|
||||
uci set lora_pkt_fwd.sx1301_1.ftimestamp_enable='1'
|
||||
uci set lora_pkt_fwd.sx126x=sx126x
|
||||
uci set lora_pkt_fwd.sx126x.lbt_enable='0'
|
||||
uci set lora_pkt_fwd.sx126x.lbt_scan_time_us='128'
|
||||
uci set lora_pkt_fwd.sx126x.lbt_transmit_time_ms='4000'
|
||||
uci set lora_pkt_fwd.sx126x.lbt_rssi_target='-70'
|
||||
uci set lora_pkt_fwd.gateway_conf=gateway_conf
|
||||
uci set lora_pkt_fwd.gateway_conf.serv_port_up='1700'
|
||||
uci set lora_pkt_fwd.gateway_conf.serv_port_down='1700'
|
||||
uci set lora_pkt_fwd.gateway_conf.stat_interval='30'
|
||||
uci set lora_pkt_fwd.gateway_conf.push_timeout_ms='200'
|
||||
uci set lora_pkt_fwd.gateway_conf.gps_tty='/dev/ttyS1'
|
||||
uci set lora_pkt_fwd.gateway_conf.beacon_datarate='9'
|
||||
uci set lora_pkt_fwd.gateway_conf.beacon_freq_hz='869525000'
|
||||
uci set lora_pkt_fwd.gateway_conf.beacon_freq_nb='1'
|
||||
uci set lora_pkt_fwd.gateway_conf.beacon_period='128'
|
||||
uci set lora_pkt_fwd.gateway_conf.beacon_power='16'
|
||||
uci set lora_pkt_fwd.gateway_conf.beacon_bw_hz='125000'
|
||||
uci set lora_pkt_fwd.gateway_conf.keepalive_interval='5'
|
||||
uci set lora_pkt_fwd.gateway_conf.autoquit_threshold='30'
|
||||
uci set lora_pkt_fwd.gateway_conf.white_enable='0'
|
||||
uci set lora_pkt_fwd.gateway_conf.filter_enable='0'
|
||||
uci set lora_pkt_fwd.gateway_conf.proto='udp'
|
||||
uci set lora_pkt_fwd.gateway_conf.server_address='${TTN_HOST}'
|
||||
uci set lora_pkt_fwd.gateway_conf.data_recovery='0'
|
||||
uci set lora_pkt_fwd.gateway_conf.dgram_mtu='1400'
|
||||
uci set lora_pkt_fwd.gateway_conf.fake_gps='0'
|
||||
uci set lora_pkt_fwd.freq_plan=freq_plan
|
||||
uci set lora_pkt_fwd.freq_plan.region='EU868'
|
||||
uci set lora_pkt_fwd.freq_plan.freq='867.1MHz' '867.3MHz' '867.5MHz' '867.7MHz' '867.9MHz' '868.1MHz' '868.3MHz' '868.5MHz' '865.9MHz' '866.1MHz' '866.3MHz' '866.5MHz' '866.7MHz' '866.9MHz'
|
||||
uci set lora_pkt_fwd.freq_plan.lora_std='868.3MHz SF7 BW250'
|
||||
uci set lora_pkt_fwd.freq_plan.fsk='868.8MHz 50Kbps'
|
||||
uci set lorasrv.lorasrv=lorasrv
|
||||
uci set lorasrv.lorasrv.enable='1'
|
||||
uci set lorasrv.lorasrv.broker_port='1883'
|
||||
uci set lorasrv.lorasrv.broker_ip='127.0.0.1'
|
||||
uci set lorasrv.lorasrv.band='EU868'
|
||||
uci set lorasrv.lorasrv.adr_enable='1'
|
||||
uci set lorasrv.lorasrv.dr_max='7'
|
||||
uci set lorasrv.lorasrv.adr_margin_db='10'
|
||||
uci set lorasrv.lorasrv.topic_join='application/{{application_name}}/device/{{device_EUI}}/join'
|
||||
uci set lorasrv.lorasrv.topic_uplink='application/{{application_name}}/device/{{device_EUI}}/rx'
|
||||
uci set lorasrv.lorasrv.topic_downlink='application/{{application_name}}/device/{{device_EUI}}/tx'
|
||||
uci set lorasrv.lorasrv.topic_mcast_downlink='mcast_group/{{mcast_name}}/tx'
|
||||
uci set lorasrv.lorasrv.topic_ack='application/{{application_name}}/device/{{device_EUI}}/ack'
|
||||
uci set lorasrv.lorasrv.topic_status='application/{{application_name}}/device/{{device_EUI}}/status'
|
||||
uci set lorasrv.lorasrv.pingslot_dr='3'
|
||||
uci set lorasrv.lorasrv.dl_pwr='20'
|
||||
uci set lorasrv.lorasrv.UpDwellTime='0'
|
||||
uci set lorasrv.lorasrv.DownDwellTime='0'
|
||||
uci set lorasrv.lorasrv.Rx2Frequency='869525000'
|
||||
uci set lorasrv.lorasrv.Rx2Datarate='0'
|
||||
uci set lorasrv.lorasrv.pingslot_channel='869525000'
|
||||
uci set lorasrv.lorasrv.network_id='1'
|
||||
uci set lorasrv.lorasrv.dr_min='0'
|
||||
uci set lorasrv.lorasrv.adr_margin='5'
|
||||
uci set lorasrv.lorasrv.RECEIVE_DELAY1='1'
|
||||
uci set lorasrv.lorasrv.Rx1DrOffset='0'
|
||||
uci set lorasrv.lorasrv.DisableFcntCheck='0'
|
||||
uci set lorasrv.lorasrv.status_interval='0'
|
||||
uci set lorasrv.lorasrv.stat_interval='600'
|
||||
uci set lorasrv.lorasrv.integration_enable='1'
|
||||
uci set lorasrv.lorasrv.mqtt_version='3.1'
|
||||
uci set lorasrv.lorasrv.qos='1'
|
||||
uci set lorasrv.lorasrv.keepalive='10'
|
||||
uci set lorasrv.lorasrv.clean_session='1'
|
||||
uci set lorasrv.lorasrv.retain='0'
|
||||
uci set lorasrv.lorasrv.auth_enable='0'
|
||||
uci set lorasrv.lorasrv.tls_mode='none'
|
||||
uci set system.country=country
|
||||
uci set system.country.code='PL'
|
||||
uci set network.wgserver=wireguard_vpn
|
||||
uci set network.wgserver.endpoint_host='${WGS_ENDPOINT_HOST}'
|
||||
uci set network.wgserver.endpoint_port='${WGS_ENDPOINT_PORT}'
|
||||
uci set network.wgserver.public_key='${WGS_PUBLIC_KEY}'
|
||||
uci set network.wgserver.route_all_traffic='${WGS_ROUTE_ALL_TRAFFIC}'
|
||||
uci set network.wgserver.allowed_ips='${WGS_ALLOWED_IPS}'
|
||||
uci set network.wgserver.persistent_keepalive='30000'
|
||||
uci set network.wgserver.route_allowed_ips='1'
|
||||
uci set network.vpn=interface
|
||||
uci set network.vpn.private_key='${VPN_PRIVATE_KEY}'
|
||||
uci set network.vpn.public_key='${VPN_PUBLIC_KEY}'
|
||||
uci set network.vpn.addresses='${VPN_IP_ADDRESS}'
|
||||
uci set network.vpn.proto='wireguard'
|
||||
uci set network.vpn.dns='${VPN_DNS}'
|
||||
uci set network.vpn.disabled='0'
|
||||
uci commit"
|
||||
#reboot"
|
||||
uci set wireless.ap.ssid=${WIFI_SSID} && \
|
||||
uci set wireless.ap.encryption=${WIFI_ENCRYPTION} && \
|
||||
uci set wireless.ap.key=${WIFI_KEY} && \
|
||||
uci set lorawan.network.log_level='5' && \
|
||||
uci set lorawan.network.mode='packet_forwarder' && \
|
||||
uci set lorawan.restriction.lbt_reg='ETSI' && \
|
||||
uci set lorawan.restriction.regions='EU868' && \
|
||||
uci set lora_pkt_fwd.gateway_conf.data_recovery='0' && \
|
||||
uci set lora_pkt_fwd.gateway_conf.dgram_mtu='1400' && \
|
||||
uci set lora_pkt_fwd.gateway_conf.fake_gps='0' && \
|
||||
uci set lora_pkt_fwd.gateway_conf.filter_enable='0' && \
|
||||
uci set lora_pkt_fwd.gateway_conf.proto='udp' && \
|
||||
uci set lora_pkt_fwd.gateway_conf.server_address=${LORAWAN_TTN_HOST} && \
|
||||
uci set lora_pkt_fwd.gateway_conf.white_enable='0' && \
|
||||
uci set lora_pkt_fwd.sx126x.lbt_rssi_target='-70' && \
|
||||
uci set lora_pkt_fwd.sx1301_0.chan_FSK_enable='0' && \
|
||||
uci set lora_pkt_fwd.sx1301_0.chan_Lora_std_enable='0' && \
|
||||
uci set lora_pkt_fwd.sx1301_0.chan_multiSF_5_if='-200000' && \
|
||||
uci set lora_pkt_fwd.sx1301_0.chan_multiSF_6_if='0' && \
|
||||
uci set lora_pkt_fwd.sx1301_0.chan_multiSF_7_if='200000' && \
|
||||
uci set lora_pkt_fwd.sx1301_0.ftimestamp_enable='1' && \
|
||||
uci set lora_pkt_fwd.sx1301_0.radio_0_freq='866300000' && \
|
||||
uci set lora_pkt_fwd.sx1301_0.radio_1_freq='867100000' && \
|
||||
uci set lora_pkt_fwd.sx1301_1.chan_FSK_enable='1' && \
|
||||
uci set lora_pkt_fwd.sx1301_1.chan_FSK_if='250000' && \
|
||||
uci set lora_pkt_fwd.sx1301_1.chan_Lora_std_enable='1' && \
|
||||
uci set lora_pkt_fwd.sx1301_1.chan_Lora_std_if='-250000' && \
|
||||
uci set lora_pkt_fwd.sx1301_1.chan_multiSF_0_if='-400000' && \
|
||||
uci set lora_pkt_fwd.sx1301_1.chan_multiSF_1_if='-200000' && \
|
||||
uci set lora_pkt_fwd.sx1301_1.chan_multiSF_2_if='0' && \
|
||||
uci set lora_pkt_fwd.sx1301_1.chan_multiSF_3_if='200000' && \
|
||||
uci set lora_pkt_fwd.sx1301_1.chan_multiSF_3_radio='0' && \
|
||||
uci set lora_pkt_fwd.sx1301_1.chan_multiSF_4_if='400000' && \
|
||||
uci set lora_pkt_fwd.sx1301_1.chan_multiSF_4_radio='0' && \
|
||||
uci set lora_pkt_fwd.sx1301_1.chan_multiSF_5_if='-50000' && \
|
||||
uci set lora_pkt_fwd.sx1301_1.ftimestamp_enable='1' && \
|
||||
uci set lora_pkt_fwd.sx1301_1.radio_0_freq='867900000' && \
|
||||
uci set lora_pkt_fwd.sx1301_1.radio_1_freq='868550000' && \
|
||||
uci set lorasrv.lorasrv.adr_margin='5' && \
|
||||
uci set lorasrv.lorasrv.auth_enable='0' && \
|
||||
uci set lorasrv.lorasrv.clean_session='1' && \
|
||||
uci set lorasrv.lorasrv.DisableFcntCheck='0' && \
|
||||
uci set lorasrv.lorasrv.dr_min='0' && \
|
||||
uci set lorasrv.lorasrv.integration_enable='1' && \
|
||||
uci set lorasrv.lorasrv.keepalive='10' && \
|
||||
uci set lorasrv.lorasrv.mqtt_version='3.1' && \
|
||||
uci set lorasrv.lorasrv.network_id='1' && \
|
||||
uci set lorasrv.lorasrv.qos='1' && \
|
||||
uci set lorasrv.lorasrv.RECEIVE_DELAY1='1' && \
|
||||
uci set lorasrv.lorasrv.retain='0' && \
|
||||
uci set lorasrv.lorasrv.Rx1DrOffset='0' && \
|
||||
uci set lorasrv.lorasrv.stat_interval='600' && \
|
||||
uci set lorasrv.lorasrv.status_interval='0' && \
|
||||
uci set lorasrv.lorasrv.tls_mode='none' && \
|
||||
uci set system.country.code='PL' && \
|
||||
uci set network.wgserver=wireguard_vpn && \
|
||||
uci set network.wgserver.endpoint_host=${WGS_ENDPOINT_HOST} && \
|
||||
uci set network.wgserver.endpoint_port=${WGS_ENDPOINT_PORT} && \
|
||||
uci set network.wgserver.public_key=${WGS_PUBLIC_KEY} && \
|
||||
uci set network.wgserver.route_all_traffic=${WGS_ROUTE_ALL_TRAFFIC} && \
|
||||
uci set network.wgserver.allowed_ips=${WGS_ALLOWED_IPS} && \
|
||||
uci set network.wgserver.persistent_keepalive='30000' && \
|
||||
uci set network.wgserver.route_allowed_ips='1' && \
|
||||
uci set network.vpn=interface && \
|
||||
uci set network.vpn.private_key=${VPN_PRIVATE_KEY} && \
|
||||
uci set network.vpn.public_key=${VPN_PUBLIC_KEY} && \
|
||||
uci set network.vpn.addresses=${VPN_IP_ADDRESS} && \
|
||||
uci set network.vpn.proto='wireguard' && \
|
||||
uci set network.vpn.dns=${VPN_DNS} && \
|
||||
uci set network.vpn.disabled='0' && \
|
||||
uci set system.@system[0].hostname=${HOSTNAME} && \
|
||||
uci commit && \
|
||||
/etc/init.d/network restart"
|
||||
|
||||
echo "🎉 Wszystko gotowe!"
|
||||
echo "🎉 Wszystko gotowe!"
|
||||
Loading…
Reference in New Issue