Jump to content
OMRON Forums

Programmatic Telnet session not working


PaulOfCinci

Recommended Posts

I can connect to the PowerPMAC through telnet just fine in the command prompt, but when I try to do this programmatically I get a garbage response and cannot do anything. Ports 21 and 22 use some linux protocol but I would like to use telnet (port 23), if anyone can shed some light on this please let me know.
Link to comment
Share on other sites

  • Replies 16
  • Created
  • Last Reply

Top Posters In This Topic

Details that I had left out, I am using C++ code and opening a Winsock connection. Ports 21 and 22 give the same correct response programmatically as they did through a command prompt, it is only telnet that did not respond correctly through the code. I am attempting this because the PowerPMACComLib can't be used in our C++ code, so I'd like to be able to talk directly to the PowerPMAC. After opening a connection it should be as simple as specifying a username, password, then sending "gpascii" so I can send commands.

 

 

I can connect to the PowerPMAC through telnet just fine in the command prompt, but when I try to do this programmatically I get a garbage response and cannot do anything. Ports 21 and 22 use some linux protocol but I would like to use telnet (port 23), if anyone can shed some light on this please let me know.

 

 

Link to comment
Share on other sites

Details that I had left out, I am using C++ code and opening a Winsock connection. Ports 21 and 22 give the same correct response programmatically as they did through a command prompt, it is only telnet that did not respond correctly through the code. I am attempting this because the PowerPMACComLib can't be used in our C++ code, so I'd like to be able to talk directly to the PowerPMAC. After opening a connection it should be as simple as specifying a username, password, then sending "gpascii" so I can send commands.

 

 

I can connect to the PowerPMAC through telnet just fine in the command prompt, but when I try to do this programmatically I get a garbage response and cannot do anything. Ports 21 and 22 use some linux protocol but I would like to use telnet (port 23), if anyone can shed some light on this please let me know.

 

 

 

 

Here are some VC++ examples maybe they will give you a clue. I would try one of

them.

 

http://www.codeproject.com/Articles/937/Telnet-Console-Application

http://www.codeproject.com/Articles/46/NT-Telnet-server-and-client

http://www.codeproject.com/Articles/13071/Programming-Windows-TCP-Sockets-in-C-for-the-Begin

http://www.codeproject.com/Articles/1904/Beginning-Winsock-Programming-Simple-TCP-client

 

 

Link to comment
Share on other sites

I guess I was unclear as to what my issue was, sorry. All of these examples seem to be the same thing, all using Winsock as I am using it in my code as well although some of them have it wrapped up into their own classes. My code works with connecting to the PowerPMAC just as it has been used to connect to other pieces of hardware that we use, but for whatever reason the telnet connection responds strangely. The only cause of this that I can think of is some strange settings on the PowerPMAC itself, not with my code.

 

Details that I had left out, I am using C++ code and opening a Winsock connection. Ports 21 and 22 give the same correct response programmatically as they did through a command prompt, it is only telnet that did not respond correctly through the code. I am attempting this because the PowerPMACComLib can't be used in our C++ code, so I'd like to be able to talk directly to the PowerPMAC. After opening a connection it should be as simple as specifying a username, password, then sending "gpascii" so I can send commands.

 

 

I can connect to the PowerPMAC through telnet just fine in the command prompt, but when I try to do this programmatically I get a garbage response and cannot do anything. Ports 21 and 22 use some linux protocol but I would like to use telnet (port 23), if anyone can shed some light on this please let me know.

 

 

 

 

Here are some VC++ examples maybe they will give you a clue. I would try one of

them.

 

http://www.codeproject.com/Articles/937/Telnet-Console-Application

http://www.codeproject.com/Articles/46/NT-Telnet-server-and-client

http://www.codeproject.com/Articles/13071/Programming-Windows-TCP-Sockets-in-C-for-the-Begin

http://www.codeproject.com/Articles/1904/Beginning-Winsock-Programming-Simple-TCP-client

 

 

 

 

Link to comment
Share on other sites

