mirror of
https://github.com/MikaylaFischler/cc-mek-scada.git
synced 2024-08-30 18:22:34 +00:00
Merge branch 'devel' into 193-pocket-main-application
This commit is contained in:
commit
c49ad63d6a
13
.devcontainer/devcontainer.json
Normal file
13
.devcontainer/devcontainer.json
Normal file
@ -0,0 +1,13 @@
|
|||||||
|
{
|
||||||
|
"image": "mcr.microsoft.com/devcontainers/universal:2",
|
||||||
|
"features": {
|
||||||
|
},
|
||||||
|
"customizations": {
|
||||||
|
"vscode": {
|
||||||
|
"extensions": [
|
||||||
|
"sumneko.lua",
|
||||||
|
"jackmacwindows.vscode-computercraft"
|
||||||
|
]
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
2
.github/workflows/shields.yml
vendored
2
.github/workflows/shields.yml
vendored
@ -41,7 +41,7 @@ jobs:
|
|||||||
uses: actions/upload-pages-artifact@v1
|
uses: actions/upload-pages-artifact@v1
|
||||||
with:
|
with:
|
||||||
# Upload shields JSON
|
# Upload shields JSON
|
||||||
path: '.'
|
path: 'shields/'
|
||||||
- name: Deploy to GitHub Pages
|
- name: Deploy to GitHub Pages
|
||||||
id: deployment
|
id: deployment
|
||||||
uses: actions/deploy-pages@v2
|
uses: actions/deploy-pages@v2
|
||||||
|
16
README.md
16
README.md
@ -22,20 +22,20 @@ There was also an apparent bug with boilers disconnecting and reconnecting when
|
|||||||
|
|
||||||
### Core
|
### Core
|
||||||
|
|
||||||
![Bootloader](https://img.shields.io/endpoint?url=https%3A%2F%2Fmikaylafischler.github.io%2Fcc-mek-scada%2Fshields%2Fbootloader.json)
|
![Bootloader](https://img.shields.io/endpoint?url=https%3A%2F%2Fmikaylafischler.github.io%2Fcc-mek-scada%2Fbootloader.json)
|
||||||
![Comms](https://img.shields.io/endpoint?url=https%3A%2F%2Fmikaylafischler.github.io%2Fcc-mek-scada%2Fshields%2Fcomms.json)
|
![Comms](https://img.shields.io/endpoint?url=https%3A%2F%2Fmikaylafischler.github.io%2Fcc-mek-scada%2Fcomms.json)
|
||||||
|
|
||||||
### Utilities
|
### Utilities
|
||||||
|
|
||||||
![Installer](https://img.shields.io/endpoint?url=https%3A%2F%2Fmikaylafischler.github.io%2Fcc-mek-scada%2Fshields%2Finstaller.json)
|
![Installer](https://img.shields.io/endpoint?url=https%3A%2F%2Fmikaylafischler.github.io%2Fcc-mek-scada%2Finstaller.json)
|
||||||
|
|
||||||
### Applications
|
### Applications
|
||||||
|
|
||||||
![Reactor PLC](https://img.shields.io/endpoint?url=https%3A%2F%2Fmikaylafischler.github.io%2Fcc-mek-scada%2Fshields%2Freactor-plc.json)
|
![Reactor PLC](https://img.shields.io/endpoint?url=https%3A%2F%2Fmikaylafischler.github.io%2Fcc-mek-scada%2Freactor-plc.json)
|
||||||
![RTU](https://img.shields.io/endpoint?url=https%3A%2F%2Fmikaylafischler.github.io%2Fcc-mek-scada%2Fshields%2Frtu.json)
|
![RTU](https://img.shields.io/endpoint?url=https%3A%2F%2Fmikaylafischler.github.io%2Fcc-mek-scada%2Frtu.json)
|
||||||
![Supervisor](https://img.shields.io/endpoint?url=https%3A%2F%2Fmikaylafischler.github.io%2Fcc-mek-scada%2Fshields%2Fsupervisor.json)
|
![Supervisor](https://img.shields.io/endpoint?url=https%3A%2F%2Fmikaylafischler.github.io%2Fcc-mek-scada%2Fsupervisor.json)
|
||||||
![Coordinator](https://img.shields.io/endpoint?url=https%3A%2F%2Fmikaylafischler.github.io%2Fcc-mek-scada%2Fshields%2Fcoordinator.json)
|
![Coordinator](https://img.shields.io/endpoint?url=https%3A%2F%2Fmikaylafischler.github.io%2Fcc-mek-scada%2Fcoordinator.json)
|
||||||
![Pocket](https://img.shields.io/endpoint?url=https%3A%2F%2Fmikaylafischler.github.io%2Fcc-mek-scada%2Fshields%2Fpocket.json)
|
![Pocket](https://img.shields.io/endpoint?url=https%3A%2F%2Fmikaylafischler.github.io%2Fcc-mek-scada%2Fpocket.json)
|
||||||
|
|
||||||
## Installation
|
## Installation
|
||||||
|
|
||||||
|
@ -590,7 +590,7 @@ function coordinator.comms(version, modem, sv_port, sv_listen, api_listen, range
|
|||||||
elseif packet.type == SCADA_CRDN_TYPE.UNIT_STATUSES then
|
elseif packet.type == SCADA_CRDN_TYPE.UNIT_STATUSES then
|
||||||
-- update statuses
|
-- update statuses
|
||||||
if not iocontrol.update_unit_statuses(packet.data) then
|
if not iocontrol.update_unit_statuses(packet.data) then
|
||||||
log.error("received invalid UNIT_STATUSES packet")
|
log.debug("received invalid UNIT_STATUSES packet")
|
||||||
end
|
end
|
||||||
elseif packet.type == SCADA_CRDN_TYPE.UNIT_CMD then
|
elseif packet.type == SCADA_CRDN_TYPE.UNIT_CMD then
|
||||||
-- unit command acknowledgement
|
-- unit command acknowledgement
|
||||||
@ -626,7 +626,7 @@ function coordinator.comms(version, modem, sv_port, sv_listen, api_listen, range
|
|||||||
log.debug("SCADA_CRDN unit command ack packet length mismatch")
|
log.debug("SCADA_CRDN unit command ack packet length mismatch")
|
||||||
end
|
end
|
||||||
else
|
else
|
||||||
log.warning("received unknown SCADA_CRDN packet type " .. packet.type)
|
log.debug("received unknown SCADA_CRDN packet type " .. packet.type)
|
||||||
end
|
end
|
||||||
else
|
else
|
||||||
log.debug("discarding SCADA_CRDN packet before linked")
|
log.debug("discarding SCADA_CRDN packet before linked")
|
||||||
@ -681,11 +681,11 @@ function coordinator.comms(version, modem, sv_port, sv_listen, api_listen, range
|
|||||||
end
|
end
|
||||||
elseif est_ack == ESTABLISH_ACK.COLLISION then
|
elseif est_ack == ESTABLISH_ACK.COLLISION then
|
||||||
if self.last_est_ack ~= est_ack then
|
if self.last_est_ack ~= est_ack then
|
||||||
log.info("supervisor connection denied due to collision")
|
log.warning("supervisor connection denied due to collision")
|
||||||
end
|
end
|
||||||
elseif est_ack == ESTABLISH_ACK.BAD_VERSION then
|
elseif est_ack == ESTABLISH_ACK.BAD_VERSION then
|
||||||
if self.last_est_ack ~= est_ack then
|
if self.last_est_ack ~= est_ack then
|
||||||
log.info("supervisor comms version mismatch")
|
log.warning("supervisor comms version mismatch")
|
||||||
end
|
end
|
||||||
else
|
else
|
||||||
log.debug("SCADA_MGMT establish packet reply (len = 1) unsupported")
|
log.debug("SCADA_MGMT establish packet reply (len = 1) unsupported")
|
||||||
|
@ -20,7 +20,7 @@ local sounder = require("coordinator.sounder")
|
|||||||
|
|
||||||
local apisessions = require("coordinator.session.apisessions")
|
local apisessions = require("coordinator.session.apisessions")
|
||||||
|
|
||||||
local COORDINATOR_VERSION = "v0.13.1"
|
local COORDINATOR_VERSION = "v0.13.2"
|
||||||
|
|
||||||
local println = util.println
|
local println = util.println
|
||||||
local println_ts = util.println_ts
|
local println_ts = util.println_ts
|
||||||
|
@ -76,7 +76,8 @@ end
|
|||||||
-- transmit RPS data across the bus
|
-- transmit RPS data across the bus
|
||||||
---@param tripped boolean RPS tripped
|
---@param tripped boolean RPS tripped
|
||||||
---@param status table RPS status
|
---@param status table RPS status
|
||||||
function databus.tx_rps(tripped, status)
|
---@param emer_cool_active boolean RPS activated the emergency coolant
|
||||||
|
function databus.tx_rps(tripped, status, emer_cool_active)
|
||||||
dbus_iface.ps.publish("rps_scram", tripped)
|
dbus_iface.ps.publish("rps_scram", tripped)
|
||||||
dbus_iface.ps.publish("rps_damage", status[1])
|
dbus_iface.ps.publish("rps_damage", status[1])
|
||||||
dbus_iface.ps.publish("rps_high_temp", status[2])
|
dbus_iface.ps.publish("rps_high_temp", status[2])
|
||||||
@ -89,6 +90,7 @@ function databus.tx_rps(tripped, status)
|
|||||||
dbus_iface.ps.publish("rps_manual", status[9])
|
dbus_iface.ps.publish("rps_manual", status[9])
|
||||||
dbus_iface.ps.publish("rps_automatic", status[10])
|
dbus_iface.ps.publish("rps_automatic", status[10])
|
||||||
dbus_iface.ps.publish("rps_sysfail", status[11])
|
dbus_iface.ps.publish("rps_sysfail", status[11])
|
||||||
|
dbus_iface.ps.publish("emer_cool", emer_cool_active)
|
||||||
end
|
end
|
||||||
|
|
||||||
-- link a function to receive data from the bus
|
-- link a function to receive data from the bus
|
||||||
|
@ -4,6 +4,7 @@
|
|||||||
|
|
||||||
local util = require("scada-common.util")
|
local util = require("scada-common.util")
|
||||||
|
|
||||||
|
local config = require("reactor-plc.config")
|
||||||
local databus = require("reactor-plc.databus")
|
local databus = require("reactor-plc.databus")
|
||||||
|
|
||||||
local style = require("reactor-plc.panel.style")
|
local style = require("reactor-plc.panel.style")
|
||||||
@ -35,6 +36,10 @@ local function init(monitor)
|
|||||||
local header = TextBox{parent=panel,y=1,text="REACTOR PLC - UNIT ?",alignment=TEXT_ALIGN.CENTER,height=1,fg_bg=style.header}
|
local header = TextBox{parent=panel,y=1,text="REACTOR PLC - UNIT ?",alignment=TEXT_ALIGN.CENTER,height=1,fg_bg=style.header}
|
||||||
databus.rx_field("unit_id", function (id) header.set_value(util.c("REACTOR PLC - UNIT ", id)) end)
|
databus.rx_field("unit_id", function (id) header.set_value(util.c("REACTOR PLC - UNIT ", id)) end)
|
||||||
|
|
||||||
|
--
|
||||||
|
-- system indicators
|
||||||
|
--
|
||||||
|
|
||||||
local system = Div{parent=panel,width=14,height=18,x=2,y=3}
|
local system = Div{parent=panel,width=14,height=18,x=2,y=3}
|
||||||
|
|
||||||
local init_ok = LED{parent=system,label="STATUS",colors=cpair(colors.green,colors.red)}
|
local init_ok = LED{parent=system,label="STATUS",colors=cpair(colors.green,colors.red)}
|
||||||
@ -67,6 +72,10 @@ local function init(monitor)
|
|||||||
databus.rx_field("routine__comms_rx", rt_cmrx.update)
|
databus.rx_field("routine__comms_rx", rt_cmrx.update)
|
||||||
databus.rx_field("routine__spctl", rt_sctl.update)
|
databus.rx_field("routine__spctl", rt_sctl.update)
|
||||||
|
|
||||||
|
--
|
||||||
|
-- status & controls
|
||||||
|
--
|
||||||
|
|
||||||
local status = Div{parent=panel,width=19,height=18,x=17,y=3}
|
local status = Div{parent=panel,width=19,height=18,x=17,y=3}
|
||||||
|
|
||||||
local active = LED{parent=status,x=2,width=12,label="RCT ACTIVE",colors=cpair(colors.green,colors.green_off)}
|
local active = LED{parent=status,x=2,width=12,label="RCT ACTIVE",colors=cpair(colors.green,colors.green_off)}
|
||||||
@ -83,6 +92,16 @@ local function init(monitor)
|
|||||||
databus.rx_field("reactor_active", active.update)
|
databus.rx_field("reactor_active", active.update)
|
||||||
databus.rx_field("rps_scram", scram.update)
|
databus.rx_field("rps_scram", scram.update)
|
||||||
|
|
||||||
|
-- only show emergency coolant LED if emergency coolant is configured for this device
|
||||||
|
if type(config.EMERGENCY_COOL) == "table" then
|
||||||
|
local emer_cool = LED{parent=status,x=9,width=14,label="EMER COOLANT",colors=cpair(colors.yellow,colors.yellow_off)}
|
||||||
|
databus.rx_field("emer_cool", emer_cool.update)
|
||||||
|
end
|
||||||
|
|
||||||
|
--
|
||||||
|
-- about footer
|
||||||
|
--
|
||||||
|
|
||||||
local about = Rectangle{parent=panel,width=32,height=3,x=2,y=16,border=border(1,colors.ivory),thin=true,fg_bg=cpair(colors.black,colors.white)}
|
local about = Rectangle{parent=panel,width=32,height=3,x=2,y=16,border=border(1,colors.ivory),thin=true,fg_bg=cpair(colors.black,colors.white)}
|
||||||
local fw_v = TextBox{parent=about,x=2,y=1,text="FW: v00.00.00",alignment=TEXT_ALIGN.LEFT,height=1}
|
local fw_v = TextBox{parent=about,x=2,y=1,text="FW: v00.00.00",alignment=TEXT_ALIGN.LEFT,height=1}
|
||||||
local comms_v = TextBox{parent=about,x=17,y=1,text="NT: v00.00.00",alignment=TEXT_ALIGN.LEFT,height=1}
|
local comms_v = TextBox{parent=about,x=17,y=1,text="NT: v00.00.00",alignment=TEXT_ALIGN.LEFT,height=1}
|
||||||
@ -90,6 +109,10 @@ local function init(monitor)
|
|||||||
databus.rx_field("version", function (version) fw_v.set_value(util.c("FW: ", version)) end)
|
databus.rx_field("version", function (version) fw_v.set_value(util.c("FW: ", version)) end)
|
||||||
databus.rx_field("comms_version", function (version) comms_v.set_value(util.c("NT: v", version)) end)
|
databus.rx_field("comms_version", function (version) comms_v.set_value(util.c("NT: v", version)) end)
|
||||||
|
|
||||||
|
--
|
||||||
|
-- rps list
|
||||||
|
--
|
||||||
|
|
||||||
local rps = Rectangle{parent=panel,width=16,height=16,x=36,y=3,border=border(1,colors.lightGray),thin=true,fg_bg=cpair(colors.black,colors.lightGray)}
|
local rps = Rectangle{parent=panel,width=16,height=16,x=36,y=3,border=border(1,colors.lightGray),thin=true,fg_bg=cpair(colors.black,colors.lightGray)}
|
||||||
local rps_man = LED{parent=rps,label="MANUAL",colors=cpair(colors.red,colors.red_off)}
|
local rps_man = LED{parent=rps,label="MANUAL",colors=cpair(colors.red,colors.red_off)}
|
||||||
local rps_auto = LED{parent=rps,label="AUTOMATIC",colors=cpair(colors.red,colors.red_off)}
|
local rps_auto = LED{parent=rps,label="AUTOMATIC",colors=cpair(colors.red,colors.red_off)}
|
||||||
|
@ -22,7 +22,7 @@ style.header = cpair(colors.black, colors.lightGray)
|
|||||||
style.colors = {
|
style.colors = {
|
||||||
{ c = colors.red, hex = 0xdf4949 }, -- RED ON
|
{ c = colors.red, hex = 0xdf4949 }, -- RED ON
|
||||||
{ c = colors.orange, hex = 0xffb659 },
|
{ c = colors.orange, hex = 0xffb659 },
|
||||||
{ c = colors.yellow, hex = 0xf9fb53 },
|
{ c = colors.yellow, hex = 0xf9fb53 }, -- YELLOW ON
|
||||||
{ c = colors.lime, hex = 0x16665a }, -- GREEN OFF
|
{ c = colors.lime, hex = 0x16665a }, -- GREEN OFF
|
||||||
{ c = colors.green, hex = 0x6be551 }, -- GREEN ON
|
{ c = colors.green, hex = 0x6be551 }, -- GREEN ON
|
||||||
{ c = colors.cyan, hex = 0x34bac8 },
|
{ c = colors.cyan, hex = 0x34bac8 },
|
||||||
|
@ -381,7 +381,7 @@ function plc.rps_init(reactor, is_formed, emer_cool)
|
|||||||
_set_emer_cool(self.state[state_keys.low_coolant])
|
_set_emer_cool(self.state[state_keys.low_coolant])
|
||||||
|
|
||||||
-- report RPS status
|
-- report RPS status
|
||||||
databus.tx_rps(self.tripped, self.state)
|
databus.tx_rps(self.tripped, self.state, self.emer_cool_active)
|
||||||
|
|
||||||
return self.tripped, status, first_trip
|
return self.tripped, status, first_trip
|
||||||
end
|
end
|
||||||
@ -640,8 +640,6 @@ function plc.comms(id, version, modem, local_port, server_port, range, reactor,
|
|||||||
if not reactor.__p_is_faulted() then
|
if not reactor.__p_is_faulted() then
|
||||||
_send(RPLC_TYPE.MEK_STRUCT, mek_data)
|
_send(RPLC_TYPE.MEK_STRUCT, mek_data)
|
||||||
self.resend_build = false
|
self.resend_build = false
|
||||||
else
|
|
||||||
log.error("failed to send structure: PPM fault")
|
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
@ -761,7 +759,7 @@ function plc.comms(id, version, modem, local_port, server_port, range, reactor,
|
|||||||
pkt = mgmt_pkt.get()
|
pkt = mgmt_pkt.get()
|
||||||
end
|
end
|
||||||
else
|
else
|
||||||
log.error("illegal packet type " .. s_pkt.protocol(), true)
|
log.debug("illegal packet type " .. s_pkt.protocol(), true)
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
@ -776,8 +774,10 @@ function plc.comms(id, version, modem, local_port, server_port, range, reactor,
|
|||||||
-- print a log message to the terminal as long as the UI isn't running
|
-- print a log message to the terminal as long as the UI isn't running
|
||||||
local function println_ts(message) if not plc_state.fp_ok then util.println_ts(message) end end
|
local function println_ts(message) if not plc_state.fp_ok then util.println_ts(message) end end
|
||||||
|
|
||||||
|
local l_port = packet.scada_frame.local_port()
|
||||||
|
|
||||||
-- handle packets now that we have prints setup
|
-- handle packets now that we have prints setup
|
||||||
if packet.scada_frame.local_port() == local_port then
|
if l_port == local_port then
|
||||||
-- check sequence number
|
-- check sequence number
|
||||||
if self.r_seq_num == nil then
|
if self.r_seq_num == nil then
|
||||||
self.r_seq_num = packet.scada_frame.seq_num()
|
self.r_seq_num = packet.scada_frame.seq_num()
|
||||||
@ -925,7 +925,7 @@ function plc.comms(id, version, modem, local_port, server_port, range, reactor,
|
|||||||
log.debug("RPLC set automatic burn rate packet length mismatch or non-numeric burn rate")
|
log.debug("RPLC set automatic burn rate packet length mismatch or non-numeric burn rate")
|
||||||
end
|
end
|
||||||
else
|
else
|
||||||
log.warning("received unknown RPLC packet type " .. packet.type)
|
log.debug("received unknown RPLC packet type " .. packet.type)
|
||||||
end
|
end
|
||||||
else
|
else
|
||||||
log.debug("discarding RPLC packet before linked")
|
log.debug("discarding RPLC packet before linked")
|
||||||
@ -947,7 +947,7 @@ function plc.comms(id, version, modem, local_port, server_port, range, reactor,
|
|||||||
log.debug("re-sent initial status data")
|
log.debug("re-sent initial status data")
|
||||||
elseif est_ack == ESTABLISH_ACK.DENY then
|
elseif est_ack == ESTABLISH_ACK.DENY then
|
||||||
println_ts("received unsolicited link denial, unlinking")
|
println_ts("received unsolicited link denial, unlinking")
|
||||||
log.info("unsolicited establish request denied")
|
log.warning("unsolicited establish request denied")
|
||||||
elseif est_ack == ESTABLISH_ACK.COLLISION then
|
elseif est_ack == ESTABLISH_ACK.COLLISION then
|
||||||
println_ts("received unsolicited link collision, unlinking")
|
println_ts("received unsolicited link collision, unlinking")
|
||||||
log.warning("unsolicited establish request collision")
|
log.warning("unsolicited establish request collision")
|
||||||
@ -956,7 +956,7 @@ function plc.comms(id, version, modem, local_port, server_port, range, reactor,
|
|||||||
log.warning("unsolicited establish request version mismatch")
|
log.warning("unsolicited establish request version mismatch")
|
||||||
else
|
else
|
||||||
println_ts("invalid unsolicited link response")
|
println_ts("invalid unsolicited link response")
|
||||||
log.error("unsolicited unknown establish request response")
|
log.debug("unsolicited unknown establish request response")
|
||||||
end
|
end
|
||||||
|
|
||||||
self.linked = est_ack == ESTABLISH_ACK.ALLOW
|
self.linked = est_ack == ESTABLISH_ACK.ALLOW
|
||||||
@ -992,7 +992,7 @@ function plc.comms(id, version, modem, local_port, server_port, range, reactor,
|
|||||||
println_ts("server connection closed by remote host")
|
println_ts("server connection closed by remote host")
|
||||||
log.warning("server connection closed by remote host")
|
log.warning("server connection closed by remote host")
|
||||||
else
|
else
|
||||||
log.warning("received unsupported SCADA_MGMT packet type " .. packet.type)
|
log.debug("received unsupported SCADA_MGMT packet type " .. packet.type)
|
||||||
end
|
end
|
||||||
elseif packet.type == SCADA_MGMT_TYPE.ESTABLISH then
|
elseif packet.type == SCADA_MGMT_TYPE.ESTABLISH then
|
||||||
-- link request confirmation
|
-- link request confirmation
|
||||||
@ -1042,6 +1042,8 @@ function plc.comms(id, version, modem, local_port, server_port, range, reactor,
|
|||||||
-- should be unreachable assuming packet is from parse_packet()
|
-- should be unreachable assuming packet is from parse_packet()
|
||||||
log.error("illegal packet type " .. protocol, true)
|
log.error("illegal packet type " .. protocol, true)
|
||||||
end
|
end
|
||||||
|
else
|
||||||
|
log.debug("received packet on unconfigured channel " .. l_port, true)
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
@ -18,7 +18,7 @@ local plc = require("reactor-plc.plc")
|
|||||||
local renderer = require("reactor-plc.renderer")
|
local renderer = require("reactor-plc.renderer")
|
||||||
local threads = require("reactor-plc.threads")
|
local threads = require("reactor-plc.threads")
|
||||||
|
|
||||||
local R_PLC_VERSION = "v1.1.5"
|
local R_PLC_VERSION = "v1.1.8"
|
||||||
|
|
||||||
local println = util.println
|
local println = util.println
|
||||||
local println_ts = util.println_ts
|
local println_ts = util.println_ts
|
||||||
|
@ -313,7 +313,7 @@ function rtu.comms(version, modem, local_port, server_port, range, conn_watchdog
|
|||||||
pkt = mgmt_pkt.get()
|
pkt = mgmt_pkt.get()
|
||||||
end
|
end
|
||||||
else
|
else
|
||||||
log.error("illegal packet type " .. s_pkt.protocol(), true)
|
log.debug("illegal packet type " .. s_pkt.protocol(), true)
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
@ -379,7 +379,7 @@ function rtu.comms(version, modem, local_port, server_port, range, conn_watchdog
|
|||||||
else
|
else
|
||||||
-- unit ID out of range?
|
-- unit ID out of range?
|
||||||
reply = modbus.reply__gw_unavailable(packet)
|
reply = modbus.reply__gw_unavailable(packet)
|
||||||
log.error("received MODBUS packet for non-existent unit")
|
log.debug("received MODBUS packet for non-existent unit")
|
||||||
end
|
end
|
||||||
|
|
||||||
public.send_modbus(reply)
|
public.send_modbus(reply)
|
||||||
@ -447,7 +447,7 @@ function rtu.comms(version, modem, local_port, server_port, range, conn_watchdog
|
|||||||
public.send_advertisement(units)
|
public.send_advertisement(units)
|
||||||
else
|
else
|
||||||
-- not supported
|
-- not supported
|
||||||
log.warning("received unsupported SCADA_MGMT message type " .. packet.type)
|
log.debug("received unsupported SCADA_MGMT message type " .. packet.type)
|
||||||
end
|
end
|
||||||
else
|
else
|
||||||
log.debug("discarding non-link SCADA_MGMT packet before linked")
|
log.debug("discarding non-link SCADA_MGMT packet before linked")
|
||||||
|
@ -25,7 +25,7 @@ local sna_rtu = require("rtu.dev.sna_rtu")
|
|||||||
local sps_rtu = require("rtu.dev.sps_rtu")
|
local sps_rtu = require("rtu.dev.sps_rtu")
|
||||||
local turbinev_rtu = require("rtu.dev.turbinev_rtu")
|
local turbinev_rtu = require("rtu.dev.turbinev_rtu")
|
||||||
|
|
||||||
local RTU_VERSION = "v0.13.3"
|
local RTU_VERSION = "v0.13.4"
|
||||||
|
|
||||||
local RTU_UNIT_TYPE = types.RTU_UNIT_TYPE
|
local RTU_UNIT_TYPE = types.RTU_UNIT_TYPE
|
||||||
|
|
||||||
|
@ -412,7 +412,7 @@ function coordinator.new_session(id, in_queue, out_queue, timeout, facility)
|
|||||||
_send(SCADA_CRDN_TYPE.FAC_BUILDS, { facility.get_build(cmd.val.type == RTU_UNIT_TYPE.IMATRIX) })
|
_send(SCADA_CRDN_TYPE.FAC_BUILDS, { facility.get_build(cmd.val.type == RTU_UNIT_TYPE.IMATRIX) })
|
||||||
end
|
end
|
||||||
else
|
else
|
||||||
log.warning(log_header .. "unsupported data command received in in_queue (this is a bug)")
|
log.error(log_header .. "unsupported data command received in in_queue (this is a bug)", true)
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
@ -273,7 +273,7 @@ function plc.new_session(id, reactor_id, in_queue, out_queue, timeout)
|
|||||||
if pkt.length == 1 then
|
if pkt.length == 1 then
|
||||||
return pkt.data[1]
|
return pkt.data[1]
|
||||||
else
|
else
|
||||||
log.warning(log_header .. "RPLC ACK length mismatch")
|
log.debug(log_header .. "RPLC ACK length mismatch")
|
||||||
return nil
|
return nil
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
@ -296,7 +296,7 @@ function plc.new_session(id, reactor_id, in_queue, out_queue, timeout)
|
|||||||
---@cast pkt rplc_frame
|
---@cast pkt rplc_frame
|
||||||
-- check reactor ID
|
-- check reactor ID
|
||||||
if pkt.id ~= reactor_id then
|
if pkt.id ~= reactor_id then
|
||||||
log.warning(log_header .. "RPLC packet with ID not matching reactor ID: reactor " .. reactor_id .. " != " .. pkt.id)
|
log.warning(log_header .. "discarding RPLC packet with ID not matching reactor ID: reactor " .. reactor_id .. " != " .. pkt.id)
|
||||||
return
|
return
|
||||||
end
|
end
|
||||||
|
|
||||||
@ -635,7 +635,7 @@ function plc.new_session(id, reactor_id, in_queue, out_queue, timeout)
|
|||||||
_send(RPLC_TYPE.RPS_AUTO_RESET, {})
|
_send(RPLC_TYPE.RPS_AUTO_RESET, {})
|
||||||
end
|
end
|
||||||
else
|
else
|
||||||
log.warning(log_header .. "unsupported command received in in_queue (this is a bug)")
|
log.error(log_header .. "unsupported command received in in_queue (this is a bug)", true)
|
||||||
end
|
end
|
||||||
elseif message.qtype == mqueue.TYPE.DATA then
|
elseif message.qtype == mqueue.TYPE.DATA then
|
||||||
-- instruction with body
|
-- instruction with body
|
||||||
@ -682,7 +682,7 @@ function plc.new_session(id, reactor_id, in_queue, out_queue, timeout)
|
|||||||
end
|
end
|
||||||
end
|
end
|
||||||
else
|
else
|
||||||
log.warning(log_header .. "unsupported data command received in in_queue (this is a bug)")
|
log.error(log_header .. "unsupported data command received in in_queue (this is a bug)", true)
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
@ -14,7 +14,7 @@ local supervisor = require("supervisor.supervisor")
|
|||||||
|
|
||||||
local svsessions = require("supervisor.session.svsessions")
|
local svsessions = require("supervisor.session.svsessions")
|
||||||
|
|
||||||
local SUPERVISOR_VERSION = "v0.15.1"
|
local SUPERVISOR_VERSION = "v0.15.2"
|
||||||
|
|
||||||
local println = util.println
|
local println = util.println
|
||||||
local println_ts = util.println_ts
|
local println_ts = util.println_ts
|
||||||
|
@ -337,7 +337,7 @@ function supervisor.comms(version, num_reactors, cooling_conf, modem, dev_listen
|
|||||||
log.debug("illegal packet type " .. protocol .. " on coordinator listening channel")
|
log.debug("illegal packet type " .. protocol .. " on coordinator listening channel")
|
||||||
end
|
end
|
||||||
else
|
else
|
||||||
log.warning("received packet on unconfigured channel " .. l_port)
|
log.debug("received packet on unconfigured channel " .. l_port, true)
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
Loading…
Reference in New Issue
Block a user