The Following User Says Thank You to misiak For This Useful Post: | ||
|
2011-04-26
, 10:34
|
Posts: 805 |
Thanked: 1,605 times |
Joined on Feb 2010
@ Gdynia, Poland
|
#2
|
The Following User Says Thank You to misiak For This Useful Post: | ||
|
2011-04-26
, 22:04
|
Posts: 726 |
Thanked: 345 times |
Joined on Apr 2010
@ Sweden
|
#3
|
|
2011-04-27
, 02:07
|
Posts: 805 |
Thanked: 1,605 times |
Joined on Feb 2010
@ Gdynia, Poland
|
#4
|
Are you running the N900 script as root?
If not, how are you able to bind to a socket < 1024 which should be reserved for root processes?
import bluetooth server_sock=bluetooth.BluetoothSocket( bluetooth.RFCOMM ) port = 3 server_sock.bind(("",port)) server_sock.listen(1) print "listening on port %d" % port uuid = "A55665EE-9F91-4610-9085-C2055C888B39" bluetooth.advertise_service( server_sock, "btsppEcho", uuid ) print "Waiting for connections" client_sock,address = server_sock.accept() print "Accepted connection from ",address while True: data = client_sock.recv(1024) print "received [%s]" % data client_sock.close() server_sock.close()
"btspp://" + myRemoteDevice.getBluetoothAddress() + ":3;authenticate=true;encrypt=true;master=false";
The Following User Says Thank You to misiak For This Useful Post: | ||
|
2011-04-27
, 18:06
|
Posts: 726 |
Thanked: 345 times |
Joined on Apr 2010
@ Sweden
|
#5
|
|
2011-04-27
, 19:53
|
Posts: 805 |
Thanked: 1,605 times |
Joined on Feb 2010
@ Gdynia, Poland
|
#6
|
Happy hacking.
But, using ports < 1024 is not needed. You can pick some other port, 1024 <= p < 65535, and then your process won't have to run as root.
This is recommended unless you give up your root permissions after doing the bind.
The Following User Says Thank You to misiak For This Useful Post: | ||
|
2013-07-09
, 04:24
|
|
Posts: 1,974 |
Thanked: 1,834 times |
Joined on Mar 2013
@ india
|
#7
|
|
2013-08-20
, 11:06
|
Posts: 805 |
Thanked: 1,605 times |
Joined on Feb 2010
@ Gdynia, Poland
|
#8
|
I'm writing an app to remotely control N900 with any different Bluetooth and Java ME phone. So far I got almost everything working (even system-wide simulation of keypresses and mouse-touch events), by the way: you can now download xdotools package from extras-devel for fremantle if you need it. I need help with bluetooth communication. I found enormous amounts of sources, but unfortunately none really worked for me. I'm now just requesting help in getting BT communication between my N900 Python script and N95 Java ME app. What I have now to demonstrate just my problem is:
Nokia N900 side:
I tried also http://git.kernel.org/?p=bluetooth/b...ervice;hb=HEAD and am aware of http://git.kernel.org/?p=bluetooth/b...f=test;hb=HEAD examples. But when I used this, the service was not discovered by N95 Java MIDlet.
My connection string in MIDlet is:
According to http://symbian.newlc.com/Symbian-OS-Error-Codes.html it means EPageTimedOut error from "Bluetooth Errors" category.
I've read already http://developers.sun.com/mobility/m...es/bluetooth2/ and many other documents, but I still have no idea how to set things up...
I've also googled all those errors and found no solution, just flocks of programmers unable to find solution (like me). I think I just should get some newer python code and try to build something on it, but I am totally lost at the moment.
Could anyone help me and just explain or point to source, which could explain me how to exchange data between Java ME applet on Nokia N95 phone and python script on Nokia N900 phone? I need to register bt service on N900 and connect N95 client app to it. It's a total blocker for now for my app (mmmRemotePhoneKeyboard, when I will solve this issue with bluetooth, I will upload it to extras-devel). Thank you very much in advance.
Edit: soved, see further posts
Last edited by misiak; 2012-05-14 at 14:24.