Hi
Iam bussy with Arduino platform, In the GXDLMSDirector I had to set the maximum payload to 1010 for kamstrup for it to work. Must I do the same in the dmls ansi C Pak. I have search for HDLC_BUFFER_SIZE.
Regards Gerdus
Usually maxInfoTX or maxInfoRX don't need to change. Meter tells what values it can accept, but Kampstrup meter is a little bit different. It's not possible to change maxInfoTX or maxInfoRX in the Arduino wrapper at the moment.
Ad hoc: Open GXDLMSClient.cpp and change this:
//Initialize DLMS settings.
cl_init(&settings, useLogicalNameReferencing, clientAddress, serverAddress, authentication, password, interfaceType);
//ADD THIS LINE!
settings.maxInfoTX = settings.maxInfoRX = 1010;
I'll add this to the work list. The new version is released in the next week and changing maxInfoRX and maxInfoTX is there.
The client address is changed when the authentication level changes. The server address is usually the same for that communication channel. If you change the communication channel, the server address might be changed.
Hi
My default DLMS address is 32, 0010 0000. If I understand it correctly my DLMS address will be in the range from 32 - 224. 0010 0000 - 1110 0000.
Regrads Gerdus
Hi
I am communicating over RS485 half duplex line with the kamstrup meter. I need to toggle the Tx and RX enable line for it to Tx and Rx data. I have done here, is it at the correct place in the firmware:
//Send data.
digitalWrite(3, 1); //enable Max485 to TX
digitalWrite(2, 1);
delay(1000);
if ((ret = Serial1.write(data->data, data->size)) != data->size)
{
//If failed to write all bytes.
GXTRACE(GET_STR_FROM_EEPROM("Failed to write all data to the serial port.\n"), NULL);
}
//Loop until packet is complete.
do
{
if ((ret = com_readSerialPort(0x7E)) != 0)
{
if (ret == DLMS_ERROR_CODE_RECEIVE_FAILED && resend == RESEND_COUNT)
{
return DLMS_ERROR_CODE_SEND_FAILED;
}
++resend;
GXTRACE_INT(GET_STR_FROM_EEPROM("Data send failed. Try to resend."), resend);
if ((ret = Serial1.write(data->data, data->size)) != data->size)
{
//If failed to write all bytes.
GXTRACE(GET_STR_FROM_EEPROM("Failed to write all data to the serial port.\n"), NULL);
}
}
digitalWrite(3, 0); //enable Max485 to RX
digitalWrite(2, 0);
ret = Client.GetData(&frameData, reply);
if (ret != 0 && ret != DLMS_ERROR_CODE_FALSE)
{
break;
}
} while (reply->complete == 0);
return ret;
}
It's impossible to say because there are variations in how to handle different RS-485 chipsets.
Have you done RS-485 connection by yourself or are you using Arduino Hat or module?
Your client and server address are different and for that reason, the meter doesn't reply. If you are using a daisy chain, each meter has a unique server address and you can't use server address 1.
Hi
I have change the client.ini as suggested by you, Here is the string I get Now:
7E A0 14 21 25 93 80 36 81 80 08 05 02 03 F2 06 02 03 F2 03 F0 7E
GXDLMS Director
7E A0 20 21 25 93 9E 08 81 80 14 05 02 03 F2
06 02 03 F2 07 04 00 00 00 01 08 04 00 00 00 01
0A 75 7E
The first difference I see is 3 byte Arduino 14 and GX 20 and then it is the 7 byte 80 DX is 9E.
So it seems to me it is the frame format wich is different A0 14 GX A0 20
Regards Gerdus
Hi Gerdus,
Hi Gerdus,
Usually maxInfoTX or maxInfoRX don't need to change. Meter tells what values it can accept, but Kampstrup meter is a little bit different. It's not possible to change maxInfoTX or maxInfoRX in the Arduino wrapper at the moment.
Ad hoc: Open GXDLMSClient.cpp and change this:
//Initialize DLMS settings.
cl_init(&settings, useLogicalNameReferencing, clientAddress, serverAddress, authentication, password, interfaceType);
//ADD THIS LINE!
settings.maxInfoTX = settings.maxInfoRX = 1010;
I'll add this to the work list. The new version is released in the next week and changing maxInfoRX and maxInfoTX is there.
BR,
Mikko
Thanx, I have added the line.
Thanx, I have added the line. Kampstrup default password is 12345, where can i set it.
Regards Gerdus
Hi,
Hi,
Client.init(true, CLIENT_ADDRESS, 1, DLMS_AUTHENTICATION_LOW, "12345", DLMS_INTERFACE_TYPE_HDLC);
BR,
Mikko
Hi,
Hi,
What is the difference between the DLMS address and HDLC CLIENT address ?
Regards Gerdus
Hi,
Hi,
There is two address. Client address and server address.
http://www.gurux.fi/dlmsAddress
The client address is changed when the authentication level changes. The server address is usually the same for that communication channel. If you change the communication channel, the server address might be changed.
BR,
Mikko
Hi
Hi
My default DLMS address is 32, 0010 0000. If I understand it correctly my DLMS address will be in the range from 32 - 224. 0010 0000 - 1110 0000.
Regrads Gerdus
Hi,
Hi,
That is CLIENT_ADDRESS.
Try with this:
Client.init(true, 32, 1, DLMS_AUTHENTICATION_LOW, "12345", DLMS_INTERFACE_TYPE_HDLC);
BR,
Mikko
Hi
Hi
I am communicating over RS485 half duplex line with the kamstrup meter. I need to toggle the Tx and RX enable line for it to Tx and Rx data. I have done here, is it at the correct place in the firmware:
//Send data.
digitalWrite(3, 1); //enable Max485 to TX
digitalWrite(2, 1);
delay(1000);
if ((ret = Serial1.write(data->data, data->size)) != data->size)
{
//If failed to write all bytes.
GXTRACE(GET_STR_FROM_EEPROM("Failed to write all data to the serial port.\n"), NULL);
}
//Loop until packet is complete.
do
{
if ((ret = com_readSerialPort(0x7E)) != 0)
{
if (ret == DLMS_ERROR_CODE_RECEIVE_FAILED && resend == RESEND_COUNT)
{
return DLMS_ERROR_CODE_SEND_FAILED;
}
++resend;
GXTRACE_INT(GET_STR_FROM_EEPROM("Data send failed. Try to resend."), resend);
if ((ret = Serial1.write(data->data, data->size)) != data->size)
{
//If failed to write all bytes.
GXTRACE(GET_STR_FROM_EEPROM("Failed to write all data to the serial port.\n"), NULL);
}
}
digitalWrite(3, 0); //enable Max485 to RX
digitalWrite(2, 0);
ret = Client.GetData(&frameData, reply);
if (ret != 0 && ret != DLMS_ERROR_CODE_FALSE)
{
break;
}
} while (reply->complete == 0);
return ret;
}
Hi,
Hi,
It's impossible to say because there are variations in how to handle different RS-485 chipsets.
Have you done RS-485 connection by yourself or are you using Arduino Hat or module?
BR,
Mikko
Hi
Hi
I have done Rs485 Modbus with arduino .
Hi,
Hi,
Is this a Hat or have you done this with Maxim 485 chip? If you have done it, can you share the board schematic?
BR,
Mikko
Hi
Hi
Here is the circuit with 120 termination on/off Control.
Hi
Hi
My send data to the meter does not look the same as the working data from GXDLMSdirector. See the frame format.
Here is the string from the Arduino: Not working
7E A0 14 03 41 93 36 82 81 80 08 05 02 03 F2 06 02 03 F2 03 F0 7E FF
Here is the string from working GXDLMSdirector :
7E A0 20 21 25 93 9E 08 81 80 14 05 02 03 F2
06 02 03 F2 07 04 00 00 00 01 08 04 00 00 00 01
0A 75 7E
Here is how the client ini string looks like:
Client.init(true, 32, 1, DLMS_AUTHENTICATION_LOW, "12345", DLMS_INTERFACE_TYPE_HDLC);
Regards Gerdus
Hi,
Hi,
Try with this:
Client.init(true, 0x12, 0x10, DLMS_AUTHENTICATION_LOW, "12345", DLMS_INTERFACE_TYPE_HDLC);
Your client and server address are different and for that reason, the meter doesn't reply. If you are using a daisy chain, each meter has a unique server address and you can't use server address 1.
Check Device address from here:
https://www.gurux.fi/Gurux.DLMS.Objects.GXDLMSIecHdlcSetup
BR,
Mikko
Hi
Hi
I have change the client.ini as suggested by you, Here is the string I get Now:
7E A0 14 21 25 93 80 36 81 80 08 05 02 03 F2 06 02 03 F2 03 F0 7E
GXDLMS Director
7E A0 20 21 25 93 9E 08 81 80 14 05 02 03 F2
06 02 03 F2 07 04 00 00 00 01 08 04 00 00 00 01
0A 75 7E
The first difference I see is 3 byte Arduino 14 and GX 20 and then it is the 7 byte 80 DX is 9E.
So it seems to me it is the frame format wich is different A0 14 GX A0 20
Regards Gerdus
Hi Gerdus,
Hi Gerdus,
It seems like your meter can't handle SNRM if MaxInfoTX or MaxInfoRX is changed and WindowSizeTX or WindowSizeRX is missing.
This is changed for ANSI C to the same as C# so you can read your meter. Get the latest version and let me know if you have problems.
BR,
Mikko