# Console Connection using OpenTap

**URL:** <https://forum.opentap.io/t/console-connection-using-opentap/795>\
**Category:** General\
**Created:** [August 9, 2022, 6:34am UTC](https://forum.opentap.io/t/console-connection-using-opentap/795 "2022-08-09T06:34:27Z")\
**Posts on this page:** 13\
**Page:** 1

<div class="post-metadata">

**Author:** ![sam836](https://avatars.discourse-cdn.com/v4/letter/s/cab0a1/32.png) [@sam836](https://forum.opentap.io/u/sam836)\
**Post date:** [August 9, 2022, 6:34am UTC](https://forum.opentap.io/t/console-connection-using-opentap/795/1 "2022-08-09T06:34:27Z")

</div>

Hi,

I need to create a console connection plugin to be able to communicate with my keysight instruments . Can someone guide how to create a plugin for console connection?

---

<div class="post-metadata">

**Author:** ![rolf\_madsen](https://avatars.discourse-cdn.com/v4/letter/r/43a26b/32.png) [@rolf\_madsen](https://forum.opentap.io/u/rolf_madsen)\
**Post date:** [August 9, 2022, 7:44am UTC](https://forum.opentap.io/t/console-connection-using-opentap/795/2 "2022-08-09T07:44:43Z")

</div>

What kind of console connection are we talking about here? Can you be more specific?

If it is a Keysight instrument, you should probably use SCPI.

---

<div class="post-metadata">

**Author:** ![sam836](https://avatars.discourse-cdn.com/v4/letter/s/cab0a1/32.png) [@sam836](https://forum.opentap.io/u/sam836)\
**Post date:** [August 9, 2022, 8:24am UTC](https://forum.opentap.io/t/console-connection-using-opentap/795/3 "2022-08-09T08:24:12Z")

</div>

Hi @rolf_madsen ,

Console connection will be needed to communicate with DUT. DUT in this case is 4G/5G Radio.  
For keysight instrument we can use SCPI.

---

<div class="post-metadata">

**Author:** ![rolf\_madsen](https://avatars.discourse-cdn.com/v4/letter/r/43a26b/32.png) [@rolf\_madsen](https://forum.opentap.io/u/rolf_madsen)\
**Post date:** [August 9, 2022, 8:33am UTC](https://forum.opentap.io/t/console-connection-using-opentap/795/4 "2022-08-09T08:33:51Z")

</div>

But you said:

> “I need to create a console connection plugin to be able to communicate with my keysight instruments”

Did you actually mean “DUT” and not “keysight instruments”?

---

<div class="post-metadata">

**Author:** ![sam836](https://avatars.discourse-cdn.com/v4/letter/s/cab0a1/32.png) [@sam836](https://forum.opentap.io/u/sam836)\
**Post date:** [August 9, 2022, 10:05am UTC](https://forum.opentap.io/t/console-connection-using-opentap/795/5 "2022-08-09T10:05:20Z")

</div>

yes, i actually mean DUT.

---

<div class="post-metadata">

**Author:** ![rolf\_madsen](https://avatars.discourse-cdn.com/v4/letter/r/43a26b/32.png) [@rolf\_madsen](https://forum.opentap.io/u/rolf_madsen)\
**Post date:** [August 9, 2022, 1:09pm UTC](https://forum.opentap.io/t/console-connection-using-opentap/795/6 "2022-08-09T13:09:25Z")

</div>

OK, I have previously used `Renci.SshNet` for SSH communication with a DUT. If your DUT supports SSH you can try the same.

You can create a ‘shell’ connection and send multiple commands.

You previously noted that you had problems with cd/current directory. This can be fixed by using the same shell for multiple commands, but in practice it can be a bit tricky to actually use it this way.

Here is a project where they use it: [Tap.Plugins.UMA.SSH/Instruments/SshInstrument.cs · master · OpenTAP / Plugins / University of Malaga / UMA SSH Plugin · GitLab](https://gitlab.com/OpenTAP/Plugins/university-of-malaga/uma-ssh-plugin/-/blob/master/Tap.Plugins.UMA.SSH/Instruments/SshInstrument.cs)

---

<div class="post-metadata">

**Author:** ![sam836](https://avatars.discourse-cdn.com/v4/letter/s/cab0a1/32.png) [@sam836](https://forum.opentap.io/u/sam836)\
**Post date:** [August 9, 2022, 1:25pm UTC](https://forum.opentap.io/t/console-connection-using-opentap/795/7 "2022-08-09T13:25:44Z")

</div>

Is there any option if DUT does not support SSH? I need to use console for the first time connection to DUT.

How can I create a shell connection to send multiple commands, can you guide?

---

<div class="post-metadata">

**Author:** ![rolf\_madsen](https://avatars.discourse-cdn.com/v4/letter/r/43a26b/32.png) [@rolf\_madsen](https://forum.opentap.io/u/rolf_madsen)\
**Post date:** [August 9, 2022, 1:56pm UTC](https://forum.opentap.io/t/console-connection-using-opentap/795/8 "2022-08-09T13:56:56Z")

</div>

Sure, you can use things such as telnet or a serial connection. A ‘shell connection’ is not really a concept I know, so you need to be way more specific. Can you explain how you connect to your DUT now?

---

<div class="post-metadata">

**Author:** ![brennen\_direnzo](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.opentap.io/brennen_direnzo/32/6_2.png) [@brennen\_direnzo](https://forum.opentap.io/u/brennen_direnzo)\
**Post date:** [August 9, 2022, 2:17pm UTC](https://forum.opentap.io/t/console-connection-using-opentap/795/9 "2022-08-09T14:17:12Z")

</div>

If you are using SSH, you can leverage this plugin:

> **[OpenTAP / Plugins / Keysight Technologies / SshSteps · GitLab](https://gitlab.com/OpenTAP/Plugins/keysight/sshsteps)**
>
> Small package with some basic SSH TestSteps

[https://packages.opentap.io/index.html#/?name=SSH&version=0.3.0-beta.8%2B7b4c999b&os=Windows,Linux&architecture=AnyCPU](https://packages.opentap.io/index.html#/?name=SSH&version=0.3.0-beta.8%2B7b4c999b&os=Windows,Linux&architecture=AnyCPU)

---

<div class="post-metadata">

**Author:** ![alan\_copeland](https://avatars.discourse-cdn.com/v4/letter/a/b782af/32.png) [@alan\_copeland](https://forum.opentap.io/u/alan_copeland)\
**Post date:** [August 9, 2022, 10:40pm UTC](https://forum.opentap.io/t/console-connection-using-opentap/795/10 "2022-08-09T22:40:22Z")

</div>

Maybe you can explain / demonstrate how you do the setup today more explicitly. I think the term “console” is too generic in this instance, but if you could describe it there is probably a good solution possible

---

<div class="post-metadata">

**Author:** ![smartkuku](https://avatars.discourse-cdn.com/v4/letter/s/fbc32d/32.png) [@smartkuku](https://forum.opentap.io/u/smartkuku)\
**Post date:** [August 10, 2022, 5:54am UTC](https://forum.opentap.io/t/console-connection-using-opentap/795/11 "2022-08-10T05:54:21Z")

</div>

I guess maybe you are talking about uart communication with DUT. If this is true, just use the SerialPort class in .Net.

---

<div class="post-metadata">

**Author:** ![sam836](https://avatars.discourse-cdn.com/v4/letter/s/cab0a1/32.png) [@sam836](https://forum.opentap.io/u/sam836)\
**Post date:** [August 10, 2022, 9:04am UTC](https://forum.opentap.io/t/console-connection-using-opentap/795/12 "2022-08-10T09:04:43Z")

</div>

Hi,

The serial communication is needed before the ethernet connection is enabled in DUT board. to perform u-boot of board. Once ethernet connection gets enables ssh plugin can be used. but how can we communicate when ethernet connection is not enabled yet on DUT board

---

<div class="post-metadata">

**Author:** ![rolf\_madsen](https://avatars.discourse-cdn.com/v4/letter/r/43a26b/32.png) [@rolf\_madsen](https://forum.opentap.io/u/rolf_madsen)\
**Post date:** [August 10, 2022, 1:48pm UTC](https://forum.opentap.io/t/console-connection-using-opentap/795/13 "2022-08-10T13:48:49Z")

</div>

OK, so you connect to the DUT via USB and then that shows up as a COM port in Windows Device Manager?
