Open omaar25 opened 1 month ago
Try executing meterbus.debug(True)
before the recv_frame(ser, meterbus.FRAME_DATA_LENGTH)
. It will enable debug logging in the terminal.
Also, It's been a while, but I don't think you can use address 254
to request data, only for ping request. Address 253
is probably what you are looking for.
thanks for you assistance. Still the same problem
You can always try doing a very short time.sleep(0.3)
between the ACK frame and the sending of the request frame.
Another approach would be to test with the tools from https://github.com/rscada/libmbus, just to ensure that the device is actually responding. If the tools from libmbus aren't working either, it's probably something else, maybe the device expects a specific request frame.
Similar to how another developer had to craft their own request frame for a specific device; https://github.com/prein2/pyMeterBus/blob/e45fc0d19afaaaca0f3ac6412a642caa587c8239/tools/mbus-serial-request-data-multi-reply_Aestron630#L71
Hi
I run this code and i get MBusFrameDecodeError: ('empty frame', None)
!/usr/bin/python
import serial import meterbus address = 254 serial_port = 'COM3'
try: with serial.Serial(serial_port, 115200, bytesize=8, parity='N', stopbits=1, timeout=0.5) as ser: meterbus.send_ping_frame(ser, address) frame = meterbus.load(meterbus.recv_frame(ser, 1)) assert isinstance(frame, meterbus.TelegramACK)
except serial.SerialException as e: print(f"Could not open serial port {serial_port}: {e}")