Skip to main content
Home
for DLMS smart meters

Main navigation

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

Breadcrumb

  1. Home
  2. ARDUINO CLIENT READING ISSUES

ARDUINO CLIENT READING ISSUES

By Shine, 9 November, 2024
Forums
General discussion

Dear Sir,

Is it possible to read meter using optical read head and Arduino client code.

Arduino setup code

GXTRACE(GET_STR_FROM_EEPROM("Start application"), NULL);
BYTE_BUFFER_INIT(&frameData);
//Set frame capacity.
bb_capacity(&frameData, 128);
Client.init(true, 16, 1, DLMS_AUTHENTICATION_HIGH, "****", 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("3132333435363738"));
Client.SetSystemTitle(&bb);
bb_clear(&bb);
bb_addHexString(&bb, GET_STR_FROM_EEPROM("D0 D1 D2 D3 D4 D5 D6 D7D8 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);
//Serial 1 is used to send trace.
// client.setInterfaceType
Serial1.begin(115200);
// start serial port at 9600 bps:
Serial.begin(9600);
while (!Serial) {
; // wait for serial port to connect. Needed for native USB port only
}
// Client.snrm
int ret;
GXTRACE(GET_STR_FROM_EEPROM("Start reading"), NULL);
//TODO: Change logical name of the frame counter if it's used.
ret = com_readAllObjects("0.0.43.1.0.255");
com_close();

This is the data that goes through the serial port when connecting the DLMS Detector through optical read head. captured from the optical read head(SNRM ,AARQ, keep alive request). I could not separate the individual request. The meter communication is properly working

A0 89 F9 7D D9 A9 D3 00 A0 F9 E5 7D DF 41 D9 86 86 3F 9B BD 7B BE 3F F5
51 DF AF FD EB BF FF 3A 7C AA 2E F5 EF FB FD A7 BE EE 27 23 17 9D 83 77
E3 FD FF FF FF F3 41 C1 F7 FF FF C3 45 01 00 58 B7 00

But why is there a difference between the serial data that I get when I give a SNRM request using Arduino?

Arduino request data

7E A0 07 03 21 93 0F 01 7E

Please provide solutions for this.

Thanks...

Profile picture for user Kurumi

Kurumi

7 months ago

Hi, It's impossible to say…

Hi,

It's impossible to say what is causing this because you have not added all hex messages.

Your Arduino SNRM message looks correct. If you don't get the reply from the meter, check your serial port settings.

BR,
Mikko

Shine

7 months ago

Sir 7E A0 07 03 21 93 0F 01…

Sir

7E A0 07 03 21 93 0F 01 7E

This is the serial port data of Arduino

Profile picture for user Kurumi

Kurumi

7 months ago

Hi, This is the correct SNRM…

Hi,

This is the correct SNRM message. If your meter doesn't reply your serial port settings are wrong, or the server/client address is different than the meter expects.

BR,
Mikko

  • Log in or register to post comments
  • Create new account
  • Reset your password

Hire Us!

Latest Releases

  • Wed, 06/04/2025 - 13:35
    gurux.dlms.c 9.0.2506.0401
  • Fri, 05/30/2025 - 08:30
    gurux.dlms.c 9.0.2505.3001
  • Tue, 05/27/2025 - 08:10
    Gurux.Serial.Android 2.0.12
  • Mon, 05/26/2025 - 08:39
    gurux.dlms.c 9.0.2505.2601
  • Tue, 05/20/2025 - 08:40
    gurux.dlms.c 9.0.2505.2001

New forum topics

  • Create gateway protocol in c
  • Error while reading event log object
  • GXDLMS Simulator – AssociationLogicalName Not Listed
  • Failed to read meter through raspberry pi 5 and probe
  • Protocol Version in AARQ Packet
More
RSS feed
Privacy FAQ GXDN Issues Contact
Follow Gurux on Twitter Follow Gurux on Linkedin