0
Under review

Telnet autorization

Ekaterina (head of support) 11 years ago in iRidium Script / AV and Driver scripts updated by Aleksandr Romanov (CTO) 4 years ago 16

The user authorization at connection to Telnet looks as follows:

Connecting to 192.168.10.10 ...
Connected to 192.168.10.10
Login Please
Username: user
Password: password
Welcome to TELNET.

In the dialog window for connection login and password are sent in the open format. The login should be sent after receiving the "Username:" string, the password – after receiving the "Password:" string.

To perform the Telnet authorization in iRidium you should use the AV & Custom Systems (TCP) driver for which we create the following script:


IR.AddListener(IR.EVENT_RECEIVE_TEXT, IR.GetDevice('AV_Driver'), function(text)
{
  IR.Log("text = "+text);
 
  if (text.indexOf('Username') != -1)
  {
    IR.Log("login")
    IR.GetDevice('AV_Driver').Send(['Login',13,10]);
  } else if (text.indexOf('Password') != -1)
  {
    IR.Log("password")
    IR.GetDevice('AV_Driver').Send(['Password',13,10]);
  }
})

where

  • 'AV_Driver' – the name of the AV & Custom Systems (TCP) driver in the project device tree.
  • Send(['Login',13,10]) - Login – the user name
  • Send(['Password',13,10]) - Password – the password for  the indicated user.   


The script performs authorization after which (Welcome to TELNET.) you can send commands to equipment and receive feedback from it via Telnet.


PS: Your equipment might have a slightly different authorization dialog window. In this case modify the script so it could identify the strings after which you need to enter the login and password correctly. It will be enough for the correct work of the script.


Telnet_authorization.irpz
If its needed to sent command, how to trigger the function from a button?
You can Call the function by the button click using "ScriptCall(functionName)" command in macros editor.



The text returns blank.
The device is IBoot from www.dataprobe.com
Port is set 23
The Telnet result is this:

Microsoft Telnet>open 192.68.1.200
iBoot-G2+ v1.21.80
User>admin
Password>admin
iBoot>set main off

Ok
iBoot>set main on

Ok
iBoot>


I think I missed out on some formatting or use of the function above
Please send the Telnet log as a snapshot.

This script is only for authorization. Your device asking for "User" and "Password", it will look like:

IR.AddListener(IR.EVENT_RECEIVE_TEXT, IR.GetDevice('AV_Driver'), function(text)
{
IR.Log("text = "+text);

if (text.indexOf('User') != -1)
{
IR.Log("User >")
IR.GetDevice('AV_Driver').Send(['admin',13,10]);
} else if (text.indexOf('Password') != -1)
{
IR.Log("Password >")
IR.GetDevice('AV_Driver').Send(['admin',13,10]);
}
})

Then you have to send commands from a simple buttons as it shown in instruction:
http://wiki2.iridiummobile.net/AV_%26_Custom_Systems_%28TCP%29

ScreenHunter_02 Jun. 04 18.17.jpg

ScreenHunter_01 Jun. 04 18.00.jpg

Not send... Telnet works!!! Also the log file shows nothing ??

Scripts as follow from forst set
ScreenHunter_03 Jun. 04 18.18.jpg
This is how it looks in iRidium when Telnet asking for authorization (the same script as u use):


But in your log there is no data.
What license u use in Editor > Tools > Options > License Path: [..]?
Check the log of Client upper the "loader" part - is there any errors or exceptions?
Authorization wasn't finished because u didn't get data. You have to find a reason why.
Hi, thanks for showing me what I should see.
Thats the strange thing. I dont see authorization. I am using a Trial version.
My licence is already deployed onto Client's IPAD . I bought an additional Site Pro plus Global Cache and then realise I cant activate it because it need Global Cache so I have no full licence now.
So will I need a AV Systems licence to Telnet??
It's enough if you have a Trial license. Trial supports all the needed functions.
If you cannot see the data it could mean the session wasn't opened. Did you add a Trial to Editor > Tools > Options > License Path: [..]? Don't u activated a Demo mode in Editor (it should be turned off). Don't u see the red messages when u start the emulator?
Please let me check your license file.
Everything should be ok.
If it possible, please make a remote access to your device from internet (forward the TCP port 23 and send your External IP). We'll check the connection.
Ok. Thanks. I started checking if I need to have some services and realise I have Telnet client already but not Telnet Server, but installing that did not help the return.
I also install Iridium on another PC with new install thinking maybe there was some issues with this laptop, but that PC has the same outcome. This other laptop have both Telnet Client and Server.

