Python Forum
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Bluetooth problem
#1
I am a new with bluetooth in Python. I wanted to use the following program that sends a file.
I wanted to send a file from laptop to a cell phone.

from bluetooth import *
from PyOBEX.client import BrowserClient

# bluetooth device address
address = '70:3A:51:7C:E1:17'

# find OBEX port using SDP
svc = find_service(address=address, uuid=OBEX_FILETRANS_CLASS)
channel = svc[0]['port']

# send file
print 'sending file to %s...'%address
client = BrowserClient(address, channel)
client.connect()
client.put('test.txt', 'HelloWorld!')
client.disconnect()
but
find_service(address=address, uuid=OBEX_FILETRANS_CLASS)
is empty , that is [] .
The mobile is connected with my laptop from which I started the program.
Do you have any clue, where is the problem?
Thank you for your reply
Reply


Possibly Related Threads…
Thread Author Replies Views Last Post
  Read data via bluetooth frohr 9 3,841 Jul-10-2022, 09:51 AM
Last Post: frohr
  Connect to HC-05 Bluetooth (NOT BLE) korenron 0 1,586 Jun-26-2022, 09:06 AM
Last Post: korenron
  Read buffer from bluetooth frohr 2 2,284 Jun-01-2022, 01:31 PM
Last Post: frohr
  Scan for Bluetooth device korenron 0 2,764 Jan-10-2022, 01:06 PM
Last Post: korenron
  Sending string commands from Python to a bluetooth device Rovelin 13 10,071 Aug-31-2021, 06:40 PM
Last Post: deanhystad
  ModuleNotFoundError: No module named 'bluetooth' Error Rovelin 4 12,585 Aug-31-2021, 04:04 PM
Last Post: Rovelin
  Bluetooth send message after connecting? korenron 2 2,760 Apr-26-2021, 05:50 AM
Last Post: korenron
  bluetooth device inquiry anne 0 2,420 Aug-01-2020, 12:24 AM
Last Post: anne
  Reading Smartphone Battery Level via Bluetooth maxwell 1 2,272 Jun-17-2020, 12:48 AM
Last Post: Larz60+
  Access phone via Bluetooth maxwell 2 2,397 Jun-03-2020, 05:22 PM
Last Post: maxwell

Forum Jump:

User Panel Messages

Announcements
Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020