I'm trying to send a file from my laptop(win10) to my mobile(android) over bluetooth. I followed this answer and I'm doing the same with python 3.6
I'm using PyOBEX Python 3 Package and this is what I've tried.
import sys
from PyOBEX.client import Client
from bluetooth import *
addr = '60:7E:DD:A7:42:43'
print("Searching for OBEX service on {}".format(addr))
services = find_service(address=addr, name=b'OBEX Object Push\x00')
if len(services) == 0:
sys.exit()
first_match = services[0]
port = first_match["port"]
client = Client(addr, port)
client.connect()
client.put("test.txt", "Hello world\n")
client.disconnect()
When I run this, the device is discovered but it doesn't establish a connection or send files. This is the error it gives
I tried messing around with the PyOBEX package by changing the type of data returned by socket_.recv to str but it gives me another error,
I'm stuck and I have never worked with bluetooth or sockets before. Any help is appreciated