You Are Here:

Community: Developer Discussion Boards

#1 Old Question found problem with discover bluetooth device from mobile to pc - 2009-04-24, 10:58

Join Date: Feb 2009
Posts: 3
Location: Surabaya, Indonesia
yohanes.indra88
Offline
Registered User
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 11:07. Reason: add for more details
Reply With Quote

#2 Old Re: found problem with discover bluetooth device from mobile to pc - 2009-05-04, 01:19

Join Date: Apr 2009
Posts: 10
benjeee
Offline
Registered User
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!!
Reply With Quote

#3 Old Re: found problem with discover bluetooth device from mobile to pc - 2009-05-05, 06:15

Join Date: Feb 2009
Posts: 3
Location: Surabaya, Indonesia
yohanes.indra88
Offline
Registered User
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.
Reply With Quote
Reply « Previous Thread | Next Thread »
Display Modes
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Rate This Thread
Rate This Thread:

Posting Rules

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

vB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Forum Jump
Similar Threads
Thread Thread Starter Forum Replies Last Post
problem with bluetooth device dicover masoud_bayat General Symbian C++ 5 2008-10-12 11:31
receive file from bluetooth (Mobile -> PC) caucuk33 Bluetooth Technology 4 2008-07-11 14:20
PC Suite Bluetooth Pairing Problem fds_5 PC Suite API and PC Connectivity SDK 0 2007-05-18 16:03
Bluetooth Security: What exactly is an untrusted device? rahulmcs Bluetooth Technology 1 2005-12-02 07:26

Rate This

 
Bookmark this page: DeliciousDiggFacebookGoogleYahooStumbleUponRedditDiigoTechnocratiTwitter  Share this page Share this page Print this Page Print this page Invite a friend Invite a friend
京ICP备05048969号    Email Newsletters Press Terms & Conditions Privacy Policy Sitemap Contact Us © 2009 Nokia 
RDF Facets: qdcZidentifierQSxhttpE3aE2fE2fdiscussionE2eforumE2enokiaE2ecomhttpE3aE2fE2fdiscussionE2eforumE2enokiaE2ecomE2fforumE2fshowthreadE2ephpE3ftE3d81449X qdcZtypeQUqfnZE45E78cludedFromGeneralE4cistingsQ qdcZtypeQUqfntypeZCommunityContentQ qdcZtypeQUqfntypeZE44iscussionQ qdcZtypeQUqfntypeZE44iscussionContentQ qdcZtypeQUqfntypeZE52esourceQ qdcZtypeQUqfntypeZWebpageQ qdcZtypeQUqmarsZManagedE52esourceQ qdcZtypeQUqwebZInformationE52esourceQ qdcZtypeQUqwebZPageQ qdcZtypeQUqwebZE52esourceQ qdcZtypeQUqrdfsZE52esourceQ qfnZtopicQUqfnTopicZpythonQ qfnZtypeQUqfntypeZCommunityContentQ qfnZtypeQUqfntypeZE44iscussionQ qfnZtypeQUqfntypeZE44iscussionContentQ qfnZtypeQUqfntypeZE52esourceQ qfnZtypeQUqfntypeZWebpageQ qfnZuserE5ftagQSxpythonX qmarsZlanguageQUxhttpE3aE2fE2fswE2enokiaE2ecomE2flanguageE2d1E2fenX qrdfZtypeQUqfnZE45E78cludedFromGeneralE4cistingsQ qrdfZtypeQUqfntypeZCommunityContentQ qrdfZtypeQUqfntypeZE44iscussionQ qrdfZtypeQUqfntypeZE44iscussionContentQ qrdfZtypeQUqfntypeZE52esourceQ qrdfZtypeQUqfntypeZWebpageQ qrdfZtypeQUqmarsZManagedE52esourceQ qrdfZtypeQUqwebZInformationE52esourceQ qrdfZtypeQUqwebZPageQ qrdfZtypeQUqwebZE52esourceQ qrdfZtypeQUqrdfsZE52esourceQ