Hi everyone. I am trying to use python libraries to communicate with an Elster A1800 meter. I manage to apply the "readDLMSpacket" method and get the UA response. However, after applying the "parseAareResponse" method I get the "Authentication mecanism is requiered" error even though it indicates a low authentication level when starting the code with its respective password. What can this error be due to? and how can I solve it? Thank you.
I attach the photos of the errors.
Please, don't add images. Plain text is easier to read. Try to run application with -t Verbose argument.
and add send and received bytes. Have you changed the client address with -c argument?
Ok, i won't add images. Yes, i changed the client address with -c argument. The client for Low level Authentication is 17 according to the meter documentation. What do you mean with "and add send and received bytes" ? Thanks for your reply.
You can see the mentioned error here:
"D:\Archivos Diego\2021 - 1\Tesis 2\Implementación\venv\Scripts\python.exe" "D:/Archivos Diego/2021 - 1/Tesis 2/Implementación/main.py"
Authentication: Authentication.LOW
ClientAddress: 0x11
ServerAddress: 0x1
Security: Security.AUTHENTICATION
System title: 41 42 43 44 45 46 47 48
Authentication key: D0 D1 D2 D3 D4 D5 D6 D7 D8 D9 DA DB DC DD DE DF
Block cipher key: 00 01 02 03 04 05 06 07 08 09 0A 0B 0C 0D 0E 0F
Traceback (most recent call last):
File "D:/Archivos Diego/2021 - 1/Tesis 2/Implementación/main.py", line 28, in <module>
reader.initializeConnection()
File "D:\Archivos Diego\2021 - 1\Tesis 2\Implementación\GXDLMSReader.py", line 311, in initializeConnection
self.client.parseAareResponse(reply.data)
File "D:\Archivos Diego\2021 - 1\Tesis 2\Implementación\venv\lib\site-packages\gurux_dlms\GXDLMSClient.py", line 549, in parseAareResponse
self.isAuthenticationRequired = _GXAPDU.parsePDU(self.settings, self.settings.cipher, reply, None) == SourceDiagnostic.AUTHENTICATION_REQUIRED
File "D:\Archivos Diego\2021 - 1\Tesis 2\Implementación\venv\lib\site-packages\gurux_dlms\_GXAPDU.py", line 651, in parsePDU
ret = _GXAPDU.parsePDU2(settings, cipher, buff, xml)
File "D:\Archivos Diego\2021 - 1\Tesis 2\Implementación\venv\lib\site-packages\gurux_dlms\_GXAPDU.py", line 837, in parsePDU2
raise GXDLMSException(resultComponent, resultDiagnosticValue)
gurux_dlms.GXDLMSException.GXDLMSException: Connection is permanently rejected
Authentication mechanism name is required.
I don't do anything with the python trace. I need the bytes that the client app has sent to the meter.
Run application with -t Verbose argument and you can see the trace from the sent and received bytes.
I believe that your password or client address is wrong.
Connect with GXDLMSDirector and you can see correct command line parameters when you select the meter. Try with this:
python main.py -S COM11 -c 17 -A Low -P 12345678 -t Verbose
I set the password as 1234567820202020202020202020202020202020 in the password field without selecting the ASCII box and with the Hex box selected.
About the command line, how can i put that -P on tne command line of python?? Thanks
The image
The image
Hi,
Hi,
Please, don't add images. Plain text is easier to read. Try to run application with -t Verbose argument.
and add send and received bytes. Have you changed the client address with -c argument?
BR,
Mikko
Ok, i won't add images. Yes,
Ok, i won't add images. Yes, i changed the client address with -c argument. The client for Low level Authentication is 17 according to the meter documentation. What do you mean with "and add send and received bytes" ? Thanks for your reply.
You can see the mentioned error here:
"D:\Archivos Diego\2021 - 1\Tesis 2\Implementación\venv\Scripts\python.exe" "D:/Archivos Diego/2021 - 1/Tesis 2/Implementación/main.py"
Authentication: Authentication.LOW
ClientAddress: 0x11
ServerAddress: 0x1
Security: Security.AUTHENTICATION
System title: 41 42 43 44 45 46 47 48
Authentication key: D0 D1 D2 D3 D4 D5 D6 D7 D8 D9 DA DB DC DD DE DF
Block cipher key: 00 01 02 03 04 05 06 07 08 09 0A 0B 0C 0D 0E 0F
Traceback (most recent call last):
File "D:/Archivos Diego/2021 - 1/Tesis 2/Implementación/main.py", line 28, in <module>
reader.initializeConnection()
File "D:\Archivos Diego\2021 - 1\Tesis 2\Implementación\GXDLMSReader.py", line 311, in initializeConnection
self.client.parseAareResponse(reply.data)
File "D:\Archivos Diego\2021 - 1\Tesis 2\Implementación\venv\lib\site-packages\gurux_dlms\GXDLMSClient.py", line 549, in parseAareResponse
self.isAuthenticationRequired = _GXAPDU.parsePDU(self.settings, self.settings.cipher, reply, None) == SourceDiagnostic.AUTHENTICATION_REQUIRED
File "D:\Archivos Diego\2021 - 1\Tesis 2\Implementación\venv\lib\site-packages\gurux_dlms\_GXAPDU.py", line 651, in parsePDU
ret = _GXAPDU.parsePDU2(settings, cipher, buff, xml)
File "D:\Archivos Diego\2021 - 1\Tesis 2\Implementación\venv\lib\site-packages\gurux_dlms\_GXAPDU.py", line 837, in parsePDU2
raise GXDLMSException(resultComponent, resultDiagnosticValue)
gurux_dlms.GXDLMSException.GXDLMSException: Connection is permanently rejected
Authentication mechanism name is required.
I've just run the application
I've just run the application with -t Verbose command. These are the bytes sended and recived.
Authentication: Authentication.LOW
ClientAddress: 0x11
ServerAddress: 0x1
Security: Security.AUTHENTICATION
System title: 41 42 43 44 45 46 47 48
Authentication key: D0 D1 D2 D3 D4 D5 D6 D7 D8 D9 DA DB DC DD DE DF
Block cipher key: 00 01 02 03 04 05 06 07 08 09 0A 0B 0C 0D 0E 0F
TX: 02:15:45 7E A0 07 03 23 93 BF 32 7E
RX: 02:15:46 7E A0 1E 23 03 73 7B CF 81 80 12 05 01 80 06 01 80 07 04 00 00 00 01 08 04 00 00 00 01 53 3B 7E
TX: 02:15:46 7E A0 83 03 23 10 AE DB E6 E6 00 60 75 A1 09 06 07 60 85 74 05 08 01 03 A6 0A 04 08 41 42 43 44 45 46 47 48 8A 02 07 80 8B 07 60 85 74 05 08 02 01 AC 2A 80 28 31 32 33 34 35 36 37 38 32 30 32 30 32 30 32 30 32 30 32 30 32 30 32 30 32 30 32 30 32 30 32 30 32 30 32 30 32 30 32 30 BE 23 04 21 21 1F 10 00 00 00 00 01 00 00 00 06 5F 1F 04 00 00 1E 5D FF FF 78 BE FD 47 37 15 54 10 D2 E7 3B 01 A1 3B 7E
RX: 02:15:46 7E A0 37 23 03 30 D4 C9 E6 E7 00 61 29 A1 09 06 07 60 85 74 05 08 01 01 A2 03 02 01 01 A3 05 A1 03 02 01 0C BE 10 04 0E 08 00 06 5F 1F 04 00 00 10 1D 02 00 00 07 82 FE 7E
Hi,
Hi,
I don't do anything with the python trace. I need the bytes that the client app has sent to the meter.
Run application with -t Verbose argument and you can see the trace from the sent and received bytes.
I believe that your password or client address is wrong.
BR,
Mikko
Hi,
Hi,
You modify the source code. Reject your changes. Now you try to connect with ciphering.
BR,
Mikko
Hi,
Hi,
How can i set ciphering in the command line?
Thanks
Hi,
Hi,
You need to set security to None.
BR,
Mikko
I just ran this command line
I just ran this command line
python main.py -S COM11 -c 17 -C None -A "1234567820202020202020202020202020202020" -t Verbose
This is the result
gurux_dlms version: 1.0.104
gurux_net version: 1.0.17
gurux_serial version: 1.0.15
Authentication: Authentication.NONE
ClientAddress: 0x11
ServerAddress: 0x1
TX: 03:11:33 7E A0 07 03 23 93 BF 32 7E
RX: 03:11:34 7E A0 1E 23 03 73 7B CF 81 80 12 05 01 80 06 01 80 07 04 00 00 00 01 08 04 00 00 00 01 53 3B 7E
TX: 03:11:34 7E A0 2B 03 23 10 4B 9C E6 E6 00 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 00 1E 5D FF FF B3 E2 7E
RX: 03:11:34 7E A0 37 23 03 30 D4 C9 E6 E7 00 61 29 A1 09 06 07 60 85 74 05 08 01 01 A2 03 02 01 01 A3 05 A1 03 02 01 0C BE 10 04 0E 08 00 06 5F 1F 04 00 00 10
1D 02 00 00 07 82 FE 7E
DisconnectRequest
TX: 03:11:34 7E A0 07 03 23 53 B3 F4 7E
RX: 03:11:34 7E A0 1E 23 03 73 7B CF 81 80 12 05 01 80 06 01 80 07 04 00 00 00 01 08 04 00 00 00 01 53 3B 7E
Hi,
Hi,
Connect with GXDLMSDirector and you can see correct command line parameters when you select the meter. Try with this:
python main.py -S COM11 -c 17 -A Low -P 12345678 -t Verbose
BR,
Mikko
Hi,
Hi,
I got this error when i try to run that command line
gurux_dlms version: 1.0.104
gurux_net version: 1.0.17
gurux_serial version: 1.0.15
Traceback (most recent call last):
File "main.py", line 44, in main
ret = settings.getParameters(args)
File "D:\Archivos Diego\2021 - 1\Tesis 2\Implementacion_2\GXSettings.py", line 244, in getParameters
self.client.ciphering.authenticationKey = GXByteBuffer.hexToBytes(it.value)
File "D:\Archivos Diego\2021 - 1\Tesis 2\Implementacion_2\venv\lib\site-packages\gurux_dlms\GXByteBuffer.py", line 582, in hexToBytes
lastValue = cls.___getValue(ch)
File "D:\Archivos Diego\2021 - 1\Tesis 2\Implementacion_2\venv\lib\site-packages\gurux_dlms\GXByteBuffer.py", line 567, in ___getValue
raise Exception("Invalid hex string")
Exception: Invalid hex string
Ended. Press any key to continue.
Thanks for your help
I managed to connect with the
I managed to connect with the meter with GXDLMSDirector, this is the comand line wich the program gave to me:
-S COM11:9600:8NoneOne -c 17 -s 144 -a Low -P 0x4Vx -t Verbose
I set the password as 1234567820202020202020202020202020202020 in the password field without selecting the ASCII box and with the Hex box selected.
About the command line, how can i put that -P on tne command line of python?? Thanks
Hi,
Hi,
Try with this:
-S COM11:9600:8NoneOne -c 17 -s 144 -a Low -P 0x1234567820202020202020202020202020202020 -t Verbose
BR,
Mikko
Thanks for the help !! I
Thanks for the help !! I managed to connect with the meter with the last command line !! Thanks !!