pwitab / iec62056-21

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

support protocol mode = 2 in AckOptionSelectMessage #19

Open dawidce opened 3 years ago

dawidce commented 3 years ago

Hi,

I changed:

def to_representation(self): return f"{constants.ACK}2{self.baud_char}{self.mode_char}{constants.LINE_END}" and the meter responds with standard readout. 16:14:30,929 DEBUG: Connecting to ('192.168.200.222', 2222) 16:14:30,931 INFO: Staring init sequence 16:14:30,931 INFO: Sending request message: RequestMessage(device_address='') 16:14:30,931 DEBUG: Sent b'/?!\r\n' over transport: TcpTransport 16:14:30,931 DEBUG: Resting for 0.25 seconds 16:14:31,182 DEBUG: Received b'/APA5\\2NORAX30\r\n' over transport: TcpTransport 16:14:31,182 INFO: Received identification message: IdentificationMessage(identification='2NORAX30', manufacturer='APA', switchover_baudrate_char='5') 16:14:31,182 INFO: Sending AckOptionsSelect message: AckOptionSelectMessage(baud_char='5', mode_char='6') 16:14:31,182 DEBUG: Sent b'\x06256\r\n' over transport: TcpTransport 16:14:31,182 DEBUG: Resting for 0.25 seconds 16:14:31,433 INFO: Reading standard readout from device. 16:14:33,220 DEBUG: Received b'\x020-0:C.1.0(72432595)\r

party is set to 7E1. The converter is set manually. If i switch to 8N1 the meter stops responding.

Using manufacturers software I can read via IEC mode C additional registers. Registers hold energy consumption every 15 and 60 minutes but they are protected with the password. I dont know how to read them with Your library.

UPDATE

I think that support for LOAD_PROFILE is missing

Krolken commented 2 years ago

Hi. Im back from vacation.

I think this is 2 issues. Could you create the load profile as a separate one? I am guessing that you want to read the P.01 profile for example. It should be possible to grok as it is. But there is now parsing in it as of now. I have some old code for it that is not working with this library though.

dawidce commented 2 years ago

Hi,

im on vacation right now.

Tried to read P.01 profile with success. I had to make same changes in code due to different requirements in meter communication.

W dniu 18.08.2021 o 17:35, Henrik Wahlgren pisze:

Hi. Im back from vacation.

I think this is 2 issues. Could you create the load profile as a separate one? I am guessing that you want to read the P.01 profile for example. It should be possible to grok as it is. But there is now parsing in it as of now. I have some old code for it that is not working with this library though.

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/pwitab/iec62056-21/issues/19#issuecomment-901216138, or unsubscribe https://github.com/notifications/unsubscribe-auth/APTEG524MPB3S3FBXNN5EVLT5PHNDANCNFSM5AJHYQ7A. Triage notifications on the go with GitHub Mobile for iOS https://apps.apple.com/app/apple-store/id1477376905?ct=notification-email&mt=8&pt=524675 or Android https://play.google.com/store/apps/details?id=com.github.android&utm_campaign=notification-email.