#1
  1. No Profile Picture
    Registered User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Aug 2012
    Posts
    1
    Rep Power
    0

    Arrow Bluetooth programming using python


    Hi,
    I have created a RMCOMM port. In my program I am sending some data from device1 to device2 and receiving some data from device2 to device1.
    But after sending data to device2 when device1 waits for data to arrive from device2 I am always getting the follwing problem.

    File "C:\Python26\Lib\site-packages\bluetooth\msbt.py", line 41, in bind
    status = bt.bind (self._sockfd, addr, port)
    IOError: Only one usage of each socket address (protocol/network address/port) is normally permitted.

    Please help me
  2. #2
  3. No Profile Picture
    Contributing User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Dec 2004
    Location
    Regensburg, Germany
    Posts
    147
    Rep Power
    17
    Without your code I can only guess what's wrong. From what I can detect from the error message you might be using the pybluez package. If so maybe the line
    python Code:
    status = bt.bind (self._sockfd, addr, port)
    should better read
    python Code:
    status = bt.bind ((addr, port))
    Try to understand the documentation for pyblues. Reading the examples for rfcomm server and client carefully may be helpful.

IMN logo majestic logo threadwatch logo seochat tools logo