Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/gisce/iec870ree_moxa
Physical layer for using a Moxa devices with reeprotocol library
https://github.com/gisce/iec870ree_moxa
870-5-102 contadores electric hacktoberfest iec meters moxa python ree
Last synced: about 2 months ago
JSON representation
Physical layer for using a Moxa devices with reeprotocol library
- Host: GitHub
- URL: https://github.com/gisce/iec870ree_moxa
- Owner: gisce
- License: agpl-3.0
- Created: 2018-07-13T09:34:33.000Z (over 6 years ago)
- Default Branch: master
- Last Pushed: 2024-05-07T09:02:50.000Z (8 months ago)
- Last Synced: 2024-05-07T10:26:09.537Z (8 months ago)
- Topics: 870-5-102, contadores, electric, hacktoberfest, iec, meters, moxa, python, ree
- Language: Python
- Homepage:
- Size: 37.1 KB
- Stars: 2
- Watchers: 17
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.rst
- License: LICENSE
Awesome Lists containing this project
README
Moxa Physical layer
===================Physical layer for using a `Moxa devices `_
for `IEC870REE library `_Using:
.. code-block:: python
from iec870ree_moxa import Moxa
from iec870ree.ip import Ip
from iec870ree.protocol import LinkLayer, AppLayer
import iec870ree.protocol
import datetimeip_layer = iec870ree.ip.Ip(('127.0.0.1', 40001))
physical_layer = Moxa('PHONENUMBER', ip_layer)
link_layer = iec870ree.protocol.LinkLayer(10345, 1)
link_layer.initialize(physical_layer)
app_layer = iec870ree.protocol.AppLayer()
app_layer.initialize(link_layer)
physical_layer.connect()
link_layer.link_state_request()
link_layer.remote_link_reposition()
logging.info("before authentication")
resp = app_layer.authenticate(1)
logging.info("CLIENTE authenticate response {}".format(resp))
logging.info("before read")start_date = datetime.datetime(2018, 4, 1, 0, 0)
end_date = datetime.datetime(2018, 4, 2, 1, 0)for resp in app_layer.read_integrated_totals(start_date, end_date):
logging.info("read response {}".format(resp))
physical_layer.disconnect()