pombreda / pybluez

Automatically exported from code.google.com/p/pybluez
GNU General Public License v2.0
0 stars 0 forks source link

bluetooth.btcommon.BluetoothError: (22, 'Invalid argument') #51

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?

import bluetooth

bd_addr = "00:1B:10:00:2A:EC"

port = 100

sock=bluetooth.BluetoothSocket( bluetooth.RFCOMM )
sock.connect((bd_addr, port))

sock.send("hello!!")

sock.close()

What is the expected output? What do you see instead?
I am not sure what I should be seeing, but all I ever see in the terminal is 

File "rfcommclient.py", line 8, in <module>
    sock.connect((bd_addr, port))
  File "<string>", line 5, in connect
bluetooth.btcommon.BluetoothError: (22, 'Invalid argument')

What version of the product are you using? On what operating system?
I am using pybluez .18 on Ubuntu 10.04 64bit

I know this problem has been reported time and time again, and I have found 
posts and threads with workarounds, but they don't work.  I have been stuck on 
this for 2 weeks now.I just refuse to believe that no one has found a way to 
make this work in pybluez .18 on Ubuntu.  Can someone please throw me a life 
vest here, I am drowning and I have no idea what to do.

Original issue reported on code.google.com by GTZi...@gmail.com on 13 Nov 2011 at 2:36

GoogleCodeExporter commented 9 years ago
A stab in the dark, but so far as I know, bluetooth RFCOMM ports only go up to 
25. 100 is simply an 'Invalid Argument'. Does it work with another port?

Original comment by robertm...@gmail.com on 16 Jan 2012 at 2:25

GoogleCodeExporter commented 9 years ago
According to great book: http://www.btessentials.com/
There is only 30 ports on RFCOMM 

Original comment by karu...@wp.pl on 19 Jan 2014 at 6:13