I guess I was unclear as to what my issue was, sorry. All of these examples seem to be the same thing, all using Winsock as I am using it in my code as well although some of them have it wrapped up into their own classes. My code works with connecting to the PowerPMAC just as it has been used to connect to other pieces of hardware that we use, but for whatever reason the telnet connection responds strangely. The only cause of this that I can think of is some strange settings on the PowerPMAC itself, not with my code.

 

Details that I had left out, I am using C++ code and opening a Winsock connection. Ports 21 and 22 give the same correct response programmatically as they did through a command prompt, it is only telnet that did not respond correctly through the code. I am attempting this because the PowerPMACComLib can't be used in our C++ code, so I'd like to be able to talk directly to the PowerPMAC. After opening a connection it should be as simple as specifying a username, password, then sending "gpascii" so I can send commands.

 

 

I can connect to the PowerPMAC through telnet just fine in the command prompt, but when I try to do this programmatically I get a garbage response and cannot do anything. Ports 21 and 22 use some linux protocol but I would like to use telnet (port 23), if anyone can shed some light on this please let me know.

 

 

 

 

Here are some VC++ examples maybe they will give you a clue. I would try one of

them.

 

http://www.codeproject.com/Articles/937/Telnet-Console-Application

http://www.codeproject.com/Articles/46/NT-Telnet-server-and-client

http://www.codeproject.com/Articles/13071/Programming-Windows-TCP-Sockets-in-C-for-the-Begin

http://www.codeproject.com/Articles/1904/Beginning-Winsock-Programming-Simple-TCP-client

 

 

 

 

 

In the earlier version of PowerPMAC IDE we were using Telnet protocol to communicate. I created the class in C# but I used C++ example to understand the protocol. I did not see any problem and was able to communicate. PowerPMAC "inetd", a telnet demon was responding properly.

What kind of response you receive, garbage or some escape character? Are you receiving the data asynchronously?

Thanks,

Atul

 

Link to comment
Share on other sites

I am receiving the data asynchronously. The response I am getting is the same every time I open a connection, "ÿý?ÿý ÿý#ÿý". I had tried to simply ignore the response and send it my username then password but it stops responding after it sends me this.

 

I guess I was unclear as to what my issue was, sorry. All of these examples seem to be the same thing, all using Winsock as I am using it in my code as well although some of them have it wrapped up into their own classes. My code works with connecting to the PowerPMAC just as it has been used to connect to other pieces of hardware that we use, but for whatever reason the telnet connection responds strangely. The only cause of this that I can think of is some strange settings on the PowerPMAC itself, not with my code.

 

Details that I had left out, I am using C++ code and opening a Winsock connection. Ports 21 and 22 give the same correct response programmatically as they did through a command prompt, it is only telnet that did not respond correctly through the code. I am attempting this because the PowerPMACComLib can't be used in our C++ code, so I'd like to be able to talk directly to the PowerPMAC. After opening a connection it should be as simple as specifying a username, password, then sending "gpascii" so I can send commands.

 

 

I can connect to the PowerPMAC through telnet just fine in the command prompt, but when I try to do this programmatically I get a garbage response and cannot do anything. Ports 21 and 22 use some linux protocol but I would like to use telnet (port 23), if anyone can shed some light on this please let me know.

 

 

 

 

Here are some VC++ examples maybe they will give you a clue. I would try one of

them.

 

http://www.codeproject.com/Articles/937/Telnet-Console-Application

http://www.codeproject.com/Articles/46/NT-Telnet-server-and-client

http://www.codeproject.com/Articles/13071/Programming-Windows-TCP-Sockets-in-C-for-the-Begin

http://www.codeproject.com/Articles/1904/Beginning-Winsock-Programming-Simple-TCP-client

 

 

 

 

 

In the earlier version of PowerPMAC IDE we were using Telnet protocol to communicate. I created the class in C# but I used C++ example to understand the protocol. I did not see any problem and was able to communicate. PowerPMAC "inetd", a telnet demon was responding properly.

What kind of response you receive, garbage or some escape character? Are you receiving the data asynchronously?

Thanks,

Atul

 

 

 

Link to comment
Share on other sites

Ok, I'm at least able to get to a login prompt now. I looked at this post I found on google:

 

http://www.director-online.com/buildArticle.php?id=907

 

