Hi,
I trying to execute this code and I always receive this message:
Error 2, no such file or directory...
I can select my device. I just can connect...
My code is that:
from appuifw import *
from e32socket import *
try:
phone = bt_obex_discover()
file = query(u"File Selection", 'text')
bt_obex_send_file(phone[0], phone[1].values()[0], file)
note(u"File Sent")
except Exception, error:
note(unicode(error), 'error')
I think that the code is OK! Maybe the problem is with Nokia 6681 and Python...
[]'s
Danilo Cesar
Logged In: YES
user_id=1402590
Originator: NO
are you sure you have properly configured COM ports on PC? This occured to me, when I used Windows BT drivers. Everything works fine after switching to drivers shipped with BT device.
Logged In: YES
user_id=1338557
Originator: YES
I never needed to configure my ports on PC... But I think that is not this problem...
When I execute this code, the problem do not occur
import socket
sock=socket.socket(socket.AF_BT, socket.SOCK_STREAM)
target=('00:0C:55:FB:80:D6',4) # bt-address and port
sock.connect(target)
sock.send("hello!")
But, if I change this code to try to find other devices, the problem happens again.
target= socket.bt_discover()
And I do not use windows...
Logged In: YES
user_id=1162622
Originator: NO
Make sure the target is advertising an OBEX service. The only reason we have found for that error message in this context is that the selected target device does not advertise any services of the searched type.
Logged In: YES
user_id=1338557
Originator: YES
OK...
But, I think that you will agree with me. I want just found bt devices around me...
Look this code now.. I do not try to connect with anybody. I do not try to send nothing....
But, it still giving me the same error:
address, services = socket.bt_discover() error: (2,"No such file or directory")
Its show me bluetooth devices around me. But, when I select then, this error message appear.
============Code here==============
import appuifw
import e32
import socket
sock = socket.socket( socket.AF_BT, socket.SOCK_STREAM )
address,services = socket.bt_discover()
print address
print services
**************** UPDATE:
Yes... I need a service running on machine... But, and if I only want to know about a bluetooth adreess?
I think that bt_discover need to return a address and a empty service... Did you agree with me?
Logged In: YES
user_id=1338557
Originator: YES
A rapid solution to this, on linux, run this command:
sdptool add --channel=3 SP
It will registar a new service port, and bt_discover will not return a error anymore...
But, developers: Please.... Make bt_discover return a address field and a empty service in the next version...
Thanks,
Danilo Cesar
Logged In: YES
user_id=1591731
Originator: NO
bt_obex_send_file(phone[0], phone[1].values()[0], file)
Gives error: Error 2, no such file or directory, if file name or path is invalid.
btconsole will also give same error if address,services = socket.bt_discover() fails.
Running it as a script it gives error (0, 'Error') if can't make a connection.
Logged In: YES
user_id=1591731
Originator: NO
Correction for previous, in device it does give Error 2, no such file or directory
if Bt_device is on and service can't be started.