#146 increased timeout times and added to config files

This commit is contained in:
Mikayla Fischler
2023-02-13 12:27:22 -05:00
parent 4d40d08a7a
commit 9784b4e165
12 changed files with 69 additions and 42 deletions

View File

@@ -6,14 +6,18 @@ local config = {}
config.SERVER_PORT = 16000
-- port to listen to incoming packets FROM server
config.LISTEN_PORT = 15001
-- max trusted modem message distance (0 to disable check)
-- max trusted modem message distance (< 1 to disable check)
config.TRUSTED_RANGE = 0
-- time in seconds (>= 1) before assuming a remote device is no longer active
config.COMMS_TIMEOUT = 5
-- log path
config.LOG_PATH = "/log.txt"
-- log mode
-- 0 = APPEND (adds to existing file on start)
-- 1 = NEW (replaces existing file on start)
config.LOG_MODE = 0
-- RTU peripheral devices (named: side/network device name)
config.RTU_DEVICES = {
{

View File

@@ -25,7 +25,7 @@ local sna_rtu = require("rtu.dev.sna_rtu")
local sps_rtu = require("rtu.dev.sps_rtu")
local turbinev_rtu = require("rtu.dev.turbinev_rtu")
local RTU_VERSION = "beta-v0.10.3"
local RTU_VERSION = "beta-v0.10.4"
local rtu_t = types.rtu_t
@@ -43,6 +43,8 @@ local cfv = util.new_validator()
cfv.assert_port(config.SERVER_PORT)
cfv.assert_port(config.LISTEN_PORT)
cfv.assert_type_int(config.TRUSTED_RANGE)
cfv.assert_type_num(config.COMMS_TIMEOUT)
cfv.assert_min(config.COMMS_TIMEOUT, 1)
cfv.assert_type_str(config.LOG_PATH)
cfv.assert_type_int(config.LOG_MODE)
cfv.assert_type_table(config.RTU_DEVICES)
@@ -400,7 +402,7 @@ local function main()
if configure() then
-- start connection watchdog
smem_sys.conn_watchdog = util.new_watchdog(5)
smem_sys.conn_watchdog = util.new_watchdog(config.COMMS_TIMEOUT)
log.debug("boot> conn watchdog started")
-- setup comms