ssh - diagnostic command lines

109 views
Skip to first unread message

Pacôme LECOINTE

unread,
Jun 7, 2021, 9:28:38 AM6/7/21
to openthread-users
Hello everyone, 

I created a simple network based on 1 Border router 1.2 as Leader (with a Raspberry Pi 4 and an Ot-RCP on a thunderboard sense2) and 1 ot-cli-ftd 1.2  as router. 
My aim would be to get informations of a network (thanks to the networkdiagnostic commands throught the leader device) from my computer with a python script which start a SSH session with the raspberry pi. 
 However, depending on  whether  i'm inside or outside of the Thread stack, diagnostics responses aren't the same. 

(picture 1)out_stack.PNG
(picture  2) 
in_stack.PNG
So : 
1 - Is there a way to get the full  diagnostic response (picture 2) but without  "entering" in the stack  ? 
2- If no , is there a way to enter in the Thread stack from SSh  command line  ? 
(I tried with paramiko to send command as "sudo ot-ctl \r networkdiagnostic get ff03::1 5" but it doesn't work). 

3  - I tried with libcoap to send diagnostic command as 
 coap:[<dest_address>]:61631/d/dg
but it doesn't work , is the port  61631  internal to the thread instance ?

Best regards, 

Jonathan Hui

unread,
Jun 7, 2021, 4:18:39 PM6/7/21
to Pacôme LECOINTE, openthread-users
When running ot-ctl in interactive mode, the ot-ctl process will stay open, allowing it to receive multiple responses.

However, when running in ot-ctl in non-interactive mode, the ot-ctl process will close the moment it parses the Done output, because that is usually when commands are complete. Part of the challenge is that ot-ctl does not know how many responses to wait for. One enhancement we could do is have the networkdiagnostic command wait for some period of time before exiting.

On the libcoap issue, this is because OpenThread is directly handling the diagnostics CoAP message directly. Currently, the TMF port is used by a number of other functions, so it is a bit tricky to split the handling between OpenThread and other processes.

--
Jonathan Hui



--
You received this message because you are subscribed to the Google Groups "openthread-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to openthread-use...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/openthread-users/4126e726-bd8f-4b96-93cd-59790a3c10fbn%40googlegroups.com.

Pacôme LECOINTE

unread,
Jun 8, 2021, 3:03:23 AM6/8/21
to openthread-users
Oh I see, thank you for your answer. 
What  could be the possibilities  to handle this problem and be able to get the network diagnostic answers from this border router through a SSH session ? 


Pacôme

Jonathan Hui

unread,
Jun 8, 2021, 3:30:39 PM6/8/21
to Pacôme LECOINTE, openthread-users
Is it possible for you to run ot-ctl in interactive mode within an ssh session?

--
Jonathan Hui



Pacôme LECOINTE

unread,
Jun 9, 2021, 4:39:28 AM6/9/21
to openthread-users

We used  the OTCI python library to connect to the border router throught SSh session, but it seems that we aren't able to run ot-ctl in interactive mode

Jonathan Hui

unread,
Jun 9, 2021, 3:19:35 PM6/9/21
to Pacôme LECOINTE, Simon Lin, openthread-users
+Simon Lin , thoughts on how best to address this?

--
Jonathan Hui



Simon Lin

unread,
Jun 9, 2021, 10:48:15 PM6/9/21
to openthread-users
@Jonathan You are right that ot-ctl (non-interactive) quits when it gets the first `Done` output. 

I have come across the same issue in https://github.com/openthread/openthread/pull/6695

I think `networkdiagnostic` command should not output multiple `Done`, which is a bug we need to fix. 
I would suggest to add a (configurable) timeout period to networkdiagnostic command and let networkdiagnostic exit after the timeout duration.
networkdiagnostic should not output `Done` for each received response either. 

Reply all
Reply to author
Forward
0 new messages