Hi, Forum. And good day to everyone.
I'm sorry if this issue is a duplicate. But I'm looking for a solution for "Service not allowed. Operation not possible" Error on connecting to meter using Gurux.DLMS.Python. I am relatively new to DLMS, my knowledge is not up there yet.
To start with, I successfully established a connection to the meter using GXDLMSDirector, and it performed admirably. However, I'm attempting to use my Raspi, so I attempted connection via Gurux.DLMS.Python, but encountered an error.
Upon reading the forum, I experimented with Gurux.DLMS.Net on my pc, similar to the other does, and it functioned flawlessly without any errors.
I haven't made any alterations to either the Python or .Net setup. Is there a method to ensure that the Python implementation works as effectively as the .Net?
Any help would be very appreciated. Thank you.
Here is the trace using python:
Gurux.DLMS.Client.Example.python>python main.py -S COM30:19200:8None1 -c 6 -a HighGMAC -C AuthenticationEncryption -T 4C59450371312D09 -A D0D1D2D3D4D5D6D7D8D9DADBDCDDDEDF -B 202122232425262728292A2B2C2D2E2F -v 0.0.43.1.0.255 -g "0.0.1.0.0.255:1;0.0.1.0.0.255:2" -w 1 -f 128 -t Verbose
gurux_dlms version: 1.0.146
gurux_net version: 1.0.19
gurux_serial version: 1.0.20
Authentication: 5
ClientAddress: 0x6
ServerAddress: 0x1
Standard: 0
Security: 48
System title: 4C 59 45 03 71 31 2D 09
Authentication key: D0 D1 D2 D3 D4 D5 D6 D7 D8 D9 DA DB DC DD DE DF
Block cipher key: 20 21 22 23 24 25 26 27 28 29 2A 2B 2C 2D 2E 2F
TX: 14:03:21 7E A0 07 03 21 93 0F 01 7E
RX: 14:03:21 7E A0 1E 21 03 73 C3 7A 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: 14:03:21 7E A0 2B 03 21 10 FB AF 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 40 1E 5D FF FF 91 23 7E
RX: 14:03:22 7E A0 37 21 03 30 6C 7C E6 E7 00 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 10 10 02 00 00 07 AC A8 7E
TX: 14:03:22 7E A0 19 03 21 32 6F D8 E6 E6 00 C0 01 C1 00 01 00 00 2B 01 00 FF 02 00 7D 8F 7E
RX: 14:03:22 7E A0 15 21 03 52 5D 8A E6 E7 00 C4 01 C1 00 06 00 00 01 10 24 11 7E
Invocation counter: 273
DisconnectRequest
TX: 14:03:22 7E A0 07 03 21 53 03 C7 7E
RX: 14:03:22 7E A0 1E 21 03 73 C3 7A 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: 14:03:22 7E A0 07 03 0D 93 9C 8B 7E
RX: 14:03:22 7E A0 1E 0D 03 73 5B DC 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: 14:03:22 7E A0 6B 03 0D 10 DF 33 E6 E6 00 60 5D A1 09 06 07 60 85 74 05 08 01 03 A6 0A 04 08 4C 59 45 03 71 31 2D 09 8A 02 07 80 8B 07 60 85 74 05 08 02 05 AC 12 80 10 D4 C3 F1 F2 41 8B 63 02 C2 6C 89 1A 96 34 CD D0 BE 23 04 21 21 1F 30 00 00 01 11 E8 58 68 7A FA 08 E3 72 53 BF 2D A1 80 A9 33 50 15 08 E5 B6 EE 33 31 89 45 7E 58 C6 7E
RX: 14:03:22 7E A0 6F 0D 03 30 3A EA E6 E7 00 61 61 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 4C 59 45 03 71 31 2D 09 88 02 07 80 89 07 60 85 74 05 08 02 05 AA 0A 80 08 30 39 37 39 32 37 43 33 BE 23 04 21 28 1F 30 00 00 01 41 89 91 BF 3E 5A 90 3A 71 EC EF AD 89 5D B2 0E C4 6A 87 69 EC 33 4B 53 BF 4A A6 1F 09 7E
TX: 14:03:22 7E A0 3F 03 0D 32 35 96 E6 E6 00 CB 31 30 00 00 01 11 2A 59 A9 7A F3 57 FC 5E 53 FF CC FD 83 A0 E6 A9 A5 96 FA 78 68 1F D8 44 D1 BF 4D 64 42 5D 3F EB 65 1F 84 95 00 C8 C4 01 70 79 FA FC C1 22 7E
RX: 14:03:22 7E A0 0F 0D 03 52 CA 33 E6 E7 00 D8 01 01 3C 43 7E
Service not allowed. Operation not possible
DisconnectRequest
TX: 14:03:22 7E A0 07 03 0D 53 90 4D 7E
RX: 14:03:23 7E A0 1E 0D 03 73 5B DC 81 80 12 05 01 80 06 01 80 07 04 00 00 00 01 08 04 00 00 00 01 53 3B 7E
Ended. Press any key to continue.
And here is the trace using .Net:
Debug>Gurux.DLMS.Client.Example.Net.exe -S COM30:19200:8None1 -c 6 -a HighGMAC -C AuthenticationEncryption -T 4C59450371312D09 -A D0D1D2D3D4D5D6D7D8D9DADBDCDDDEDF -B 202122232425262728292A2B2C2D2E2F -v 0.0.43.1.0.255 -g "0.0.1.0.0.255:1;0.0.1.0.0.255:2" -w 1 -f 128 -t Verbose
Standard: DLMS
Security: AuthenticationEncryption
System title: 4C 59 45 03 71 31 2D 09
Authentication key: D0 D1 D2 D3 D4 D5 D6 D7 D8 D9 DA DB DC DD DE DF
Block cipher key 20 21 22 23 24 25 26 27 28 29 2A 2B 2C 2D 2E 2F
Send SNRM request.7E A0 07 03 21 93 0F 01 7E
TX: 14:04:39 7E A0 07 03 21 93 0F 01 7E
RX: 14:04:39 7E A0 1E 21 03 73 C3 7A 81 80 12 05 01 80 06 01 80 07 04 00 00 00 01 08 04 00 00 00 01 53 3B 7E
Parsing UA reply.81 80 12 05 01 80 06 01 80 07 04 00 00 00 01 08 04 00 00 00 01
Parsing UA reply succeeded.
Send AARQ request
TX: 14:04:39 7E A0 2B 03 21 10 FB AF 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 62 1E 5D FF FF 88 55 7E
RX: 14:04:39 7E A0 37 21 03 30 6C 7C E6 E7 00 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 10 10 02 00 00 07 AC A8 7E
Parsing AARE reply61 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 10 10 02 00 00 07
TX: 14:04:39 7E A0 19 03 21 32 6F D8 E6 E6 00 C0 01 C1 00 01 00 00 2B 01 00 FF 02 00 7D 8F 7E
RX: 14:04:39 7E A0 15 21 03 52 5D 8A E6 E7 00 C4 01 C1 00 06 00 00 01 12 36 32 7E
Invocation counter: 275
Disconnecting from the meter.
TX: 14:04:39 7E A0 07 03 21 53 03 C7 7E
RX: 14:04:39 7E A0 1E 21 03 73 C3 7A 81 80 12 05 01 80 06 01 80 07 04 00 00 00 01 08 04 00 00 00 01 53 3B 7E
Send SNRM request.7E A0 07 03 0D 93 9C 8B 7E
TX: 14:04:39 7E A0 07 03 0D 93 9C 8B 7E
RX: 14:04:39 7E A0 1E 0D 03 73 5B DC 81 80 12 05 01 80 06 01 80 07 04 00 00 00 01 08 04 00 00 00 01 53 3B 7E
Parsing UA reply.81 80 12 05 01 80 06 01 80 07 04 00 00 00 01 08 04 00 00 00 01
Parsing UA reply succeeded.
Send AARQ request
TX: 14:04:39 7E A0 6B 03 0D 10 DF 33 E6 E6 00 60 5D A1 09 06 07 60 85 74 05 08 01 03 A6 0A 04 08 4C 59 45 03 71 31 2D 09 8A 02 07 80 8B 07 60 85 74 05 08 02 05 AC 12 80 10 21 49 25 34 67 1C 76 17 76 62 27 21 1C 11 54 67 BE 23 04 21 21 1F 30 00 00 01 13 23 37 EC 49 FE B1 F2 B0 78 C7 5D 30 34 30 23 7C 7D 14 5C 96 2C BB F5 13 3D 57 12 1F 7E
RX: 14:04:40 7E A0 6F 0D 03 30 3A EA E6 E7 00 61 61 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 4C 59 45 03 71 31 2D 09 88 02 07 80 89 07 60 85 74 05 08 02 05 AA 0A 80 08 32 32 42 42 45 39 39 42 BE 23 04 21 28 1F 30 00 00 01 42 2D 41 4A 4C 31 EA CD 25 5D 2E F0 5B B1 11 97 D3 18 14 06 0F 59 B5 5E 5A 4B BD 22 F5 7E
Parsing AARE reply61 61 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 4C 59 45 03 71 31 2D 09 88 02 07 80 89 07 60 85 74 05 08 02 05 AA 0A 80 08 32 32 42 42 45 39 39 42 BE 23 04 21 28 1F 30 00 00 01 42 2D 41 4A 4C 31 EA CD 25 5D 2E F0 5B B1 11 97 D3 18 14 06 0F 59 B5 5E 5A 4B BD
Conformance: GeneralProtection, BlockTransferWithGetOrRead, BlockTransferWithSetOrWrite, MultipleReferences, Get, Set, SelectiveAccess, Action
... and so on
Hi, Python is updated to…
Hi,
Python is updated to increase the invocation counter after the connection is established and it now works in the same way as C#. Some meters need this, but not all. Get the version 1.0.147.
I also checked your trace and for some reason, you have changed the security to Authentication after the connection is established. Make sure that you haven't made any changes to the source code.
Python is always a little bit slower than C#.
BR,
Mikko
Good morning, Mr. Mikko…
Good morning, Mr. Mikko.
Thank you for your help. Definitely will try the new version.
Was the security change happened on last trace before "service not allowed" generated? I find it strange too. I'm sure I didn't modify anything.
I'll be right back after trying the new version.
Thank you, Mr. Mikko!
Mr. Mikko, It works now!…
Mr. Mikko, It works now!
Thank you so much. But I will ask new question later.
Thank you again.