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
  RPi and smartphone Bluetooth communication GigiG 0 344 Mar-18-2025, 09:54 AM
Last Post: GigiG
  Read data via bluetooth frohr 9 7,742 Jul-10-2022, 09:51 AM
Last Post: frohr
  Connect to HC-05 Bluetooth (NOT BLE) korenron 0 2,135 Jun-26-2022, 09:06 AM
Last Post: korenron
  Read buffer from bluetooth frohr 2 3,220 Jun-01-2022, 01:31 PM
Last Post: frohr
  Scan for Bluetooth device korenron 0 3,468 Jan-10-2022, 01:06 PM
Last Post: korenron
  Sending string commands from Python to a bluetooth device Rovelin 13 15,604 Aug-31-2021, 06:40 PM
Last Post: deanhystad
  ModuleNotFoundError: No module named 'bluetooth' Error Rovelin 4 14,796 Aug-31-2021, 04:04 PM
Last Post: Rovelin
  Bluetooth send message after connecting? korenron 2 3,519 Apr-26-2021, 05:50 AM
Last Post: korenron
  bluetooth device inquiry anne 0 2,914 Aug-01-2020, 12:24 AM
Last Post: anne
  Reading Smartphone Battery Level via Bluetooth maxwell 1 2,972 Jun-17-2020, 12:48 AM
Last Post: Larz60+

Forum Jump:

User Panel Messages

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