pymscada 0.2.6b0__tar.gz → 0.2.6b2__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- {pymscada-0.2.6b0/src/pymscada.egg-info → pymscada-0.2.6b2}/PKG-INFO +1 -1
- {pymscada-0.2.6b0 → pymscada-0.2.6b2}/pyproject.toml +1 -1
- {pymscada-0.2.6b0 → pymscada-0.2.6b2}/src/pymscada/alarms.py +1 -0
- {pymscada-0.2.6b0 → pymscada-0.2.6b2}/src/pymscada/bus_client.py +17 -2
- {pymscada-0.2.6b0 → pymscada-0.2.6b2}/src/pymscada/bus_server.py +9 -1
- {pymscada-0.2.6b0 → pymscada-0.2.6b2}/src/pymscada/callout.py +1 -0
- {pymscada-0.2.6b0 → pymscada-0.2.6b2}/src/pymscada/files.py +1 -0
- {pymscada-0.2.6b0 → pymscada-0.2.6b2}/src/pymscada/history.py +1 -0
- {pymscada-0.2.6b0 → pymscada-0.2.6b2}/src/pymscada/opnotes.py +1 -0
- {pymscada-0.2.6b0 → pymscada-0.2.6b2/src/pymscada.egg-info}/PKG-INFO +1 -1
- {pymscada-0.2.6b0 → pymscada-0.2.6b2}/LICENSE +0 -0
- {pymscada-0.2.6b0 → pymscada-0.2.6b2}/MANIFEST.in +0 -0
- {pymscada-0.2.6b0 → pymscada-0.2.6b2}/README.md +0 -0
- {pymscada-0.2.6b0 → pymscada-0.2.6b2}/setup.cfg +0 -0
- {pymscada-0.2.6b0 → pymscada-0.2.6b2}/src/pymscada/__init__.py +0 -0
- {pymscada-0.2.6b0 → pymscada-0.2.6b2}/src/pymscada/__main__.py +0 -0
- {pymscada-0.2.6b0 → pymscada-0.2.6b2}/src/pymscada/checkout.py +0 -0
- {pymscada-0.2.6b0 → pymscada-0.2.6b2}/src/pymscada/config.py +0 -0
- {pymscada-0.2.6b0 → pymscada-0.2.6b2}/src/pymscada/console.py +0 -0
- {pymscada-0.2.6b0 → pymscada-0.2.6b2}/src/pymscada/demo/README.md +0 -0
- {pymscada-0.2.6b0 → pymscada-0.2.6b2}/src/pymscada/demo/__init__.py +0 -0
- {pymscada-0.2.6b0 → pymscada-0.2.6b2}/src/pymscada/demo/__pycache__/__init__.cpython-311.pyc +0 -0
- {pymscada-0.2.6b0 → pymscada-0.2.6b2}/src/pymscada/demo/accuweather.yaml +0 -0
- {pymscada-0.2.6b0 → pymscada-0.2.6b2}/src/pymscada/demo/alarms.yaml +0 -0
- {pymscada-0.2.6b0 → pymscada-0.2.6b2}/src/pymscada/demo/bus.yaml +0 -0
- {pymscada-0.2.6b0 → pymscada-0.2.6b2}/src/pymscada/demo/callout.yaml +0 -0
- {pymscada-0.2.6b0 → pymscada-0.2.6b2}/src/pymscada/demo/files.yaml +0 -0
- {pymscada-0.2.6b0 → pymscada-0.2.6b2}/src/pymscada/demo/history.yaml +0 -0
- {pymscada-0.2.6b0 → pymscada-0.2.6b2}/src/pymscada/demo/logixclient.yaml +0 -0
- {pymscada-0.2.6b0 → pymscada-0.2.6b2}/src/pymscada/demo/modbus_plc.py +0 -0
- {pymscada-0.2.6b0 → pymscada-0.2.6b2}/src/pymscada/demo/modbusclient.yaml +0 -0
- {pymscada-0.2.6b0 → pymscada-0.2.6b2}/src/pymscada/demo/modbusserver.yaml +0 -0
- {pymscada-0.2.6b0 → pymscada-0.2.6b2}/src/pymscada/demo/openweather.yaml +0 -0
- {pymscada-0.2.6b0 → pymscada-0.2.6b2}/src/pymscada/demo/opnotes.yaml +0 -0
- {pymscada-0.2.6b0 → pymscada-0.2.6b2}/src/pymscada/demo/piapi.yaml +0 -0
- {pymscada-0.2.6b0 → pymscada-0.2.6b2}/src/pymscada/demo/ping.yaml +0 -0
- {pymscada-0.2.6b0 → pymscada-0.2.6b2}/src/pymscada/demo/pymscada-alarms.service +0 -0
- {pymscada-0.2.6b0 → pymscada-0.2.6b2}/src/pymscada/demo/pymscada-bus.service +0 -0
- {pymscada-0.2.6b0 → pymscada-0.2.6b2}/src/pymscada/demo/pymscada-callout.service +0 -0
- {pymscada-0.2.6b0 → pymscada-0.2.6b2}/src/pymscada/demo/pymscada-demo-modbus_plc.service +0 -0
- {pymscada-0.2.6b0 → pymscada-0.2.6b2}/src/pymscada/demo/pymscada-files.service +0 -0
- {pymscada-0.2.6b0 → pymscada-0.2.6b2}/src/pymscada/demo/pymscada-history.service +0 -0
- {pymscada-0.2.6b0 → pymscada-0.2.6b2}/src/pymscada/demo/pymscada-io-logixclient.service +0 -0
- {pymscada-0.2.6b0 → pymscada-0.2.6b2}/src/pymscada/demo/pymscada-io-modbusclient.service +0 -0
- {pymscada-0.2.6b0 → pymscada-0.2.6b2}/src/pymscada/demo/pymscada-io-modbusserver.service +0 -0
- {pymscada-0.2.6b0 → pymscada-0.2.6b2}/src/pymscada/demo/pymscada-io-openweather.service +0 -0
- {pymscada-0.2.6b0 → pymscada-0.2.6b2}/src/pymscada/demo/pymscada-io-piapi.service +0 -0
- {pymscada-0.2.6b0 → pymscada-0.2.6b2}/src/pymscada/demo/pymscada-io-ping.service +0 -0
- {pymscada-0.2.6b0 → pymscada-0.2.6b2}/src/pymscada/demo/pymscada-io-sms.service +0 -0
- {pymscada-0.2.6b0 → pymscada-0.2.6b2}/src/pymscada/demo/pymscada-io-snmpclient.service +0 -0
- {pymscada-0.2.6b0 → pymscada-0.2.6b2}/src/pymscada/demo/pymscada-io-witsapi.service +0 -0
- {pymscada-0.2.6b0 → pymscada-0.2.6b2}/src/pymscada/demo/pymscada-opnotes.service +0 -0
- {pymscada-0.2.6b0 → pymscada-0.2.6b2}/src/pymscada/demo/pymscada-wwwserver.service +0 -0
- {pymscada-0.2.6b0 → pymscada-0.2.6b2}/src/pymscada/demo/sms.yaml +0 -0
- {pymscada-0.2.6b0 → pymscada-0.2.6b2}/src/pymscada/demo/snmpclient.yaml +0 -0
- {pymscada-0.2.6b0 → pymscada-0.2.6b2}/src/pymscada/demo/tags.yaml +0 -0
- {pymscada-0.2.6b0 → pymscada-0.2.6b2}/src/pymscada/demo/witsapi.yaml +0 -0
- {pymscada-0.2.6b0 → pymscada-0.2.6b2}/src/pymscada/demo/wwwserver.yaml +0 -0
- {pymscada-0.2.6b0 → pymscada-0.2.6b2}/src/pymscada/iodrivers/__init__.py +0 -0
- {pymscada-0.2.6b0 → pymscada-0.2.6b2}/src/pymscada/iodrivers/accuweather.py +0 -0
- {pymscada-0.2.6b0 → pymscada-0.2.6b2}/src/pymscada/iodrivers/logix_client.py +0 -0
- {pymscada-0.2.6b0 → pymscada-0.2.6b2}/src/pymscada/iodrivers/logix_map.py +0 -0
- {pymscada-0.2.6b0 → pymscada-0.2.6b2}/src/pymscada/iodrivers/modbus_client.py +0 -0
- {pymscada-0.2.6b0 → pymscada-0.2.6b2}/src/pymscada/iodrivers/modbus_map.py +0 -0
- {pymscada-0.2.6b0 → pymscada-0.2.6b2}/src/pymscada/iodrivers/modbus_server.py +0 -0
- {pymscada-0.2.6b0 → pymscada-0.2.6b2}/src/pymscada/iodrivers/openweather.py +0 -0
- {pymscada-0.2.6b0 → pymscada-0.2.6b2}/src/pymscada/iodrivers/piapi.py +0 -0
- {pymscada-0.2.6b0 → pymscada-0.2.6b2}/src/pymscada/iodrivers/ping_client.py +0 -0
- {pymscada-0.2.6b0 → pymscada-0.2.6b2}/src/pymscada/iodrivers/ping_map.py +0 -0
- {pymscada-0.2.6b0 → pymscada-0.2.6b2}/src/pymscada/iodrivers/sms.py +0 -0
- {pymscada-0.2.6b0 → pymscada-0.2.6b2}/src/pymscada/iodrivers/snmp_client.py +0 -0
- {pymscada-0.2.6b0 → pymscada-0.2.6b2}/src/pymscada/iodrivers/snmp_map.py +0 -0
- {pymscada-0.2.6b0 → pymscada-0.2.6b2}/src/pymscada/iodrivers/witsapi.py +0 -0
- {pymscada-0.2.6b0 → pymscada-0.2.6b2}/src/pymscada/iodrivers/witsapi_POC.py +0 -0
- {pymscada-0.2.6b0 → pymscada-0.2.6b2}/src/pymscada/main.py +0 -0
- {pymscada-0.2.6b0 → pymscada-0.2.6b2}/src/pymscada/misc.py +0 -0
- {pymscada-0.2.6b0 → pymscada-0.2.6b2}/src/pymscada/module_config.py +0 -0
- {pymscada-0.2.6b0 → pymscada-0.2.6b2}/src/pymscada/pdf/__init__.py +0 -0
- {pymscada-0.2.6b0 → pymscada-0.2.6b2}/src/pymscada/pdf/__pycache__/__init__.cpython-311.pyc +0 -0
- {pymscada-0.2.6b0 → pymscada-0.2.6b2}/src/pymscada/pdf/one.pdf +0 -0
- {pymscada-0.2.6b0 → pymscada-0.2.6b2}/src/pymscada/pdf/two.pdf +0 -0
- {pymscada-0.2.6b0 → pymscada-0.2.6b2}/src/pymscada/periodic.py +0 -0
- {pymscada-0.2.6b0 → pymscada-0.2.6b2}/src/pymscada/protocol_constants.py +0 -0
- {pymscada-0.2.6b0 → pymscada-0.2.6b2}/src/pymscada/samplers.py +0 -0
- {pymscada-0.2.6b0 → pymscada-0.2.6b2}/src/pymscada/tag.py +0 -0
- {pymscada-0.2.6b0 → pymscada-0.2.6b2}/src/pymscada/tools/get_history.py +0 -0
- {pymscada-0.2.6b0 → pymscada-0.2.6b2}/src/pymscada/tools/snmp_client2.py +0 -0
- {pymscada-0.2.6b0 → pymscada-0.2.6b2}/src/pymscada/tools/walk.py +0 -0
- {pymscada-0.2.6b0 → pymscada-0.2.6b2}/src/pymscada/www_server.py +0 -0
- {pymscada-0.2.6b0 → pymscada-0.2.6b2}/src/pymscada.egg-info/SOURCES.txt +0 -0
- {pymscada-0.2.6b0 → pymscada-0.2.6b2}/src/pymscada.egg-info/dependency_links.txt +0 -0
- {pymscada-0.2.6b0 → pymscada-0.2.6b2}/src/pymscada.egg-info/entry_points.txt +0 -0
- {pymscada-0.2.6b0 → pymscada-0.2.6b2}/src/pymscada.egg-info/requires.txt +0 -0
- {pymscada-0.2.6b0 → pymscada-0.2.6b2}/src/pymscada.egg-info/top_level.txt +0 -0
- {pymscada-0.2.6b0 → pymscada-0.2.6b2}/tests/test_alarms.py +0 -0
- {pymscada-0.2.6b0 → pymscada-0.2.6b2}/tests/test_bus_server.py +0 -0
- {pymscada-0.2.6b0 → pymscada-0.2.6b2}/tests/test_callout.py +0 -0
- {pymscada-0.2.6b0 → pymscada-0.2.6b2}/tests/test_config.py +0 -0
- {pymscada-0.2.6b0 → pymscada-0.2.6b2}/tests/test_history.py +0 -0
- {pymscada-0.2.6b0 → pymscada-0.2.6b2}/tests/test_misc.py +0 -0
- {pymscada-0.2.6b0 → pymscada-0.2.6b2}/tests/test_opnotes.py +0 -0
- {pymscada-0.2.6b0 → pymscada-0.2.6b2}/tests/test_periodic.py +0 -0
- {pymscada-0.2.6b0 → pymscada-0.2.6b2}/tests/test_samplers.py +0 -0
- {pymscada-0.2.6b0 → pymscada-0.2.6b2}/tests/test_sms.py +0 -0
- {pymscada-0.2.6b0 → pymscada-0.2.6b2}/tests/test_tag.py +0 -0
|
@@ -211,6 +211,7 @@ class Alarms:
|
|
|
211
211
|
self.rta = Tag(rta_tag, dict)
|
|
212
212
|
self.rta.value = {'__rta_id__': 0}
|
|
213
213
|
self.busclient.add_callback_rta(rta_tag, self.rta_cb)
|
|
214
|
+
self.busclient.add_tag(self.rta)
|
|
214
215
|
self._init_db(db, table)
|
|
215
216
|
self.periodic = Periodic(self.periodic_cb, 1.0)
|
|
216
217
|
|
|
@@ -77,6 +77,10 @@ class BusClient:
|
|
|
77
77
|
jsonstr = json.dumps(request).encode()
|
|
78
78
|
size = len(jsonstr)
|
|
79
79
|
data = struct.pack(f'>B{size}s', pc.TYPE.JSON, jsonstr)
|
|
80
|
+
action = request.get("action", "unknown")
|
|
81
|
+
tag_id = self.tag_by_name[tagname].id
|
|
82
|
+
logging.info(f'{self.module}: RTA sending {tagname} {action} to'
|
|
83
|
+
f' tag_id {tag_id}')
|
|
80
84
|
self.write(pc.COMMAND.RTA, self.tag_by_name[tagname].id, time_us, data)
|
|
81
85
|
|
|
82
86
|
def write(self, command: pc.COMMAND, tag_id: int, time_us: int,
|
|
@@ -84,6 +88,12 @@ class BusClient:
|
|
|
84
88
|
"""Write a message."""
|
|
85
89
|
if data is None:
|
|
86
90
|
data = b''
|
|
91
|
+
try:
|
|
92
|
+
size_total = len(data)
|
|
93
|
+
except Exception:
|
|
94
|
+
size_total = 0
|
|
95
|
+
logging.info(f'{self.module}: write cmd={command} tag_id={tag_id} '
|
|
96
|
+
f'size_total={size_total}')
|
|
87
97
|
for i in range(0, len(data) + 1, pc.MAX_LEN):
|
|
88
98
|
snip = data[i:i+pc.MAX_LEN]
|
|
89
99
|
size = len(snip)
|
|
@@ -94,7 +104,9 @@ class BusClient:
|
|
|
94
104
|
except (asyncio.IncompleteReadError, ConnectionResetError):
|
|
95
105
|
self.read_task.cancel()
|
|
96
106
|
except AttributeError:
|
|
97
|
-
logging.warning('
|
|
107
|
+
logging.warning(f'{self.module}: write AttributeError '
|
|
108
|
+
f'cmd={command} '
|
|
109
|
+
f'tag_id={tag_id} size={size}')
|
|
98
110
|
|
|
99
111
|
def add_tag(self, tag: Tag):
|
|
100
112
|
"""Add the new tag and get the tag's bus ID."""
|
|
@@ -209,10 +221,13 @@ class BusClient:
|
|
|
209
221
|
data = struct.unpack_from(f'!{len(value) - 1}s', value, offset=1
|
|
210
222
|
)[0].decode()
|
|
211
223
|
data = json.loads(data)
|
|
224
|
+
action = data.get("action", "unknown")
|
|
225
|
+
logging.info(f'{self.module}: RTA received {tag.name} {action} '
|
|
226
|
+
f'from tag_id {tag_id}')
|
|
212
227
|
try:
|
|
213
228
|
self.rta_handlers[tag.name](data)
|
|
214
229
|
except KeyError:
|
|
215
|
-
logging.warning(f'unhandled RTA for {tag.name} {data}')
|
|
230
|
+
logging.warning(f'{self.module}: unhandled RTA for {tag.name} {data}')
|
|
216
231
|
else:
|
|
217
232
|
raise SystemExit(f'Invalid message {cmd}')
|
|
218
233
|
|
|
@@ -201,15 +201,21 @@ class BusServer:
|
|
|
201
201
|
try:
|
|
202
202
|
tag = BusTags._tag_by_id[tag_id]
|
|
203
203
|
except KeyError:
|
|
204
|
+
logging.warning(f'RTA KeyError {tag_id}')
|
|
204
205
|
self.connections[bus_id].write(
|
|
205
206
|
pc.COMMAND.ERR, tag_id, time_us,
|
|
206
207
|
f"RTA KeyError {tag_id}".encode())
|
|
208
|
+
return
|
|
207
209
|
try:
|
|
210
|
+
logging.info(f'RTA forwarding {tag.name} from_bus={tag.from_bus} '
|
|
211
|
+
f'to bus_id={tag.from_bus}')
|
|
208
212
|
self.connections[tag.from_bus].write(
|
|
209
213
|
pc.COMMAND.RTA, tag_id, tag.time_us, data)
|
|
210
214
|
except KeyError:
|
|
211
|
-
logging.warning(f'
|
|
215
|
+
logging.warning(f'RTA forwarding failed: busclient for '
|
|
216
|
+
f'{tag.name} (from_bus={tag.from_bus}) is gone')
|
|
212
217
|
except Exception as e:
|
|
218
|
+
logging.warning(f'RTA forwarding error {tag.name}: {e}')
|
|
213
219
|
self.connections[bus_id].write(
|
|
214
220
|
pc.COMMAND.ERR, tag_id, time_us,
|
|
215
221
|
f"RTA {tag_id} {e}".encode())
|
|
@@ -288,6 +294,8 @@ class BusServer:
|
|
|
288
294
|
def read_callback(self, command):
|
|
289
295
|
"""Process read messages, delete broken connections."""
|
|
290
296
|
bus_id, cmd, tag_id, time_us, data = command
|
|
297
|
+
logging.info(f'recv cmd={cmd} tag_id={tag_id} bus_id={bus_id} '
|
|
298
|
+
f'size={(0 if data is None else len(data))}')
|
|
291
299
|
if cmd is None:
|
|
292
300
|
# Clean up tag subscriptions before deleting it
|
|
293
301
|
for tag in BusTags._tag_by_id.values():
|
|
@@ -145,6 +145,7 @@ class Callout:
|
|
|
145
145
|
'groups': self.groups,
|
|
146
146
|
'escalation': self.escalation}
|
|
147
147
|
self.busclient.add_callback_rta(rta_tag, self.rta_cb)
|
|
148
|
+
self.busclient.add_tag(self.rta)
|
|
148
149
|
self.periodic = Periodic(self.periodic_cb, 1.0)
|
|
149
150
|
|
|
150
151
|
def alarms_cb(self, alm_tag):
|
|
@@ -33,6 +33,7 @@ class Files():
|
|
|
33
33
|
self.rta = Tag(rta_tag, dict)
|
|
34
34
|
self.rta.value = {}
|
|
35
35
|
self.busclient.add_callback_rta(rta_tag, self.rta_cb)
|
|
36
|
+
self.busclient.add_tag(self.rta)
|
|
36
37
|
|
|
37
38
|
def rta_cb(self, request):
|
|
38
39
|
"""Respond to Request to Author and publish on rta_tag as needed."""
|
|
@@ -272,6 +272,7 @@ class History():
|
|
|
272
272
|
self.rta = Tag(rta_tag, bytes)
|
|
273
273
|
self.rta.value = b'\x00\x00\x00\x00\x00\x00' # rta_id is 0
|
|
274
274
|
self.busclient.add_callback_rta(rta_tag, self.rta_cb)
|
|
275
|
+
self.busclient.add_tag(self.rta)
|
|
275
276
|
|
|
276
277
|
def rta_cb(self, request: Request):
|
|
277
278
|
"""Respond to bus requests for data to publish on rta."""
|
|
@@ -104,6 +104,7 @@ class OpNotes:
|
|
|
104
104
|
"""Respond to Request to Author and publish on rta_tag as needed."""
|
|
105
105
|
local_time = datetime.now().strftime('%Y-%m-%d %H:%M:%S')
|
|
106
106
|
logging.info(f'[{local_time}] RTA callback received: {request}')
|
|
107
|
+
logging.info(f'[{local_time}] DEBUG: rta_tag.id={self.rta.id}, rta_tag.name={self.rta.name}')
|
|
107
108
|
|
|
108
109
|
if 'action' not in request:
|
|
109
110
|
logging.warning(f'rta_cb malformed {request}')
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{pymscada-0.2.6b0 → pymscada-0.2.6b2}/src/pymscada/demo/__pycache__/__init__.cpython-311.pyc
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|