Open folny opened 6 months ago
I only know the request of Deye Inverter for the DTSU666H. But I suspect your inverter will use the same request. Otherwise you must log the request bytes on the RS485 / (9600 Baud).
My inverter sends the request 01 03 20 14 00 06 8E 0C I changed only this line in the code but it seems that it is not enough.
if (!(sRequestBuffer[0] == 1 && sRequestBuffer[2] == 0x20 && sRequestBuffer[3] == 0x14)) {
Try to multiply power with 10 tPower.Float *= 10; // At address 20 14 DTSU send float power values in 0.1 kW units instead of dividing by 1000 (as done in original code). tPower.Float /= 1000; // At address 15 1E Deye expects float power values in kW units
I tried your instructions but still no result, the inverter says communication error. My connection is fine, so I don't know what the problem is. I found something about Sofar communication, so you can look at it and maybe find out where the problem is.
Try
sReplyBuffer[MODBUS_REPLY_LENGTH - 2] = tCRC;
sReplyBuffer[MODBUS_REPLY_LENGTH - 1] = tCRC >> 8;
instead of
sReplyBuffer[MODBUS_REPLY_LENGTH - 2] = tCRC >> 8;
sReplyBuffer[MODBUS_REPLY_LENGTH - 1] = tCRC;
Nothing helps, I've tried almost everything.
Switching A and B sometimes helped.
Do you mean switching cables A+ B- ?.
Yes, sometimes they were labelled wrong, so it's at least worth a try.
I already know where the problem is, the Sofar inverter sends the first request 01 03 00 06 00 01 64 0B. The DTSU666 responds to this request with information about the CT (Current transformer rate IrAt) setting from the address 0006H, and only when it receives the information does it start sending 01 03 20 14 00 06 8E 0C.
Please try the latest version from this repo. I included the changes for you.
Great job, looks like it should be fine now. I will test the code in the next few days and let you know if everything works correctly.
Hi
Sofar sends one more request which is 01 03 10 1E 00 0C 21 09 it is information about the export and import of electric energy of the meter. You can add it to your project.
Hi
I have a Sofar Solar ktl-x series inverter and I would like to use your project with my inverter. What all needs to be changed in the code so that the communication works correctly ?.