I wrote a Python script which can transfer a file from one Pi to another Pi specifically by using the MAC address of the other device.

The problem is: I am able to send the file to one device, but with the same code I cannot send the file to a different device.

I get the following error:

Traceback (most recent call last): File "<pyshell#12>", line 1, in <module>
obex.sendfile(device, channel, "/bluetooth/RSSI.csv") File "/usr/local/lib/python2.7/dist-packages/lightblue/_obex.py", line 257, in sendfile
raise OBEXError("server denied the Put request") OBEXError: server denied the Put request

Here my csv file is stored in folder named Bluetooth. Program is:

from lightblue import *
services = findservices("54:27:58:DA:31:10")
D = [ (x,y,z) for x,y,z in services if "obex" in z.lower() and "push" in z.lower()]
(device, channel, description) = D[0]
obex.sendfile(device, channel, "/bluetooth/RSSI.csv")

For one MAC address it worked properly but for other it doesn't work and gives this error. Does anyone know why? If anyone has found a solution then it would be really helpful for me.

  • 1
    It's not clear that those one device and different device are. If they're both raspberries, why don't you simply configure the second device identically to the first one? – Dmitry Grigoryev Mar 2 '17 at 8:48