Pergunta

I am trying to develop a command line program in C++ on windows which uses putty to control a Raspberry Pi. I have used the Putty application and it works 100% fine. However I have tried to use the plink executable so I can control the program with my C++ program, but I get a random string of characters when I try and connect to the Pi. the console output is as follows

C:\Users\user>plink pi@xxx.xxx.xxx.xxx
Using username "pi".
pi@xxx.xxx.xxx.xxx's password:
Linux raspberrypi 3.6.11+ #371 PREEMPT Thu Feb 7 16:31:35 GMT 2013 armv6l

The programs included with the Debian GNU/Linux system are free software;
the exact distribution terms for each program are described in the
individual files in /usr/share/doc/*/copyright.

Debian GNU/Linux comes with ABSOLUTELY NO WARRANTY, to the extent
permitted by applicable law.
Last login: Tue May 21 15:59:02 2013 from xxx.xxx.xxx.xxx
←]0;pi@raspberrypi: ~←[01;32mpi@raspberrypi←[00m ←[01;34m~ $←[00m
←]0;pi@raspberrypi: ~←[01;32mpi@raspberrypi←[00m ←[01;34m~ $←[00m
←]0;pi@raspberrypi: ~←[01;32mpi@raspberrypi←[00m ←[01;34m~ $←[00m

(the last line appears again when i press enter).

Any help please?

Foi útil?

Solução

That's your shell prompt showing up. The odd looking characters are control characters your shell uses to produce a color terminal.

Plink doesn't respect the terminal's settings properly, otherwise those control characters would never get sent. You should be able to save a putty session with the terminal type set to 'dumb' and load those settings with plink using the -load option.

Licenciado em: CC-BY-SA com atribuição
Não afiliado a StackOverflow
scroll top