Connecting pys60 bluetooth console

1k Views Asked by At

I'm trying to program using python (pys60) in my phone. i'm using two way to connect my ubuntu 10.10 to my phone using bluetooth console first is: sdptool add --channel=2 SP mknod /dev/rfcomm0 c 216 0 rfcomm listen 0 2 and the second is:

    hciconfig reset
    hcitool dev
    sdptool add --channel=2 SP
    rfcomm listen rfcomm2 2

Both first and second way work well for connecting to myphone so i get this in my ubuntu terminal

    Connection from 00:1D:FD:91:1A:EA to /dev/rfcomm2
    Press CTRL-C for hangup

The problem is, i cant get into the python shell in the phone from my terminal. When i'm using

    cu -l /dev/rfcomm2

what i get is

    cu: /dev/rfcomm2: Line in use

so i try to use

    screen /dev/rfcomm2

but still i failed

    Cannot open line '/dev/rfcomm2' for R/W: Device or resource busy
    Sorry, could not find PTY.
    [screen is terminating]

Wish someone could tell how to resolve this, moving the *.py to phone every time i want to test the script is so tiresome.

1

There are 1 best solutions below

0
FxIII On

try:

sudo cu -l /dev/rfcomm2

If it works you will probably understand what is wrong

[EDIT]

sudo chown root:root /dev/rfcomm2

the line is not in use in my case (try sudo fuser /dev/rfcomm2) cu is a little buggy in error detection see this.

The thing i still don't understand is why screen does not work.