I have no idea why it works, but basically when the PowerPMAC sends me one of these messages I can simply return that message back to it. When I do this about four times it asks me for my username and password. the root login doesn't seem to be working (says "Login incorrect") but I'm still looking into it so I'll post on this thread when I get it to work.

Link to comment
Share on other sites

I am fresh to linux, how can I get through this issue of it not letting me through root? I tried using "adduser test1 -p test1" to add a new user but it responds with "Login incorrect" when I try to login with the created user.

 

PowerPMAC login is

user:root

pwd:deltatau

To login to powerpmac pass this user/pwd from your telnet session.

Are you trying to add new user ?

Atul

 

Link to comment
Share on other sites

I had added two new users but it wouldn't let me log into them. I log into the PowerPMAC all the time with username root and password deltatau on the command line but it still never worked programmatically. Now I can't get the IDE, command line telnet, ping or a Winsock to connect to it at all. All I did was turn the PowerPMAC off and then on again and now no connections can be made. Any idea why this might be? I was finally very close to a solution to being able to talk to the PowerPMAC from C++ code.

 

I am fresh to linux, how can I get through this issue of it not letting me through root? I tried using "adduser test1 -p test1" to add a new user but it responds with "Login incorrect" when I try to login with the created user.

 

PowerPMAC login is

user:root

pwd:deltatau

To login to powerpmac pass this user/pwd from your telnet session.

Are you trying to add new user ?

Atul

 

 

 

Link to comment
Share on other sites

I had added two new users but it wouldn't let me log into them. I log into the PowerPMAC all the time with username root and password deltatau on the command line but it still never worked programmatically. Now I can't get the IDE, command line telnet, ping or a Winsock to connect to it at all. All I did was turn the PowerPMAC off and then on again and now no connections can be made. Any idea why this might be? I was finally very close to a solution to being able to talk to the PowerPMAC from C++ code.

 

I am fresh to linux, how can I get through this issue of it not letting me through root? I tried using "adduser test1 -p test1" to add a new user but it responds with "Login incorrect" when I try to login with the created user.

 

PowerPMAC login is

user:root

pwd:deltatau

To login to powerpmac pass this user/pwd from your telnet session.

Are you trying to add new user ?

Atul

 

 

 

 

If you need to reload your system from scratch the instructions are here.

 

http://forums.deltatau.com/showthread.php?tid=885

 

 

Link to comment
Share on other sites

Is there a file I can change to give root permission to log in? It has permission to log in when I do this by the command prompt but there must be something stopping me from doing it through my code. Even if I change a file, wont it be overwritten the next time I turn the PowerPMAC on?
Link to comment
Share on other sites

My original plan was to use gpascii to send messages to the PowerPMAC, but now I realize that I would also need to listen to unsolicited responses as well. Is there a function to let you do that? If not, there is no reason for me to continue with this solution.
Link to comment
Share on other sites

We are using Java with ssh library to communicate with the PPMAC. We use four separate ssh connections:

 

1) to run "gpascii" for sending commands and receiving responses

2) to run "geterrors" to receive any error messages (i.e. faults, etc.)

3) to run "getsends -0" to receive messages from our motion programs, which always use "send 0" to transmit status messages

4) to run "getsends -1" to receive messages from a status PLC that monitors all motors and send period status report via "send 1"

 

If this is similar to what you are looking for let me know and I'll send some code.

Link to comment
Share on other sites

We are using Java with ssh library to communicate with the PPMAC. We use four separate ssh connections:

 

1) to run "gpascii" for sending commands and receiving responses

2) to run "geterrors" to receive any error messages (i.e. faults, etc.)

3) to run "getsends -0" to receive messages from our motion programs, which always use "send 0" to transmit status messages

4) to run "getsends -1" to receive messages from a status PLC that monitors all motors and send period status report via "send 1"

 

If this is similar to what you are looking for let me know and I'll send some code.

 

Thanks but using C++ is a requirement as our software is already written in C++. I actually can easily use C# to communicate with the PowerPMAC using the library but my problem is specifically being able to communicate with it using C++ which cannot use PowerPMACComLib.

Link to comment
Share on other sites

  • 2 weeks later...
Guest
This topic is now closed to further replies.

×
×
  • Create New...