srikanth@phytec:~/work/smart-energy-meter/smart-meter-integration/custom-dlms-meter-reader/dlms-python/yitran-dlms-python/Gurux.DLMS.Python/Gurux.DLMS.Client.Example.python$ python3 mqtt_obis.py
Starting MQTT client...
Connected to MQTT broker with result code 0
Subscribed to topics: meter/parameters, meter-id, obis-code
Received message from topic meter-id: EP1240009
Received meter-id: EP1240009
Meter ID set to: EP1240009
Received message from topic meter/parameters: -h 127.0.0.1 -p 5005 -i WRAPPER -c 48 -a High -P MVVNLeel12345678 -C AuthenticationEncryption -T 45454F3334393531 -A 4D76566E4C3036694E743330536D506A -B 4D76566E4C3036694E743330536D506A -d India -w 1 -f 128 -v 0.0.43.1.3.255 -t Verbose
Meter settings from MQTT: ['read_obis_tcp.py', '-h', '127.0.0.1', '-p', '5005', '-i', 'WRAPPER', '-c', '48', '-a', 'High', '-P', 'MVVNLeel12345678', '-C', 'AuthenticationEncryption', '-T', '45454F3334393531', '-A', '4D76566E4C3036694E743330536D506A', '-B', '4D76566E4C3036694E743330536D506A', '-d', 'India', '-w', '1', '-f', '128', '-v', '0.0.43.1.3.255', '-t', 'Verbose']
Received message from topic obis-code: 1.0.94.91.0.255
OBIS code from MQTT: 1.0.94.91.0.255
Received OBIS code without request: 1.0.94.91.0.255
Connected to MQTT broker with result code 0
TCP server listening on 127.0.0.1:5005
Subscribed to topic: EP1240009
gurux_dlms version: 1.0.143
gurux_net version: 1.0.21
gurux_serial version: 1.0.21
Authentication: Authentication.HIGH
ClientAddress: 0x30
ServerAddress: 0x1
Standard: Standard.INDIA
Connection established with client at ('127.0.0.1', 40448)
Security: Security.AUTHENTICATION_ENCRYPTION
Handling client at ('127.0.0.1', 40448)
System title: 45 45 4F 33 34 39 35 31
Authentication key: 4D 76 56 6E 4C 30 36 69 4E 74 33 30 53 6D 50 6A
Block cipher key: 4D 76 56 6E 4C 30 36 69 4E 74 33 30 53 6D 50 6A
TX: 17:10:25 00 01 00 10 00 01 00 1F 60 1D A1 09 06 07 60 85 74 05 08 01 01 BE 10 04 0E 01 00 00 00 06 5F 1F 04 00 40 1E 5D FF FF
Received data from Gurux at ('127.0.0.1', 40448): 000100100001001f601da109060760857405080101be10040e01000000065f1f0400401e5dffff
Published data to MQTT topic gurux/to_mqtt/test: 45503132343030303920000100100001001f601da109060760857405080101be10040e01000000065f1f0400401e5dffff
Received message from MQTT topic EP1240009: 000100010010002b6129a109060760857405080101a203020100a305a103020100be10040e0800065f1f040000001003400007
Payload length: 51 bytes
Sent data to Gurux over TCP: b'\x00\x01\x00\x01\x00\x10\x00+a)\xa1\t\x06\x07`\x85t\x05\x08\x01\x01\xa2\x03\x02\x01\x00\xa3\x05\xa1\x03\x02\x01\x00\xbe\x10\x04\x0e\x08\x00\x06_\x1f\x04\x00\x00\x00\x10\x03@\x00\x07' to ('127.0.0.1', 40448)
RX: 17:10:26 00 01 00 01 00 10 00 2B 61 29 A1 09 06 07 60 85 74 05 08 01 01 A2 03 02 01 00 A3 05 A1 03 02 01 00 BE 10 04 0E 08 00 06 5F 1F 04 00 00 00 10 03 40 00 07
TX: 17:10:26 00 01 00 10 00 01 00 0D C0 01 C1 00 01 00 00 2B 01 03 FF 02 00
Received data from Gurux at ('127.0.0.1', 40448): 000100100001000dc001c1000100002b0103ff0200
Published data to MQTT topic gurux/to_mqtt/test: 45503132343030303920000100100001000dc001c1000100002b0103ff0200
Received message from MQTT topic EP1240009: 0001000100100009c401c10006000000a7
Payload length: 17 bytes
Sent data to Gurux over TCP: b'\x00\x01\x00\x01\x00\x10\x00\t\xc4\x01\xc1\x00\x06\x00\x00\x00\xa7' to ('127.0.0.1', 40448)
RX: 17:10:27 00 01 00 01 00 10 00 09 C4 01 C1 00 06 00 00 00 A7
Invocation counter: 168
DisconnectRequest
TX: 17:10:27 00 01 00 10 00 01 00 09 62 03 80 01 00 03 80 01 00
Received data from Gurux at ('127.0.0.1', 40448): 0001001000010009620380010003800100
Published data to MQTT topic gurux/to_mqtt/test: 455031323430303039200001001000010009620380010003800100
Received message from MQTT topic EP1240009: 00010001001000176315800100be10040e0800065f1f040000001003400007
Payload length: 31 bytes
RX: 17:10:28 00 01 00 01 00 10 00 17 63 15 80 01 00 BE 10 04 0E 08 00 06 5F 1F 04 00 00 00 10 03 40 00 07
Sent data to Gurux over TCP: b'\x00\x01\x00\x01\x00\x10\x00\x17c\x15\x80\x01\x00\xbe\x10\x04\x0e\x08\x00\x06_\x1f\x04\x00\x00\x00\x10\x03@\x00\x07' to ('127.0.0.1', 40448)
TX: 17:10:28 00 01 00 30 00 01 00 5F 60 5D A1 09 06 07 60 85 74 05 08 01 03 A6 0A 04 08 45 45 4F 33 34 39 35 31 8A 02 07 80 8B 07 60 85 74 05 08 02 02 AC 12 80 10 19 65 8D D8 6E C6 E9 71 39 81 0F 8F E3 2B DF 53 BE 23 04 21 21 1F 30 00 00 00 A8 3A 36 A5 90 B8 54 1C B8 41 C8 EB 53 A3 AC B9 9E A7 BD D2 02 26 30 DC E2 89 94
Received data from Gurux at ('127.0.0.1', 40448): 000100300001005f605da109060760857405080103a60a040845454f33343935318a0207808b0760857405080202ac12801019658dd86ec6e97139810f8fe32bdf53be230421211f30000000a83a36a590b8541cb841c8eb53a3acb99ea7bdd2022630dce28994
Published data to MQTT topic gurux/to_mqtt/test: 45503132343030303920000100300001005f605da109060760857405080103a60a040845454f33343935318a0207808b0760857405080202ac12801019658dd86ec6e97139810f8fe32bdf53be230421211f30000000a83a36a590b8541cb841c8eb53a3acb99ea7bdd2022630dce28994
Received message from MQTT topic EP1240009: 000100010030006b6169a109060760857405080103a203020100a305a10302010ea40a040845454f000012ebc988020780890760857405080202aa12801041454e455341535f503677524a323146be230421281f30000000b0fa200f4bd4c0b76e5d9e10409239efcd9a44c966e6da368465b9
Payload length: 115 bytes
Sent data to Gurux over TCP: b'\x00\x01\x00\x01\x000\x00kai\xa1\t\x06\x07`\x85t\x05\x08\x01\x03\xa2\x03\x02\x01\x00\xa3\x05\xa1\x03\x02\x01\x0e\xa4\n\x04\x08EEO\x00\x00\x12\xeb\xc9\x88\x02\x07\x80\x89\x07`\x85t\x05\x08\x02\x02\xaa\x12\x80\x10AENESAS_P6wRJ21F\xbe#\x04!(\x1f0\x00\x00\x00\xb0\xfa \x0fK\xd4\xc0\xb7n]\x9e\x10@\x929\xef\xcd\x9aD\xc9f\xe6\xda6\x84e\xb9' to ('127.0.0.1', 40448)
RX: 17:10:30 00 01 00 01 00 30 00 6B 61 69 A1 09 06 07 60 85 74 05 08 01 03 A2 03 02 01 00 A3 05 A1 03 02 01 0E A4 0A 04 08 45 45 4F 00 00 12 EB C9 88 02 07 80 89 07 60 85 74 05 08 02 02 AA 12 80 10 41 45 4E 45 53 41 53 5F 50 36 77 52 4A 32 31 46 BE 23 04 21 28 1F 30 00 00 00 B0 FA 20 0F 4B D4 C0 B7 6E 5D 9E 10 40 92 39 EF CD 9A 44 C9 66 E6 DA 36 84 65 B9
TX: 17:10:30 00 01 00 30 00 01 00 32 CB 30 30 00 00 00 A8 F8 37 64 90 B1 0B 03 94 41 88 0A 0F 5D 5A 8B B4 EF C9 E9 6E 85 B5 EE 8A 06 10 C9 99 BF A3 2E 27 F2 8F EA 83 FB 44 4C 1E B5 ED 36
Received data from Gurux at ('127.0.0.1', 40448): 0001003000010032cb3030000000a8f8376490b10b039441880a0f5d5a8bb4efc9e96e85b5ee8a0610c999bfa32e27f28fea83fb444c1eb5ed36
Published data to MQTT topic gurux/to_mqtt/test: 455031323430303039200001003000010032cb3030000000a8f8376490b10b039441880a0f5d5a8bb4efc9e96e85b5ee8a0610c999bfa32e27f28fea83fb444c1eb5ed36
Received message from MQTT topic EP1240009: 0001000100300007d80106000000a9
Payload length: 15 bytes
Sent data to Gurux over TCP: b'\x00\x01\x00\x01\x000\x00\x07\xd8\x01\x06\x00\x00\x00\xa9' to ('127.0.0.1', 40448)
RX: 17:10:31 00 01 00 01 00 30 00 07 D8 01 06 00 00 00 A9
Error during DLMS initialization: Service not allowed. Invocation counter is invalid.
I am facing invocation couter issue. Can you help me regarding this
Hello , Any update ? Regards…
Hello ,
Any update ?
Regards,
Srikanth
Hi, The Invocation Counter…
Hi,
The Invocation Counter is not increased after the AARQ is sent.
Your DLMS version is 1.0.143. Try to update to the latest one (1.0.181).
I hope it will solve this.
BR,
Mikko
Hello Mikko, Thank you now…
Hello Mikko,
Thank you now it's working .
I am using below piece of code to translate meter push data.that is
from gurux_dlms import GXDLMSTranslator
from gurux_dlms import GXByteBuffer
message = "00 01 00 01 00 40 00 79 DB 08 53 45 45 30 30 30 36 38 6E 20 00 00 00 0A 78 F1 38 68 BE C3 B4 4E 69 3E F3 40 61 DC D5 78 AF A9 C7 F8 D9 55 E2 9B 3E 41 0A 65 1C 71 6A 0A A5 15 8C B5 8D 20 EA 3C 64 89 9D 66 D7 60 22 FE 4C 18 94 E4 C2 AC 26 7A 1C 5F 44 D9 A5 AA BF FC 4C D2 68 59 9D E8 01 11 1E 25 D7 08 A8 1F 3B C5 F3 15 44 EB D2 50 3B C1 DC 03 72 00 38 AD B3 9D 02 70 2C F5 3A AA CF 74 C8"
data = message
t = GXDLMSTranslator()
t.comments = True
t.systemTitle = "qwertyui".encode()
t.blockCipherKey = bytearray((0x62, 0x62, 0x62, 0x62, 0x62, 0x62, 0x62, 0x62, 0x62, 0x62, 0x62, 0x62, 0x62, 0x62, 0x62, 0x62))
t.authenticationKey = bytearray((0x62, 0x62, 0x62, 0x62, 0x62, 0x62, 0x62, 0x62, 0x62, 0x62, 0x62, 0x62, 0x62, 0x62, 0x62, 0x62))
#t.serverSystemTitle = GXByteBuffer.hexToBytes("7177657274797569")
print(t.messageToXml(data))
print("\n")
print("****************************************************************************************************************************************************************************")
it's working fine . Can you give the same logic to translate the meter push data using C application.
Regards,
Srikanth
Hi, You can find push…
Hi,
You can find push example for ANSI C from here:
https://github.com/Gurux/GuruxDLMS.c/tree/master/GuruxDLMSPushExample
BR,
Mikko
Hi Mikko, What i am asking…
Hi Mikko,
What i am asking is DLMS packet translation using C application. Using python i am able to translating. I need a piece of "C code" which translate the dlms packet.
Regards,
Srikanth
Hi, XML translator is not…
Hi,
XML translator is not implemented in ANSI C because it's used with meters. You can use ANSI C++ if you want to.
BR,
Mikko
Hello Mikko, Thank you for…
Hello Mikko,
Thank you for quick response. So Can you provide ANSI C++ piece of code to translate DLMS packet.
Regards,
Srikanth
Hi, Check the push client…
Hi,
Check the push client example from here:
https://github.com/Gurux/Gurux.DLMS.cpp/blob/1d48796032ed936a61debc615a…
BR,
Mikko
Hello Mikko, I hope you're…
Hello Mikko,
I hope you're doing well.
Using the Python SDK, I am currently able to communicate with multiple meters sequentially—reading from one meter at a time. However, I would like to know if it is possible to read from multiple meters concurrently. If so, could you please guide me on what changes or approaches are needed to achieve this?
I would greatly appreciate it if I could receive your response at your earliest convenience, as this is quite important for our implementation.
Thank you in advance for your support.
Regards,
Srikanth
Hi, Yes, it's possible. You…
Hi,
Yes, it's possible. You need to create a thread and a GXDLMSClient for each meter.
That is needed even if all the meters are the same manufacturer because there are counters that are increased every transaction (read/write/action).
BR,
Mikko