Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ASDU-type Not Available #6

Closed
mstfbirinci opened this issue Jun 21, 2018 · 7 comments
Closed

ASDU-type Not Available #6

mstfbirinci opened this issue Jun 21, 2018 · 7 comments

Comments

@mstfbirinci
Copy link

What is the meaning of this 'causa tranmission' code(ASDU-type Not Available)? While I am testing to library with real devices, some devices is always working properly(causa_tm = 7). But some devices is always return causa_tm code 14(Asdu type not available).

How we react to handle this situation? I have researched documentation but I did not find anything useful.
If you know to this, I can collaborate this library.

Thank you.

@javierdelapuente
Copy link
Owner

Could you send the full log, send and received bytes, so I can check it?

@mstfbirinci
Copy link
Author

{"time":1529506876615,{"message":"iterate read thread\r","v":1}
{"time":1529506876657,"message":"got message> CONNECT 9600/RLP\r\r","v":1}
{"time":1529506876657,"message":"\r","v":1}
{"time":1529506876657,"message":"connect\r","v":1}
{"time":1529506877617,"message":"iterate read thread\r","v":1}
{"time":1529506878616,"message":"iterate read thread\r","v":1}
{"time":1529506879616,"message":"iterate read thread\r","v":1}
{"time":1529506880616,"message":"iterate read thread\r","v":1}
{"time":1529506881617,"message":"iterate read thread\r","v":1}
{"time":1529506882617,"message":"iterate read thread\r","v":1}
{"time":1529506882657,"message":"sending frame ----- FixedAsdu Begin -----\r","v":1}
{"time":1529506882657,"message":" RES: 0 PRM: 1 FCB: 0 FCV: 0 CF(cod. funcion): 9\r","v":1}
{"time":1529506882657,"message":" DER: 1\r","v":1}
{"time":1529506882657,"message":" checksum: 74 0x4a\r","v":1}
{"time":1529506882657,"message":" 10:49:01:00:4a:16\r","v":1}
{"time":1529506882657,"message":"----- FixedAsdu End -----\r","v":1}
{"time":1529506883618,"message":"iterate read thread\r","v":1}
{"time":1529506884618,"message":"iterate read thread\r","v":1}
{"time":1529506884618,"message":"receiving frame ----- FixedAsdu Begin -----\r","v":1}
{"time":1529506884618,"message":" RES: 0 PRM: 0 FCB: 0 FCV: 0 CF(cod. funcion): 11\r","v":1}
{"time":1529506884618,"message":" DER: 1\r","v":1}
{"time":1529506884618,"message":" checksum: 12 0xc\r","v":1}
{"time":1529506884618,"message":" 10:0b:01:00:0c:16\r","v":1}
{"time":1529506884619,"message":"----- FixedAsdu End -----\r","v":1}
{"time":1529506884619,"message":"sending frame ----- FixedAsdu Begin -----\r","v":1}
{"time":1529506884619,"message":" RES: 0 PRM: 1 FCB: 0 FCV: 0 CF(cod. funcion): 0\r","v":1}
{"time":1529506884619,"message":" DER: 1\r","v":1}
{"time":1529506884619,"message":" checksum: 65 0x41\r","v":1}
{"time":1529506884619,"message":" 10:40:01:00:41:16\r","v":1}
{"time":1529506884619,"message":"----- FixedAsdu End -----\r","v":1}
{"time":1529506885619,"message":"iterate read thread\r","v":1}
{"time":1529506886619,"message":"iterate read thread\r","v":1}
{"time":1529506886619,"message":"receiving frame ----- FixedAsdu Begin -----\r","v":1}
{"time":1529506886619,"message":" RES: 0 PRM: 0 FCB: 0 FCV: 0 CF(cod. funcion): 0\r","v":1}
{"time":1529506886619,"message":" DER: 1\r","v":1}
{"time":1529506886619,"message":" checksum: 1 0x1\r","v":1}
{"time":1529506886619,"message":" 10:00:01:00:01:16\r","v":1}
{"time":1529506886619,"message":"----- FixedAsdu End -----\r","v":1}
{"time":1529506886620,"message":"sending frame ----- VariableAsdu Begin -----\r","v":1}
{"time":1529506886620,"message":" length: 13\r","v":1}
{"time":1529506886620,"message":" RES: 0 PRM: 1 FCB: 1 FCV: 1 CF(cod. funcion): 3\r","v":1}
{"time":1529506886620,"message":" DER: 1\r","v":1}
{"time":1529506886620,"message":" TIPO: 183 0xb7\r","v":1}
{"time":1529506886620,"message":" cualificador estructura variable: 1\r","v":1}
{"time":1529506886620,"message":" causa transmision: 6 0x6\r","v":1}
{"time":1529506886620,"message":" direccion punto medida: 1\r","v":1}
{"time":1529506886620,"message":" direccion registro: 12\r","v":1}
{"time":1529506886620,"message":" CONTENIDO: \r","v":1}
{"time":1529506886620,"message":" -- C_AC_NA_2 Begin -- \r","v":1}
{"time":1529506886620,"message":" clave: 1\r","v":1}
{"time":1529506886620,"message":" -- C_AC_NA_2 End \r","v":1}
{"time":1529506886620,"message":" checksum: 64 0x40\r","v":1}
{"time":1529506886620,"message":" 68:0d:0d:68:73:01:00:b7:01:06:01:00:0c:01:00:00:00:40:16\r","v":1}
{"time":1529506886620,"message":"----- VariableAsdu End -----\r","v":1}
{"time":1529506887619,"message":"iterate read thread\r","v":1}
{"time":1529506888620,"message":"iterate read thread\r","v":1}
{"time":1529506888620,"message":"receiving frame ----- FixedAsdu Begin -----\r","v":1}
{"time":1529506888620,"message":" RES: 0 PRM: 0 FCB: 0 FCV: 0 CF(cod. funcion): 0\r","v":1}
{"time":1529506888620,"message":" DER: 1\r","v":1}
{"time":1529506888620,"message":" checksum: 1 0x1\r","v":1}
{"time":1529506888620,"message":" 10:00:01:00:01:16\r","v":1}
{"time":1529506888621,"message":"----- FixedAsdu End -----\r","v":1}
{"time":1529506888621,"message":"sending frame ----- FixedAsdu Begin -----\r","v":1}
{"time":1529506888621,"message":" RES: 0 PRM: 1 FCB: 0 FCV: 1 CF(cod. funcion): 11\r","v":1}
{"time":1529506888621,"message":" DER: 1\r","v":1}
{"time":1529506888621,"message":" checksum: 92 0x5c\r","v":1}
{"time":1529506888621,"message":" 10:5b:01:00:5c:16\r","v":1}
{"time":1529506888621,"message":"----- FixedAsdu End -----\r","v":1}
{"time":1529506889620,"message":"iterate read thread\r","v":1}
{"time":1529506890184,"message":"iterate read thread\r","v":1}
{"time":1529506891184,"message":"iterate read thread\r","v":1}
{"time":1529506891184,"message":"receiving frame ----- VariableAsdu Begin -----\r","v":1}
{"time":1529506891184,"message":" length: 13\r","v":1}
{"time":1529506891184,"message":" RES: 0 PRM: 0 FCB: 0 FCV: 0 CF(cod. funcion): 8\r","v":1}
{"time":1529506891184,"message":" DER: 1\r","v":1}
{"time":1529506891184,"message":" TIPO: 183 0xb7\r","v":1}
{"time":1529506891185,"message":" cualificador estructura variable: 1\r","v":1}
{"time":1529506891185,"message":" causa transmision: 14 0xe\r","v":1}
{"time":1529506891185,"message":" direccion punto medida: 1\r","v":1}
{"time":1529506891185,"message":" direccion registro: 12\r","v":1}
{"time":1529506891185,"message":" CONTENIDO: 01:00:00:00\r","v":1}
{"time":1529506891185,"message":" -- C_AC_NA_2 Begin -- \r","v":1}
{"time":1529506891185,"message":" clave: 1\r","v":1}
{"time":1529506891185,"message":" -- C_AC_NA_2 End \r","v":1}
{"time":1529506891185,"message":" checksum: 221 0xdd\r","v":1}
{"time":1529506891185,"message":" 68:0d:0d:68:08:01:00:b7:01:0e:01:00:0c:01:00:00:00:dd:16\r","v":1}
{"time":1529506891185,"message":"----- VariableAsdu End -----\r","v":1}
{"time":1529506891185,"message":"sending frame ----- FixedAsdu Begin -----\r","v":1}
{"time":1529506891185,"message":" RES: 0 PRM: 1 FCB: 1 FCV: 1 CF(cod. funcion): 11\r","v":1}
{"time":1529506891185,"message":" DER: 1\r","v":1}
{"time":1529506891185,"message":" checksum: 124 0x7c\r","v":1}
{"time":1529506891185,"message":" 10:7b:01:00:7c:16\r","v":1}
{"time":1529506891185,"message":"----- FixedAsdu End -----\r","v":1}
{"time":1529506892185,"message":"iterate read thread\r","v":1}
{"time":1529506893185,"message":"iterate read thread\r","v":1}
{"time":1529506893185,"message":"receiving frame ----- FixedAsdu Begin -----\r","v":1}
{"time":1529506893185,"message":" RES: 0 PRM: 0 FCB: 0 FCV: 0 CF(cod. funcion): 9\r","v":1}
{"time":1529506893185,"message":" DER: 1\r","v":1}
{"time":1529506893185,"message":" checksum: 10 0xa\r","v":1}
{"time":1529506893186,"message":" 10:09:01:00:0a:16\r","v":1}
{"time":1529506893186,"message":"----- FixedAsdu End -----\r","v":1}
{"time":1529506894186,"message":"iterate read thread\r","v":1}
{"time":1529506895186,"message":"iterate read thread\r","v":1}
{"time":1529506896186,"message":"iterate read thread\r","v":1}
{"time":1529506897187,"message":"iterate read thread\r","v":1}
{"time":1529506898187,"message":"iterate read thread\r","v":1}
{"time":1529506899188,"message":"iterate read thread\r","v":1}
{"time":1529506900188,"message":"iterate read thread\r","v":1}
{"time":1529506901189,"message":"iterate read thread\r","v":1}
{"time":1529506902189,"message":"iterate read thread\r","v":1}
{"time":1529506903189,"message":"iterate read thread\r","v":1}
{"time":1529506904190,"message":"iterate read thread\r","v":1}
{"time":1529506905190,"message":"iterate read thread\r","v":1}
{"time":1529506906191,"message":"iterate read thread\r","v":1}
{"time":1529506907191,"message":"iterate read thread\r","v":1}
{"time":1529506908192,"message":"iterate read thread\r","v":1}
{"time":1529506909192,"message":"iterate read thread\r","v":1}
{"time":1529506910192,"message":"iterate read thread\r","v":1}
{"time":1529506911193,"message":"iterate read thread\r","v":1}
{"time":1529506912193,"message":"iterate read thread\r","v":1}
{"time":1529506913194,"message":"iterate read thread\r","v":1}
{"time":1529506914194,"message":"iterate read thread\r","v":1}
{"time":1529506915195,"message":"iterate read thread\r","v":1}
{"time":1529506916195,"message":"iterate read thread\r","v":1}

@ecarreras
Copy link
Contributor

How we react to handle this situation? I have researched documentation but I did not find anything useful.
If you know to this, I can collaborate this library.

In some cases when you are not properly authenticated the device will respond with ASDU not available. Causa transmision 13 (0x0e)

I'm implementing some basic ASDUs:

  • Getting time (C_TI_NA_2)
  • Getting serial number and manufacturer (C_RD_NA_2)

And I'm in the same problem, I'll sniff a correct sequence of frame and compare with the produced with this library to check which is the difference

@ecarreras
Copy link
Contributor

@mstfbirinci We have solved this problem. The problem was because the method create_asdu_request has hardcoded some values:

  • causa_tm: 6
  • cualificador_ev: 1

Some ASDUs needs a specific causa_tm to work properly and the cualificador_ev is the length of the objects sent in the content.

We will submit a pull-request which fixes this bug and will provide the following:

  • causa_tm could be set in ASDU level
  • cualificador_ev will be calculated when creating the asdu request getting a new property data_length

@ecarreras
Copy link
Contributor

@javierdelapuente @mstfbirinci Pull-request submited #9

@mstfbirinci
Copy link
Author

@ecarreras thank you for contributing but I think there is a misconception about causa_transmission code.

In some cases when you are not properly authenticated the device will respond with ASDU not available. Causa transmision 13 (0x0e)

"ASDU-type not available" is referred to causa transmission 14 (0x0e). "requested data record not available" is referred to causa transmission 13 (0x0d).

Which causa transmission error is solved by your solution?

@MiquelIR
Copy link

MiquelIR commented Aug 7, 2018

Hi @mstfbirinci, @ecarreras was referring to the "14" causa de transmisión. It's a typo, as you can see the HEX value is correct in his message but not the decimal.

The Pull-Request fixes the existing methods but i'm still working on it and adding new ones.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants