I'm writting a test program to send files (a .txt file now). It works with a Sony Ericsson but I can't send the file to a Windows Mobile device. I've tested the obex.send and I've tested the connect() and then the put (via OBEX push), but I doesn't work.
Another question, can I automatically assume that the pass provided by the user is 0000. I like to use this programa withous GUI so, I don't like a windows asking me for a pass to connect.
Thanks!
Álex González
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Are you sure it's sending to the correct channel for the OBEX Push service? Do you have any logs to indicate what the problem might be?
The PIN handling is done at a lower level than lightblue, so you'd have to use a different library to handle that. If you're on linux, try using the python dbus bindings for bluez.
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
If it works from obexftp but not LightBlue, it could be that the file is being sent to an OBEX FTP server rather than an OBEX Push server on the device. The lightblue.obex.sendfile() function doesn't use the FTP protocol when connecting, which would be a problem if it is connecting to an FTP server.
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Hi!
I'm writting a test program to send files (a .txt file now). It works with a Sony Ericsson but I can't send the file to a Windows Mobile device. I've tested the obex.send and I've tested the connect() and then the put (via OBEX push), but I doesn't work.
Another question, can I automatically assume that the pass provided by the user is 0000. I like to use this programa withous GUI so, I don't like a windows asking me for a pass to connect.
Thanks!
Álex González
Hi Álex,
Are you sure it's sending to the correct channel for the OBEX Push service? Do you have any logs to indicate what the problem might be?
The PIN handling is done at a lower level than lightblue, so you'd have to use a different library to handle that. If you're on linux, try using the python dbus bindings for bluez.
Hi blammit! and thanks for your reply.
I didn't test it too more, now I'm using obexftp via a subprocess function. But if you like a log, I can show you, tell me what do you like.
I send you the function to send objects via obexftp, perhaps somebody need it
"""
Send the message via the OBEX channel provided
"""
def send(self, hwaddr, channel):
command = 'obexftp --nopath --noconn --uuid none -b %s -B %d -p %s > /dev/null' % (hwaddr, channel, self.filename)
# Call obexftp redirecting the output to /dev/null
subprocess.Popen(command, shell = True, stdout = open('/dev/null', 'w'), stderr = subprocess.STDOUT)
Thanks for your reply... and above, thanks for lightblue ;)
If it works from obexftp but not LightBlue, it could be that the file is being sent to an OBEX FTP server rather than an OBEX Push server on the device. The lightblue.obex.sendfile() function doesn't use the FTP protocol when connecting, which would be a problem if it is connecting to an FTP server.