2022-03-25 16:17:46 +00:00
|
|
|
--
|
|
|
|
-- Nuclear Generation Facility SCADA Coordinator
|
|
|
|
--
|
|
|
|
|
2022-05-14 17:32:42 +00:00
|
|
|
require("/initenv").init_env()
|
|
|
|
|
2022-05-04 17:37:01 +00:00
|
|
|
local log = require("scada-common.log")
|
|
|
|
local ppm = require("scada-common.ppm")
|
|
|
|
local util = require("scada-common.util")
|
2022-03-25 16:17:46 +00:00
|
|
|
|
2022-05-11 15:31:02 +00:00
|
|
|
local config = require("coordinator.config")
|
|
|
|
local coordinator = require("coordinator.coordinator")
|
2022-03-25 16:17:46 +00:00
|
|
|
|
2022-05-04 17:37:01 +00:00
|
|
|
local COORDINATOR_VERSION = "alpha-v0.1.2"
|
2022-03-25 16:17:46 +00:00
|
|
|
|
2022-04-29 17:32:37 +00:00
|
|
|
local print = util.print
|
|
|
|
local println = util.println
|
2022-03-25 16:17:46 +00:00
|
|
|
local print_ts = util.print_ts
|
2022-04-29 17:32:37 +00:00
|
|
|
local println_ts = util.println_ts
|
2022-03-25 16:17:46 +00:00
|
|
|
|
2022-04-29 17:32:37 +00:00
|
|
|
log.init("/log.txt", log.MODE.APPEND)
|
|
|
|
|
2022-05-04 17:37:01 +00:00
|
|
|
log.info("========================================")
|
|
|
|
log.info("BOOTING coordinator.startup " .. COORDINATOR_VERSION)
|
|
|
|
log.info("========================================")
|
2022-05-01 19:34:44 +00:00
|
|
|
println(">> SCADA Coordinator " .. COORDINATOR_VERSION .. " <<")
|
2022-03-25 16:17:46 +00:00
|
|
|
|
2022-04-29 17:32:37 +00:00
|
|
|
-- mount connected devices
|
|
|
|
ppm.mount_all()
|
2022-03-25 16:17:46 +00:00
|
|
|
|
2022-04-29 17:32:37 +00:00
|
|
|
local modem = ppm.get_wireless_modem()
|
2022-03-25 16:17:46 +00:00
|
|
|
|
|
|
|
-- we need a modem
|
|
|
|
if modem == nil then
|
2022-04-29 17:32:37 +00:00
|
|
|
println("please connect a wireless modem")
|
2022-03-25 16:17:46 +00:00
|
|
|
return
|
|
|
|
end
|