Comments (3)
Hi
It seems your meter is using protocol mode A instead of C, that I have focused this library on so far.
In protocol mode A there is no baudrate switching so everything is still on 300 baud and the data is returned directly after the init request is send.
But you should be able to use the public functions of the client to read the data properly.
client.send_init_request()
identification = client.read_identification() # Read the first line as the identification
data = client.read_response() # Reads the data response
from iec62056-21.
@Krolken
Thanks for your information, now it is working 👍
#!/usr/bin/python3
from iec62056_21.client import Iec6205621Client
import logging
# set up logging so you get a bit nicer printout of what is happening.
logging.basicConfig(
level=logging.DEBUG,
format="%(asctime)s,%(msecs)d %(levelname)s: %(message)s",
datefmt="%H:%M:%S",
)
client = Iec6205621Client.with_serial_transport(port='/dev/ttyUSB0')
client.connect()
client.send_init_request()
identification = client.read_identification() # Read the first line as the identification
data = client.read_response() # Reads the data response
Results:
same as response = ser.readline()...
16:18:27,247 DEBUG: Received
b'\x020.9.1(161710)\r\n
0.9.2(1200707)\r\n
0.0.0(00339188)\r\n
0.2.0(1.03)\r\n
C.1.6(FDF5)\r\n
1.8.1(0011414.755*kWh)\r\n
1.8.2(0023842.912*kWh)\r\n
2.8.1(0015660.611*kWh)\r\n
2.8.2(0000909.192*kWh)\r\n
F.F.0(0000000)\r\n
!\r\n\
x03=' over transport: SerialTransport
from iec62056-21.
great :)
Use the .data
on the AnswerResponse
to get a list of all DataSet
s.
So data.data
in your code.
from iec62056-21.
Related Issues (20)
- switch baudrate HOT 3
- rest() from Iec6205621Client HOT 4
- read_single_value HOT 5
- connecting via GSM HOT 11
- ZMD energy meter HOT 4
- Update Pypi HOT 9
- support protocol mode = 2 in AckOptionSelectMessage HOT 2
- Move to attrs classes for messages
- Request support for HAN-NVE (a.k.a. Norwegian RJ45 HAN-port standard) interface over M-Bus HOT 1
- Implementing protocol to my client file. HOT 5
- Issue " connection being refused after dockerize and running mininet " HOT 4
- Socket Timeout HOT 3
- read 1.8.0
- Problem with client.read_value
- readout of landis + gyr120AP HOT 1
- trying to readout EMH - LZQJ-XC but cant build up connection HOT 9
- Not able to enter programming mode on EMH meter - serial transport
- EMH meter is only responding with ACK on read. HOT 1
- Not able to send address in init request over serial transport
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from iec62056-21.