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 11 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 10 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

  • Mon, 07/27/2026 - 12:37
    gurux.dlms.cpp 9.0.2607.2701
  • Thu, 07/23/2026 - 16:19
    gurux.dlms.java 4.0.96
  • Thu, 07/09/2026 - 14:34
    Gurux.DLMS.Python 1.0.201
  • Fri, 06/26/2026 - 16:32
    Gurux.Service 3.0.2606.2601
  • Wed, 06/24/2026 - 08:36
    Gurux.DLMS.Python 1.0.200

New forum topics

  • gurux_dlms.GXDateTime.GXDateTime object Error in Python
  • T_APPL_DATA_LN_N1 subtest 3 fails on an LN-only server regardless of the response to a non-existing-object GET
  • Version mismatch between Gurux.DLMS 9.x and Gurux.Common/Gurux.Serial 8.x
  • Service not known error on gprs communication
  • Help Needed: Interfacing Saral 100 Energy Meter with Microcontroller via RS232
More
RSS feed
Privacy FAQ GXDN Issues Contact
Follow Gurux on Twitter Follow Gurux on Linkedin