Talk with "Saia PCD ALD1D5FD" energy meter #1534
-
I have a "Saia PCD ALD1D5FD" energy meter and a RS485-USB-Adapter... The energy meter docs are here: https://sbc-support.com/de/produkt-index/axx-energiezaehler/ald1-1-ph-modbus/ I set the address of the energy meter to 0x1 and tried this: client = ModbusSerialClient(
port,
baudrate=9600,
bytesize=8,
parity='N',
stopbits=1,
timeout=1,
)
print('connected:', client.connect())
print(client)
for address in range(5):
print('try address:', hex(address))
for slave_id in range(5):
print(f'{slave_id=}')
print('read_input_registers', client.read_input_registers(address=address, count=1, slave=slave_id))
print('read_coils', client.read_coils(address=address, count=1, slave=slave_id))
print('read_device_information', client.read_device_information(address=address, count=1, slave=slave_id))
print(client.recv(128))
client.close() But i get nothing: In the end Think 9600 with 8N1 is correct. What is the best approach to systematically tackle this and exclude errors!!? |
Beta Was this translation helpful? Give feedback.
Replies: 8 comments 10 replies
-
Run with debug. |
Beta Was this translation helpful? Give feedback.
-
Try with different baudrate, why should 9.600 be the default. |
Beta Was this translation helpful? Give feedback.
-
I have the same problem with the same counter. My setup:
I tried swapping A and B and different combinations of omitting the resistors. I tried different software configurations (baud rate, parity, stop bit). I tried changing the slave ID. I tried a different counter (same model). The only thing I ever get is a timeout, no error code, no invalid data. I'm running out of ideas. @jedie, did you actually solve your problem? Could you describe your cabling? |
Beta Was this translation helpful? Give feedback.
-
You have a lot of resistors, that is not proper cabling. RS485 only uses one resistor (normally built into the device) at the end of the 2wires. Did you try with a different framer, modbus serial support 3 different framers. |
Beta Was this translation helpful? Give feedback.
-
Are you sure that the device have input registers (bit relays, not values). I would have expected other client calls. |
Beta Was this translation helpful? Give feedback.
-
The counter device has slave id 30 (it shows
In the device manual (PDF), the registers 1-40 are listed, so I expect registers with addresses 0 to 39 (
I kindly ask you to have a look at page 5 of the manual linked above, that's all I know about the device.
According to the manual above, only Read Holding Registers [03] are supported. Thus I chose
That would be bad, I hope to get one of the exception types
I will change that, thanks for the hints.
This is not a report of a pymodbus fault, sorry if you got this impression. I found this thread by searching for the the model ALD1D5FD. I'm using pymodbus to debug the problem without exactly knowing if it is caused by soft- or hardware. I tested 3 different devices of the same model now, different wires, cabling and resistors, using a USB dongle that works with different devices. Thanks to pymodbus I was able to change the framing, unfortunately without success. I think it's unlikely that all my devices are broken; everything but the modbus part is working fine. I find it interesting that the thread author has the same problem with the same device model, so it may be a quirk of this device model or manufacturer. Since I didn't find a solution or insight yet, I'm open for further ideas. Thanks for your time and efforts to help out. I really appreciate that! |
Beta Was this translation helpful? Give feedback.
-
I created a gist for the script and made the proposed changes. |
Beta Was this translation helpful? Give feedback.
-
I found the cause for the problem and a solution. pymodbus is not part of the problem. TLDR;Cause: FTDI chipset of the USB stick SolutionCabling:
Serial settings:
DetailsI tried a different modbus software: e.g. pymodbus; mbpoll (Linux); modpoll, QModMaster, RMMS (Windows); iobroker; several Arduino-based projects. The behavior was always the same: No response. Next try was to go one level deeper and send bytes to the serial device. I extracted a command from the pymodbus debug output: I used HTerm (Windows) to talk directly to the serial device. Observations:
The response contains a proper answer from slave 30 ( A web research revealed this user report in a forum:
It also contains a statement from the chipset manufacturer FTDI:
After adding the resistors, the response Whenever the serial settings change, the device needs a few (5-20) commands to auto-detect the new settings. |
Beta Was this translation helpful? Give feedback.
Please read about rs485 cabling, it does not have polarity.