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

1 year 9 months 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

1 year 9 months 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

  • Tue, 06/09/2026 - 11:16
    gurux.dlms.java 4.0.95
  • Tue, 06/09/2026 - 10:03
    Gurux.DLMS.Python 1.0.199
  • Mon, 06/08/2026 - 13:39
    gurux.dlms.cpp 9.0.2606.0801
  • Mon, 06/01/2026 - 10:15
    gurux.dlms.cpp 9.0.2606.0101
  • Thu, 05/28/2026 - 16:06
    gurux.dlms.java 4.0.94

New forum topics

  • Error reading L&G Meter
  • Pass a TCP Client to GXNet
  • Australian EDMI Mk10D (Essential Energy area)
  • Strange mix of data notificiation vs get response
  • DLMS Connection
More
RSS feed
Privacy FAQ GXDN Issues Contact
Follow Gurux on Twitter Follow Gurux on Linkedin