Hello people,
i have a question about Arduino Client Example. My program simulator have some authentication:
ClientAddress: 16(Public Client)
Application context name: LN No Ciphering
COSEM authentication mechanism: Low lever security
Passowrd: 12345678
Broadcast Encription Key: 0F 0E 0D 0C 0B 0A 09 08 07 06 05 04 03 02 01 00
Unicast Encription Key: 00 01 02 03 04 05 06 07 08 09 0A 0B 0C 0D 0E 0F
Dedicate Encription Key: FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF
Authentication Key: D0 D1 D2 D3 D4 D5 D6 D7 D8 D9 DA DB DC DD DE DF
User ID: 1
System Title Manufacturer ID: MEL, serial number 0000000001
I uncommented this part of code:
/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;
ba_init(&bb);
bb_addHexString(&bb, GET_STR_FROM_EEPROM("3132333435363738"));
Client.SetSystemTitle(&bb);
bb_clear(&bb);
bb_addHexString(&bb, GET_STR_FROM_EEPROM("D0 D1 D2 D3 D4 D5 D6 D7 D8 D9 DA DB DC DD DE DF"));
Client.SetAuthenticationKey(&bb);
bb_clear(&bb);
bb_addHexString(&bb, GET_STR_FROM_EEPROM("00 01 02 03 04 05 06 07 08 09 0A 0B 0C 0D 0E 0F"));
Client.SetBlockCipherKey(&bb);
bb_clear(&bb);
and when i try to upload it says 'bb_init' was not declared in this scope; did you mean 'ba_init'?
and when i change to ba_init i got this:
\Arduino\libraries\ClientArduino/bitarray.h:57:19: note: initializing argument 1 of 'void ba_init(bitArray*)'
57 | bitArray* arr);
| ~~~~~~~~~~^~~
exit status 1
Compilation error: cannot convert 'gxByteBuffer*' to 'bitArray*'
Has anyone had a similar problem? What should i do?
Thank You for all answers and help.
I solved the problem. In the…
I solved the problem. In the bytebuffer.h it says
#ifndef ESP_PLATFORM
#define BYTE_BUFFER_INIT bb_init
#else
#define BYTE_BUFFER_INIT bb_Init
so it must go bb_Init(&bb); not bb_init.
I can now upload the code but first i need to set the settings that i mentioned above with this part of code!
Someone help what information should i put?
Hi, Yes, you are right. ESP…
Hi,
Yes, you are right. ESP is using bb_init and for that reason, you need to use bb_Init.
If you are using Public Client, you don't use security.
You can use the same settings as the client example.
Client.init(true, 16, 1, DLMS_AUTHENTICATION_NONE, NULL, DLMS_INTERFACE_TYPE_HDLC);
https://github.com/Gurux/GuruxDLMS.c/blob/master/Arduino_IDE/client/cli…
BR,
Mikko