×

Discussion Board

Results 1 to 6 of 6
  1. #1
    Registered User
    Join Date
    Feb 2009
    Location
    Surabaya, Indonesia
    Posts
    4

    Question found problem with discover bluetooth device from mobile to pc

    I'm a newbie in python programming and I got a serious problem.

    I try to make a client-server bluetooth connection using PC as server and mobile phone (symbian S60) as client.

    I'm using PyBluez to develop my server and should be like this:


    from bluetooth import *

    server_sock=BluetoothSocket( RFCOMM )

    port = 9
    server_sock.bind(("",port))
    server_sock.listen(1)
    print "listening on port %d" % port

    uuid = "c3453417-9a0f-4cae-a380-e70fc41818b7"
    advertise_service( server_sock, uuid, u'FooBar Service',
    service_classes = [ uuid, SERIAL_PORT_CLASS ],
    profiles = [ SERIAL_PORT_PROFILE ])

    client_sock,address = server_sock.accept()
    print "Accepted connection from ",address

    client_sock.close()
    server_sock.close()


    That script runs normally on my desktop, but the main problem is occured when I tried to discover the advertised service from my mobile phone (Nokia 6600) using python script like this:


    import socket

    addr,serv = socket.bt_discover()
    print addr,serv

    conn = socket.socket(sock.AF_BT, sock.SOCK_STREAM)
    if 'FooBar Service' in serv:
    try:
    conn.connect((addr, serv[u'FooBar Service']))
    except:
    print 'connection failed'
    else:
    print 'service not found'


    When I run this script and reach the 'socket.bt_discover()' statement my mobile phone starting discover nearby device like usual, but when I select the bluetooth device according to my server device (desktop) the application even the python interpreter it self runs down/exit/crash (i don't know how to mention it) by it's own to phone's main menu.

    I've tried to using any exception to get error information, but it useless 'cause it still crashes the interpreter.

    I also tried using J2ME to check if the server is working properly, and I got it connected perfectly.

    Could anybody help me with this problem, please?
    Last edited by yohanes.indra88; 2009-04-24 at 10:07. Reason: add for more details

  2. #2
    Registered User
    Join Date
    Apr 2009
    Posts
    10

    Re: found problem with discover bluetooth device from mobile to pc

    I find the same crashing bug when using either Lightblue bluetooth api or even the standard socket module to run a bt_discover function.

    I think that it is a known bug for some time now, and I think (may be wrong) its an error with the Python for S60 Interpreter itself. I dont know of a fix, if anyone knows I would also really appreciate this!!

  3. #3
    Registered User
    Join Date
    Feb 2009
    Location
    Surabaya, Indonesia
    Posts
    4

    Re: found problem with discover bluetooth device from mobile to pc

    Thank you benjee for your reply...

    I think the problem is how pyS60 advertises/finds service to/from other bluetooth API. Usually other bluetooth API using UUID to advertise or find service as the main parameter, but pyS60 only using service-name. Maybe it's related with service discovery problem.

  4. #4
    Registered User
    Join Date
    Feb 2010
    Posts
    13

    Re: found problem with discover bluetooth device from mobile to pc

    I have also the very same issue and I have been trying since a week to find a workaround. Could any one let me know what is the proposed solution to make it work! Your help is really appreciated.
    I suppose that there is a solution, or?

    My application on my phone (using Py60) is pushing properly text to my PC as when I open a telnet on the port COM 14, I can see the text which is sent. But as soon as I start to publish a service using PBluez my appli on my phone crashes as described in this thread.

    What is the workaround?

    Regards,

  5. #5
    Registered User
    Join Date
    Feb 2009
    Location
    Surabaya, Indonesia
    Posts
    4

    Re: found problem with discover bluetooth device from mobile to pc

    Try using Serial Port Service Class (0x1011) as UUID string, maybe it works.

    I failed using PC(PyBluez) as a server and mobile phone(PyS60) as a client on my project, but I reverse the role (PC as client, phone as server) so it works fine with that solution.

  6. #6
    Registered User
    Join Date
    Feb 2010
    Posts
    13

    Re: found problem with discover bluetooth device from mobile to pc

    Try using Serial Port Service Class (0x1011) as UUID string, maybe it works.
    Sounds very good. How can I find the UUID for the serial port? Which UUID shoud I use?
    I have created a service in the Bluetooth configurator (control panel) called "bluetooth serial port" on COM14. How can I find the related UUID?

    Many thanks for your help.

    BR,

Similar Threads

  1. problem with bluetooth device dicover
    By masoud_bayat in forum Symbian
    Replies: 5
    Last Post: 2008-10-12, 10:31
  2. receive file from bluetooth (Mobile -> PC)
    By caucuk33 in forum Bluetooth Technology
    Replies: 4
    Last Post: 2008-07-11, 13:20
  3. PC Suite Bluetooth Pairing Problem
    By fds_5 in forum PC Suite API and PC Connectivity SDK
    Replies: 0
    Last Post: 2007-05-18, 15:03
  4. Bluetooth Security: What exactly is an untrusted device?
    By rahulmcs in forum Bluetooth Technology
    Replies: 1
    Last Post: 2005-12-02, 06:26

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
×