Am I missing some Windows feature to allow the Telnet to come back? I have try Telnet into both laptop from each other and they work!
I will setup this laptop today and drop you an email. I can also start Teamviewer so you can log in to see what about the system.
I have been able to telnet into all the Laptop but not into the IBoot device. so maybe the issue is the IBoot security.

I am not able to put a small terminal app to control the IBoot device. Although a Windows Iridium can exec this file, what is the syntax for executing bat file from an Android/IOS to a PC on same network and known IP?
Hi Simon

You have to install remiote controll app to your PC to boot the file on PC from remote device. Something like MCE Controller http://mcec.codeplex.com/
You can connect to this app via TCP and send a command to load file (pls see MCE docs)

I too am having a similar issue. I have used the examples above however my telnet server will respond with 'box' and #. I am running telnetd on Ubuntu and I'm trying to use telnet to remotely control parameters on the computer from my iRidium control panel. 

When using a terminal program, this is what I get:

Ubuntu 20.04 LTS
NUC-test login: iainbrew
Password:
Welcome to Ubuntu 20.04 LTS (GNU/Linux 5.4.0-42-generic x86_64)

* Documentation: https://help.ubuntu.com
* Management: https://landscape.canonical.com
* Support: https://ubuntu.com/advantage


191 updates can be installed immediately.
0 of these updates are security updates.
To see these additional updates run: apt list --upgradable

Your Hardware Enablement Stack (HWE) is supported until April 2025.
Last login: Mon Aug 31 12:27:35 AEST 2020 from 192-168-1-111.tpgi.com.au on pts/1
iainbrew@NUC-test:~$

I modified the code above to be:


IR.AddListener(IR.EVENT_RECEIVE_TEXT, IR.GetDevice('AV_Driver'), function(text) { IR.Log("text = "+text); if (text.indexOf('NUC-test login:') != -1) { IR.Log("NUC-test login:") IR.GetDevice('AV_Driver').Send(['iainbrew',13,10]); } else if (text.indexOf('Password:') != -1) { IR.Log("Password:") IR.GetDevice('AV_Driver').Send(['super_secret_password',13,10]); } })

However all I get back in log is 'box' and #

I once solved this with another device which only required password, by sending the password in every command i.e.

'password',0x0D,'command_string',0x0D
 


But this doesn't work for Ubuntu login (with username and password)

I think you have now confused SSH and TELNET - these are different protocols

Hi Aleksandr - I confirm I installed telnetd and tcpd on the Ubuntu machine and have been using Telnet to connect to it deliberately (as I believe SSH isn't supported by iRidium yet). I also tried sending a packet to the Ubuntu computer on port 23 via TCP and it sends back the telnet handshake request. I believe this is where I am stuck - the handshake request (escape #) is coming back to iRidium but not showing login etc as the handshake is not completed. 

Some other thoughts to try (and happy to take your advice) would be to:

1) Have iRidium call a script (the interface will run in Windows) which instead can be executed on the windows machine in the background to trigger the 6x Ubuntu computers to shutdown


2) Install iRidium Server on the 6x Ubuntu machines and have them locally execute commands. I have tried this, but have not been having luck installing iRIdium on Ubuntu 64 bit. 

The command I am trying to issue is "sudo shutdown -P now" followed by admin password. My ultimate goal would be to use iRidium server to send through commands to Zoom to have them joined a specified call (i.e. instead of http:// I would use zoom:// to trigger the app to load and connect to the correct meeting ID and meeting password).

This is all part of a system I am building to have a master zoom computer (Windows, Host) whereby 6x slave devices (Ubuntu on NUC) can connect as participants to the main call with various video inputs for remotely directed education. 

1. You can use IR.Execute (https://dev.iridi.com/Systems_API/en#IR.Execute) for call to script.


2. This is bad idea, because it will be 6 different licenses (1 license = 1 server).


For shutdown command you should make a bash script with permissions.