putty / telnet repl? #309

Open
debjan opened this Issue Dec 25, 2013 · 4 comments

Projects

None yet

2 participants

@debjan
debjan commented Dec 25, 2013

Sorry if this issue title is nonsensical, as it's foreign territory for me

I'm using PyS60 on my Nokia N8, through PuTTY console on my desktop, connected with virtual serial port to my phone's PyS60 bluetooth console. If works nice.

I also tried with Console2 (after adding ansi driver) and it's also fine.

However I wanted to go further and enjoy ST as interface to the Python interpreter running on my phone.
Running plink (putty link) through SumlimeREPL shell, doesn't seem to work - plink process is started, but no communication is visible it just "freezes" shell repl.

So I thought to ask if SublimeREPL can offer a pipe and if yes, maybe some pointers in right direction how to get there :)

Thanks

@wuub
Owner
wuub commented Dec 27, 2013

plink won't work under Shell REPL, and there are no plans to fix this issue anytime soon. Sorry :(

I've tried to integrate putty/cygwin ssh on windows in the past but without any serious progress, any communication with the subprocess would simply lock up.

The main question is: are you using SSH or Telnet/Serial to talk with PyS60? If it's the later, there might be hope for you ;)

@debjan
debjan commented Dec 27, 2013

It's a serial :)

I've set listening bluetooth serial port on my PC and set putty session to that serial port.
I then launch PyS60 (which is based on Python 2.5.4, FYI) bluetooth console on my phone and I get interactive interpreter in putty console on my PC. It's just like regular Python shell and more convenient to type in then the console on my phone.

@wuub
Owner
wuub commented Dec 27, 2013

this http://pyserial.sourceforge.net/examples.html#tcp-ip-serial-bridge + a Telnet REPL should do the trick.

I'll try to set it up tomorrow.

@debjan
debjan commented Dec 27, 2013

Thanks for helping me out wuub, you are gentleman :)

If it matters, I'll just post that also TCP/IP connection is possible if user doesn't have bluetooth stack (assuming he runs Linux):

If Bluetooth wireless technology is unavailable, you can also use the console over any TCP/IP transport
service your phone supports, such as GPRS, EDGE, or UMTS. To run the console over TCP/IP, first set up a
listening TCP port on a host the phone can access. For example, if you have the "Netcat" utility on a
Linux machine, you can use the following commands to receive the connection (replace 1025 with the
port you want to use):

stty raw -echo; nc -l -p 1025; stty sane

Then you can run the console over TCP/IP with the following script in the device:

import btconsole
from socket import *
sock=socket(AF_INET,SOCK_STREAM)
sock.connect(("address of listening host",1025))
btconsole.run_with_redirected_io(sock,btconsole.interact,
None, None, locals())
sock.close()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment