Hi,
I am using gurux_dlms for python and I would like to know how to configure the translator properly
Here is my code
from gurux_dlms import *
from gurux_dlms.enums import TranslatorOutputType
from gurux_dlms.enums import Security
encrypted_data = "7EA03800021611F1544CC6E6E600DB0857534530303030311E30000000A96437FABDDBB43C3FE046C960BC9061849413AA1B68D45876B981E27E"
t = GXDLMSTranslator(TranslatorOutputType.SIMPLE_XML)
t.comments = True
t.security = Security.AUTHENTICATION_ENCRYPTION
t.systemTitle = bytes.fromhex("5753453030303031")
t.authenticationKey = bytes.fromhex("D0D1D2D3D4D5D6D7D8D9DADBDCDDDEDF")
t.blockCipherKey = bytes.fromhex("000102030405060708090A0B0C0D0E0F")
xml = t.messageToXml(encrypted_data)
print(xml)
and here is what I got
<HDLC len="37" >
<!--Logical address:1, Physical address:1416-->
<TargetAddress Value="4588" />
<SourceAddress Value="78" />
<!--I frame.-->
<FrameType Value="54" />
<PDU>
<GeneralGloCiphering>
<SystemTitle Value="5753453030303031" />
<CipheredService Value="30000000A96437FABDDBB43C3FE046C960BC9061849413AA1B68D45876B9" />
</GeneralGloCiphering>
</PDU>
</HDLC>
but the translator in GXDLMSDirector is capable to translate
Here is what I got
BlockCipher key: 00 01 02 03 04 05 06 07 08 09 0A 0B 0C 0D 0E 0F
Authentication Key:D0 D1 D2 D3 D4 D5 D6 D7 D8 D9 DA DB DC DD DE DF
1: 7E A0 38 00 02 16 11 F1 54 4C C6 E6 E6 00 DB 08 57 53 45 30 30 30 30 31 1E 30 00 00 00 A9 64 37 FA BD DB B4 3C 3F E0 46 C9 60 BC 90 61 84 94 13 AA 1B 68 D4 58 76 B9 81 E2 7E
<HDLC len="37" >
<!-- Logical address:1, Physical address:1416 -->
<TargetAddress Value="4588" />
<SourceAddress Value="78" />
<FrameType Value="54" />
<PDU>
<!-- DLMS system title:
Manufacturer Code: WSE
Serial number: 206966894641
-->
<!-- Invocation Counter: 169 -->
<!-- Decrypt data: C0 01 41 00 01 00 00 60 01 00 FF 02 00
<GetRequest>
<GetRequestNormal>
# Priority: Normal, ServiceClass: Confirmed, Invoke ID: 1
<InvokeIdAndPriority Value="65" />
<AttributeDescriptor>
# Data
<ClassId Value="1" />
# 0.0.96.1.0.255
<InstanceId Value="0000600100FF" />
# Value
<AttributeId Value="2" />
</AttributeDescriptor>
</GetRequestNormal>
</GetRequest>
-->
<GeneralGloCiphering>
<SystemTitle Value="5753453030303031" />
<CipheredService Value="30000000A96437FABDDBB43C3FE046C960BC9061849413AA1B68D45876B9" />
</GeneralGloCiphering>
</PDU>
</HDLC>
Thank you so much