the first one is correct, the first 3 bytes come, like expected back: 01:03:28:00:01:00:01:00:00:80:00:00:00:00:00:00:02:02:48:02:48:01:C8:01:90:00:00:01:7C:00:00:01:77:00:00:00:1B:00:00:00:07:19:3D:26:FE
the second one is missing a byte and ‘unexpected’ bytes are returned: 40:20:09:01:00:01:00:00:80:00:00:00:00:00:00:02:02:48:02:48:01:C8:01:90:00:00:01:93:00:00:01:8B:00:00:00:1C:00:00:00:07:19:3D:C3:21
instead of ‘40:20:09’ there must be ‘01:03:28:00’
Now the question is, how can that be? I just changed the 485 module, the code and ESP are the same.
Why not, they are different modules. If you try third module, you might get no response at all…
The second one has one ic that could be voltage regulator. You should find some specs for that module. Also look at the chips they have, are they same in both?
The beginning looks corrupted. 40,20 is not any modbus exception response.
Might be that the second module has voltage regulator and needs 5V to operate correctly for example. Or the automatic flow control is misbehaving or… You could try to make two request in a row and see if you get two equal responses.
Ps. I controlled CRC for the “bad” response:
40:20:09:01:00:01:00:00:80:00:00:00:00:00:00:02:02:48:02:48:01:C8:01:90:00:00:01:93:00:00:01:8B:00:00:00:1C:00:00:00:07:19:3D
and correct CRC should be 33:94 instead of C3:21.
So the data is 100% sure corrupted.
Maybe your device is replying so quickly that the converter is not ready yet to receive.
Kind of strange that the corruption is always identic.
If you have common Usb-serial converter, you could wire that to Rs485 module and try with PC-software. That takes Esphome out of the trial.
There are many freeware available online.
There is no logic for the corruption even if I look at the bits:
00000001 00000011 00101000 00000000 (01:03:28:00)
00100000 01000000 00001001