ArminJo / Arduino-DTSU666H_PowerMeter

Arduino Nano substitute for a RS485 3 Phase DTSU666-H coil based power meter. Less resolution, but better display
GNU General Public License v3.0
6 stars 0 forks source link

Sofar ktl-x inverter help #1

Open folny opened 6 months ago

folny commented 6 months ago

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 ?.

ArminJo commented 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).

folny commented 6 months ago

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)) {

ArminJo commented 6 months ago

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

folny commented 6 months ago

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.

https://www.elektroda.com/rtvforum/topic3698233-180.html

ArminJo commented 6 months ago

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;
folny commented 6 months ago

Nothing helps, I've tried almost everything.

ArminJo commented 6 months ago

Switching A and B sometimes helped.

folny commented 6 months ago

Do you mean switching cables A+ B- ?.

ArminJo commented 6 months ago

Yes, sometimes they were labelled wrong, so it's at least worth a try.

folny commented 6 months ago

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.

ArminJo commented 6 months ago

Please try the latest version from this repo. I included the changes for you.

folny commented 6 months ago

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.

folny commented 6 months ago

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.