Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Programmatic Telnet session not working
#1
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.
Reply
#2
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.


(05-23-2012, 12:15 PM)PaulOfCinci Wrote: 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.

Reply
#3
(05-24-2012, 07:40 AM)PaulOfCinci Wrote: 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.


(05-23-2012, 12:15 PM)PaulOfCinci Wrote: 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/...pplication
http://www.codeproject.com/Articles/46/N...and-client
http://www.codeproject.com/Articles/1307...-the-Begin
http://www.codeproject.com/Articles/1904...TCP-client

Reply
#4
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.

(05-24-2012, 07:58 AM)hbausley Wrote:
(05-24-2012, 07:40 AM)PaulOfCinci Wrote: 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.


(05-23-2012, 12:15 PM)PaulOfCinci Wrote: 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/...pplication
http://www.codeproject.com/Articles/46/N...and-client
http://www.codeproject.com/Articles/1307...-the-Begin
http://www.codeproject.com/Articles/1904...TCP-client

Reply
#5
(05-24-2012, 08:14 AM)PaulOfCinci Wrote: 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.

(05-24-2012, 07:58 AM)hbausley Wrote:
(05-24-2012, 07:40 AM)PaulOfCinci Wrote: 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.


(05-23-2012, 12:15 PM)PaulOfCinci Wrote: 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/...pplication
http://www.codeproject.com/Articles/46/N...and-client
http://www.codeproject.com/Articles/1307...-the-Begin
http://www.codeproject.com/Articles/1904...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
Reply
#6
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.

(05-24-2012, 10:02 AM)agovande Wrote:
(05-24-2012, 08:14 AM)PaulOfCinci Wrote: 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.

(05-24-2012, 07:58 AM)hbausley Wrote:
(05-24-2012, 07:40 AM)PaulOfCinci Wrote: 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.


(05-23-2012, 12:15 PM)PaulOfCinci Wrote: 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/...pplication
http://www.codeproject.com/Articles/46/N...and-client
http://www.codeproject.com/Articles/1307...-the-Begin
http://www.codeproject.com/Articles/1904...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

Reply
#7
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.
Reply
#8
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.
Reply
#9
(05-25-2012, 08:56 AM)PaulOfCinci Wrote: 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
Reply
#10
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.

(05-25-2012, 11:23 AM)agovande Wrote:
(05-25-2012, 08:56 AM)PaulOfCinci Wrote: 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

Reply
#11
(05-25-2012, 12:05 PM)PaulOfCinci Wrote: 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.

(05-25-2012, 11:23 AM)agovande Wrote:
(05-25-2012, 08:56 AM)PaulOfCinci Wrote: 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

Reply
#12
I turned it on this morning and now it will respond to my socket, so I'm back to getting it to let me log in. I'm not sure why it wouldn't let me before but for some reason it works now.
Reply
#13
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?
Reply
#14
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.
Reply
#15
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.
Reply
#16
(06-01-2012, 09:11 AM)andyf Wrote: 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.
Reply
#17
bump!
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)