Closed da3020 closed 6 years ago
I'm having similar problems.
I have this rs232 <-> rs485 converter: https://www.sparkfun.com/products/10124
If i remove one byte in the beginning and end of response it works fine. But for some reason i get a trailing and leading zero on every response.
My fix is to just throw these away before we parse the response.
I have installed 120 ohm resistors, tried to change the 220 ohm smd resistor on the module with a 120 ohm resitor but still get the same results.
I am using softwareserial and ESP8266 on an nodemcu 0.9.
Don't know if this is a bug of this library, probably more lika a hardware issue. But it might help others coming here.
RS485 RTU SDM120*** Connec modbus fail. REG >>> 0 Connec modbus fail. REG >>> 6 Connec modbus fail. REG >>> C Connec modbus fail. REG >>> 1E Connec modbus fail. REG >>> 46 Connec modbus fail. REG >>> 156
Voltage = 0.00 VAC Current = 0.00 Amps Active Power= 0.00 Watts Power Factor = 0.00 Frequency = 0.00 Hz Total Active Energy = 0.00 kWh Connec modbus fail. REG >>> 0 Connec modbus fail. REG >>> 6 Connec modbus fail. REG >>> C Connec modbus fail. REG >>> 1E Connec modbus fail. REG >>> 46 Connec modbus fail. REG >>> 156
is it due to my convertor problem?
Hi guys. I've bought SDM120 power meter on Aliexpress. It has no any suffixes at label. Just SDM120. Looks exactly like this. I have spend three days trying to connect it to Arduino Mega and parsed four different librarys before I've understood one really despicable thing. The item is that it has OWN undocumented protocol. I vave found original protocol on the manufacturer's website. But meter from Aliexpress did not match this.
So, it seams like first byte is missing and response starts from second byte. And really - if I interpret b4-b7 bytes like the value then it works! Code needs to be changed like:
and error checks need to be redused. But I don't know what the last byte meens.
I have found interesting thing now. If I cut first and last bytes from response and calculate CRC for remaining bytes on this website then last byte of CRC-16 (modbus) value is ALWAYS equal to cutted last byte from response. See screenshot
Is it any simplified CRC byte? Does anybody knows?
Hi again! I have serious reasons to believe that rs485-ttl convertor is the reason of my fault. Yes!!! It need to remove R7 resistor from rs485 to TTL convertor!