Menu

lightblue.obex.sendfile() : Error

Help
2007-05-16
2013-04-25
  • Sergio Bernardo

    Sergio Bernardo - 2007-05-16

    Hi!

    I'm testing LightBlue and it seems very simple and cool, but unfortunately it does not work, at least in my Linux box :-(

    This is what happens to me:

    python:

    ===========================================================

    >>> from lightblue import *

    >>> finddevices()
    [('00:16:B8:C1:91:56', u'Z550i', 262738L)]

    >>> findservices('00:16:B8:C1:91:56')
    [('00:16:B8:C1:91:56', 1, u'OBEX SyncML Client'), ('00:16:B8:C1:91:56', 2, u'Dial-up Networking'), ('00:16:B8:C1:91:56', 3, u'Serial Port'), ('00:16:B8:C1:91:56', 4, u'HF Voice Gateway'), ('00:16:B8:C1:91:56', 5, u'HS Voice Gateway'), ('00:16:B8:C1:91:56', 6, u'OBEX Object Push'), ('00:16:B8:C1:91:56', 7, u'OBEX File Transfer'), ('00:16:B8:C1:91:56', 8, u'OBEX IrMC Sync Server'), ('00:16:B8:C1:91:56', 15, u'NAP service'), ('00:16:B8:C1:91:56', 17, u'Mouse & Keyboard')]

    >>> obex.sendfile('00:16:B8:C1:91:56',6,'logo.gif')
    [btobexclient_connect] Connecting transport...
    [btobexclient_connect] Error opening Bluetooth transport connection!
    [btobexserver_cleanup] entry.
    Traceback (most recent call last):
      File "<stdin>", line 1, in ?
      File "/usr/lib/python2.4/site-packages/lightblue/_obex.py", line 47, in sendfile
        fileobj, os.stat(source)[stat.ST_SIZE])
      File "/usr/lib/python2.4/site-packages/lightblue/_obex.py", line 62, in _sendfile
        raise _lightbluecommon.BluetoothError(str(exc))
    lightblue._lightbluecommon.BluetoothError: Error connecting to server

    ===========================================================

    I've tried all services, they all give the same error. Even changing the device address returns the same error - with an invalid address...

    Notes:

      - OS:  Linux 2.6.18-gentoo-r4
      - /etc/init.d/bluetooth started!
      - pybluez-0.9.2 [installed from source]
      - OpenObex: dev-libs/openobex 1.3 [gentoo package]
      - LightBlue source files 0.2 [installed from source]

    I'm I doing something wrong?
    The USB/Bluetooth device seems to be working and to support OBEX Object push, has it correctly scans the network and I tested Object push on MS Windows...

    Any help would be appreciated.

    Thanks.

    --
    Sergio Bernardo

     
    • blam

      blam - 2007-05-17

      It looks like OpenOBEX can't connect the underlying transport connection. Are you able to send files from the normal built-in bluetooth file transfer apps? (kbluetooth OBEX File Transfer, etc.)

       
      • Sergio Bernardo

        Sergio Bernardo - 2007-05-22

        Hello again.

        Thank you for the answer. It guided me into the right direction ;-)
        It's working now!

        For the records, here is what happened to me:

        I've installed openObex on Gentoo with the detaulf emerge configuration, but something gone wrong...
        The correct way to install-it for use with Bluetooth / USB is this:

             USE="usb bluetooth" emerge openobex

        After that, restarted bluetooth and "OBEX Push Daemon":

             /etc/init.d/bluetooth restart
             /etc/init.d/opd start

        And that was it :-)

        --
        Sergio Bernardo

         

Log in to post a comment.

Want the latest updates on software, tech news, and AI?
Get latest updates about software, tech news, and AI from SourceForge directly in your inbox once a month.