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