pwitab / iec62056-21

A Python library for IEC62056-21, Local Data Readout of Energy Meters. Former IEC1107
BSD 3-Clause "New" or "Revised" License
67 stars 21 forks source link

7 not able to enter programming mode #10

Closed Krolken closed 4 years ago

Krolken commented 4 years ago

Fixes issues in connection to standard IEC 62056-21 meters, Fixes #7 and #8 .

arkjotgreen commented 2 years ago

Hi Krolken, I have a question, I am trying with my application and your library to read the value from an energy meter (Itron model SL7000). When trying to connect, a "Pipe Broken" error is generated. I don't understand where the problem is. I post the code. Thanks so much!

from iec62056_21.client import Iec6205621Client

client = Iec6205621Client.with_tcp_transport(address=('192.168.0.7', 4001),
                                                         device_address='17',
                                                         password='00000000')

client.connect()
client.standard_readout()
client.disconnect()
Krolken commented 2 years ago

@arkjotgreen could you create an issue and also post the debug output from your program.

arkjotgreen commented 2 years ago

$ testReadDLMSProt.py:10: ResourceWarning: unclosed <socket.socket fd=3, family=AddressFamily.AF_INET, type=2049, proto=0, laddr=('172.18.0.3', 52940), raddr=('192.168.0.7', 4001)> ResourceWarning: Enable tracemalloc to get the object allocation traceback

The compiler to stop over "client.standard_readout()", it's waiting for 20-30sec and generate this message.

Ok sorry i have testing this code with unittest, but without it, used a simple file with call function it's generate this output, always to this istruction client.standard_readout():

[Errno 32] Broken pipe