Skip to main content
Home
for DLMS smart meters
Open source solutions for DLMS smart metering

Main navigation

  • Home
  • Products
  • About us
  • Open Source
  • Community
  • Forum
  • Downloads
User account menu
  • Log in

Breadcrumb

  1. Home
  2. Node
  3. Arduino Client

Arduino Client

By VokeXi , 6 September, 2024
Forums
Gurux.DLMS

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.

VokeXi

2 years ago

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?

Profile picture for user Kurumi

Kurumi

2 years ago

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

  • Create new account
  • Reset your password

Hire Us!

Latest Releases

  • Wed, 08/26/2026 - 09:04
    Gurux.DLMS.Python 1.0.203
  • Mon, 08/17/2026 - 11:28
    Gurux.DLMS.Python 1.0.202
  • Mon, 08/17/2026 - 09:47
    gurux.dlms.cpp 9.0.2608.1701
  • Mon, 08/17/2026 - 09:25
    gurux.dlms.c 9.0.2608.1701
  • Mon, 07/27/2026 - 12:37
    gurux.dlms.cpp 9.0.2607.2701

New forum topics

  • Security vulnerability report — request for a private contact (GuruxDLMS.c / ANSI C)
  • Topic: Insufficient Memory Error When Reading Class 7 Profile Generic Objects
  • SN ReadResponse returns all-null values when response spans multiple HDLC frames
  • Gurux.Serial.Android 3.0.6 – CH340 (HL-340) USB-Serial Adapter Not Working,
  • Trying to talk to a L&G E360 meter (Using Python Gurux)
More
RSS feed
Privacy FAQ GXDN Issues Contact
Follow Gurux on Twitter Follow Gurux on Linkedin