hello
I am trying to connect to the meter, I connected it easily with the software, but I have a problem with the arduino, thank you for your help.
trace gxdlmsDirector
***********************************
23:10:29 Send SNRM request.
TX: 7E A0 0A 00 02 7A C3 61 93 34 B8 7E
23:10:29
RX: 7E A0 23 61 00 02 7A C3 73 1C DD 81 80 14 05 02 02 11 06 02 02 11 07 04 00 00 00 01 08 04 00 00 00 01 FC A8 7E
23:10:29 Send AARQ request.
TX: 7E A0 66 00 02 7A C3 61 10 B8 1B E6 E6 00 60 55 A1 09 06 07 60 85 74 05 08 01 03 A6 0A 04 08 4C 59 45 30 30 30 30 31 8A 02 07 80 8B 07 60 85 74 05 08 02 01 AC 0A 80 08 38 37 36 35 34 33 32 31 BE 23 04 21 21 1F 30 00 00 00 00 FA 47 F4 C4 DC 2E 87 76 4A 67 D4 A0 DB 13 FA F2 16 9B 9E 6C 3A B5 B0 77 F8 14 2D F7 7E
23:10:30
RX: 7E A0 59 61 00 02 7A C3 30 98 55 E6 E7 00 61 48 A1 09 06 07 60 85 74 05 08 01 03 A2 03 02 01 00 A3 05 A1 03 02 01 00 A4 0A 04 08 4C 59 45 64 72 FB 0F 50 BE 23 04 21 28 1F 30 1E D1 A1 2B 37 A7 F6 4B 15 E6 29 FA D4 0B 17 6E 61 9A 88 87 63 66 EA E4 43 19 F2 55 2A 42 A6 01 7E
23:37:09 Send Keep Alive
TX: 7E A0 2F 00 02 7A C3 61 32 97 9F E6 E6 00 C8 1E 30 00 00 00 01 68 6D F9 76 AF FD 80 59 77 24 D7 12 B2 35 D7 26 EC F8 48 23 C6 49 16 FD 90 4E B2 7E
23:37:09
RX: 7E A0 2E 61 00 02 7A C3 52 D8 C3 E6 E7 00 CC 1D 30 11 95 FA 7B A5 DD 2B F8 0A B6 AD CF FB 9B 9E 97 C1 B4 6C D6 11 49 02 22 52 72 17 EF E7 E7 7E
23:39:09 Send Keep Alive
TX: 7E A0 2F 00 02 7A C3 61 54 A7 99 E6 E6 00 C8 1E 30 00 00 00 02 82 54 E2 A4 D9 79 F7 A8 13 E7 39 67 4E B5 13 25 B5 C7 C1 9B D9 59 1F 04 9D DC 2B 7E
23:39:09
RX: 7E A0 2E 61 00 02 7A C3 74 EC 87 E6 E7 00 CC 1D 30 06 62 1E CB 4F 65 9C 7B B0 66 D9 7E 07 89 1D 57 3B 99 94 86 B6 B1 54 D4 CD 8B 69 5E 90 17 7E
23:41:09 Send Keep Alive
TX: 7E A0 2F 00 02 7A C3 61 76 B7 9B E6 E6 00 C8 1E 30 00 00 00 03 76 F6 C4 29 F8 ED 87 B5 92 AA 84 D3 5B C5 E7 E0 0B 2C 9D 55 81 EB BF E8 CD 6F 20 7E
23:41:09
RX: 7E A0 2E 61 00 02 7A C3 96 F0 43 E6 E7 00 CC 1D 30 1B BD 60 3B 55 70 29 5E 10 FC 89 DE 0D E3 E7 D6 39 CE 41 AD 94 18 E8 0D 9D E0 4E 3C 46 70 7E
23:43:09 Send Keep Alive
TX: 7E A0 2F 00 02 7A C3 61 98 C7 95 E6 E6 00 C8 1E 30 00 00 00 04 35 FA 73 D4 E0 3F BF 0C 71 99 BC 0B 15 11 A6 0B E5 A2 62 33 44 B5 D9 2B E5 47 51 7E
23:43:09
RX: 7E A0 2E 61 00 02 7A C3 B8 8C 8B E6 E7 00 CC 1D 30 2B 91 C2 8B 5B 18 2F 72 E5 9C C8 84 E3 DD 91 D3 35 DB AC 0D 62 F9 0B D9 B3 13 0E 98 FF 44 7E
end******************************************
confige gxdlms director
-S COM1:2400:8NoneOne -c 48 -s 24289 -a Low -P 87654321 -C AuthenticationEncryption -T 4C59453030303031 -A 00000000000000000000000000000000 -B 00000000000000000000000000000000 -w 1 -f 128 -t Verbose
********************************************************************************
arduino code
void setup() {
GXTRACE(GET_STR_FROM_EEPROM("Start application"), NULL);
BYTE_BUFFER_INIT(&frameData);
//Set frame capacity.
bb_capacity(&frameData, 128);
Client.init(true,0x30 ,24289, DLMS_AUTHENTICATION_LOW, "87654321", DLMS_INTERFACE_TYPE_HDLC);
//Un-comment this if you want to set system title, block cipher key or authentication key.
Client.SetSecurity(DLMS_SECURITY_AUTHENTICATION_ENCRYPTION);
//TODO: Change logical name of the frame counter if it's used to com_readAllObjects.
gxByteBuffer bb;
bb_init(&bb);
bb_addHexString(&bb, GET_STR_FROM_EEPROM("4C59453030303031"));
Client.SetSystemTitle(&bb);
bb_clear(&bb);
bb_addHexString(&bb, GET_STR_FROM_EEPROM("00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00"));
Client.SetAuthenticationKey(&bb);
bb_clear(&bb);
bb_addHexString(&bb, GET_STR_FROM_EEPROM("00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00"));
Client.SetBlockCipherKey(&bb);
bb_clear(&bb);
//Serial 1 is used to send trace.
Serial.begin(9600);
GXTRACE(GET_STR_FROM_EEPROM("Start reading"), NULL);
// start serial port at 9600 bps:
Serial2.begin(2400);
while (!Serial2) {
; // wait for serial port to connect. Needed for native USB port only
}
}
void loop() {
int ret;
if (millis() - runTime > 5000)
{
runTime = millis();
GXTRACE(GET_STR_FROM_EEPROM("Start reading"), NULL);
//TODO: Change logical name of the frame counter if it's used.
ret = com_readAllObjects(NULL);
com_close();
}
}
*************************************************************************
trace arduino on port rs485
7E A0 0A 00 02 7A C3 61 93 34 B8 7E 7E A0 23 61 00 02 7A C3 73 1C DD 81 80 14 05 02 02 11 06 02 02 11 07 04 00 00 00 01 08 04 00 00 00 01 FC A8 7E 7E A0 66 00 02 7A C3 61 10 B8 1B E6 E6 00 60 55 A1 09 06 07 60 85 74 05 08 01 03 A6 0A 04 08 41 42 43 44 45 46 47 48 8A 02 07 80 8B 07 60 85 74 05 08 02 01 AC 0A 80 08 38 37 36 35 34 33 32 31 BE 23 04 21 21 1F 30 00 00 00 00 1F 58 4B 30 32 AF 28 57 07 70 C6 4D 7E 8F F5 E8 F6 98 DF 96 14 DC 45 4D F1 49 C8 5E 7E
************************************************************
serial trace arduino
1 :com_initializeConnection failed 260
Hi, Your client system title…
Hi,
Your client system title is different The client is sending 4142434445464748 and you have set 4C59453030303031. Check if Client.SetSystemTitle returns an error.
Check also why the block cipher key is different.
BR,
Mikko