![]() |
[SOLVED] ARGH! Java ME <-> Maemo Bluetooth problem, code not working, need help
Hello!
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: Code:
import bluetooth 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: Code:
UUID uuid = new UUID("1e0ca4ea299d433593eb27fcfe7fa848",false); 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 |
Re: ARGH! Java ME <-> Maemo Bluetooth problem, code not working, need help
Bump. What I really need is code in Python, similar to http://git.kernel.org/?p=bluetooth/b...ervice;hb=HEAD which will:
1. Open bluetooth adapter 2. Register service with custom uuid 3. Listen on bluetooth adapter for incoming connections with this uuid 4. Read incoming data within these connections (and maybe reply) I know how to do this in Java ME, I have problems getting it work in Python. (Python on N900 should act as server, midlet on other phone as client) |
Re: ARGH! Java ME <-> Maemo Bluetooth problem, code not working, need help
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? My general hunch is that you need to make sure that something is actually listening on that port before trying to debug the client code. Using telnet is one way. |
Re: ARGH! Java ME <-> Maemo Bluetooth problem, code not working, need help
Quote:
Thank you very much. Now, I have a working setup: Nokia N900 Code:
import bluetooth Code:
"btspp://" + myRemoteDevice.getBluetoothAddress() + ":3;authenticate=true;encrypt=true;master=false"; |
Re: ARGH! Java ME <-> Maemo Bluetooth problem, code not working, need help
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. |
Re: ARGH! Java ME <-> Maemo Bluetooth problem, code not working, need help
Quote:
Previously, I programmed any bt related code only with Java ME on both sides and never had any permission problem, but I need to keep in mind that N900 programming is more like PC than phone programming :P Once again, thank you very much for your help. |
Re: [solved] ARGH! Java ME <-> Maemo Bluetooth problem, code not working, need help
good job buddy .this is awsome always wanted it:) and can it type seamlesly also ?
|
Re: [solved] ARGH! Java ME <-> Maemo Bluetooth problem, code not working, need help
Quote:
|
All times are GMT. The time now is 16:45. |
vBulletin® Version 3.8.8