News:

Rule #1 - Be Patient - Rule #2 - Don't ask when, if you don't contribute - Rule #3 - You have coding skills - LinuxMCE's small brother is available: http://www.agocontrol.com

Main Menu

Java/ J2ME mobile orbiter

Started by david_a_dawson, October 19, 2007, 04:31:08 PM

Previous topic - Next topic

tschak909

the code for the phone orbiter is in the src/PlutoMO directory of the SVN checkout

http://svn.charonmedia.org/

it also uses the BD, and RA libraries to establish a socket communications layer over bluetooth, where essentially entire graphic screens are sent over the line, and keypresses are sent back. It's a very simple design.

-Thom

ddamron

I'll help testing it with by Blackberry Pearl...
;)

Dan
The only intuitive interface is the nipple.  After that it's all learned.
My other computer is your windows box.
I'm out of my mind.  Back in 5 minutes.
Q:  What's Red and smells like blue paint?

A:  Red Paint.

hari

#17
i dug into the mobile orbiter stuff these days. My incomplete picture for now is the following:

The phone opens a bluetooth rfcomm channel (probably 19 from what i have seen in the code, not verified) and is waiting for connections. The Bluetooth_Dongle device does a device inquiry loop until it finds an registered orbiter. When found it uses the BD CommandProcessor to connect and transmit the locally rendered png's to the phone, and processes keypresses received. The phone only has to display the png and send keypresses back.

edit: found a wiki page (it's getting huge ;) ): http://wiki.linuxmce.org/index.php/LinuxMCE_Orbiter_Symbian_Programmer%27s_Guide

I have no j2me experience but i simply installed the Netbeans 6.0 IDE and the Sun Java Wireless Toolkit, and found a Bluetooth example ("WTK2.5.2/apps/BluetoothDemo"). It features a server and a client mode and transfers png pictures between two phones (JSR082). Besides handling key-presses it should feature all the code necessary to build the phone side of the JavaMO. Somebody with j2me experience should be able to put this together in few time. I'll try to further research what's needed on the pluto side (BD_CommandProcessor_Java_*).

edit: the wiki page makes me assume that a port of BD for Java is needed, too.

best regards,
Hari
rock your home - [url="http://www.agocontrol.com"]http://www.agocontrol.com[/url] home automation

Matthew

Quote from: tschak909 on December 19, 2007, 05:52:24 AM
the code for the phone orbiter is in the src/PlutoMO directory of the SVN checkout

http://svn.charonmedia.org/

it also uses the BD, and RA libraries to establish a socket communications layer over bluetooth, where essentially entire graphic screens are sent over the line, and keypresses are sent back. It's a very simple design.

Do you think that code could be used as the basis to make an MD work over Bluetooth? For audio at least? Maybe a prescaled-down video stream perhaps?

nite_man

Developing the Orbiter on Java can be very interesting task especially if you take into account Google mobile platform Android. IMHO it'll dominate on the market soon.
Michael Stepanov,
My setup: [url="http://wiki.linuxmce.org/index.php/User:Nite_man#New_setup"]http://wiki.linuxmce.org/index.php/User:Nite_man#New_setup[/url]
Russian LinuxMCE community: [url="http://linuxmce.ru"]http://linuxmce.ru[/url]

hari

#20
Hi devs,

some progress from the java front:


as you can see in the picture the bluetooth comm over jsr82 works fine on the phone and in the simulator (with real bluez hardware, thanks avetana). The Bluetooth_Dongle successfully connects to the "phone".

Next steps:
1.) Wait till somebody buys me a license for the avetana stack
2.) Further implement BD in midp/cldc (http://svn.charonmedia.org/trac.cgi/browser/home/hari/javamo/com/linuxmce/javamo)
3.) Adapt Bluetooth_Dongle to lookup the rfcomm port with a sdp browse*
4.) Implement (parts?) of VMC for image display and keypress return

* should be pretty easy to do a sdp lookup with bluez in c++ and search for our service name:

Service Name: PlutoMO
Service RecHandle: 0x1000e
Service Class ID List:
  UUID 128: deadbeef-dead-beef-dead-beefdeadbeef
  "Serial Port" (0x1101)
Protocol Descriptor List:
  "L2CAP" (0x0100)
  "RFCOMM" (0x0003)
    Channel: 3
Language Base Attr List:
  code_ISO639: 0x656e
  encoding:    0x6a
  base_offset: 0x100

hope that doesn't slow down the connection process for symbian phones. But there is no way to specify the server rfcomm port in jsr82.

best regards,
Hari
rock your home - [url="http://www.agocontrol.com"]http://www.agocontrol.com[/url] home automation

hari

first successful chat with Bluetooth_Dongle:


05      02/15/08 17:53:00.274           Detected device mac: 00:09:DD:50:23:2D link quality: -77 <0xb4e16b90>
05      02/15/08 17:53:00.276           About to connect to PlutoMO. We'll suspend scanning... <0xb5617b90>
05      02/15/08 17:53:00.276           Suspending scanning... <0xb5617b90>
05      02/15/08 17:53:00.319           Inquiry complete
<0xb6619b90>
05      02/15/08 17:53:01.852           Successfully connected to the symbian application 00:09:DD:50:23:2D <0xb5617b90>
05      02/15/08 17:53:01.852           Connected to PlutoMO. <0xb5617b90>
05      02/15/08 17:53:02.012           $$$ CMD_Create_Mobile_Orbiter received for 00:09:DD:50:23:2D device $$$ <0xb5617b90>
05      02/15/08 17:53:02.012           Orbiter created for 00:09:DD:50:23:2D device <0xb5617b90>
05      02/15/08 17:53:02.415           Resuming scanning... <0xb5617b90>
05      02/15/08 17:53:02.420           Inquiry started <0xb6619b90>
01      02/15/08 17:53:02.623           Current screen: 1255.3.0 <0xb4615b90>
05      02/15/08 17:53:02.623           Repeated keys list :  <0xb4615b90>
05      02/15/08 17:53:02.623           Ready to send a picture, size 9952, reporting signal strength 0 <0xb4615b90>



root@golem9:/usr/src/home/javamo# make bluezsim
cd /home/hari/java/mpp-sdk && java -jar player.jar /usr/src/home/javamo/output/JavaMO.jad
mpowerplayer 2.0.1185
44294440
avetanaBluetooth version 1.3.17
hciOpenDevice(0)
setting HCI_DEVICE_ID to 0
Channel opened at 1
S:10
S:0
S:0
S:0
S:15
S:0
S:0
S:0
S:6
S:0
S:0
S:0
S:50
S:48
S:48
S:54
S:46
S:49
S:49
S:46
S:48
S:57
S:0
GOT:5
GOT:0
GOT:0
GOT:0
GOT:79
GOT:75
GOT:65
GOT:89
GOT:0


best regards,
Hari
rock your home - [url="http://www.agocontrol.com"]http://www.agocontrol.com[/url] home automation

JimmyGosling

Hari,
you mentioned that you were looking for a "license for the avetana stack"
can you explain to me how their licensing works with them?

this is the page that I came up with http://www.avetana-gmbh.de/avetana-gmbh/produkte/jsr82.eng.xml

according to this page
QuoteTo extend your license beyond the duration of 14 days, you can purchase a license valid for a maximum of 3 addresses for EUR 25

Does that mean it's limited to 3 addresses.  Would everyone using this need to purchase this license for their bt dongles?

thanks
My Setup: [url="http://wiki.linuxmce.org/index.php/User:JimmyGosling"]http://wiki.linuxmce.org/index.php/User:JimmyGosling[/url]

hari

#23
Quote from: JimmyGosling on February 15, 2008, 07:14:52 PM
Does that mean it's limited to 3 addresses.  Would everyone using this need to purchase this license for their bt dongles?
no. That stack is only for development. Together with it and the mpowerplayer you can emulate a real phone with jsr082 using bluez hardware. That really speeds up development as you don't have to test on the phone itself. The emulator included in Sun's wireless toolkit can't use real hardware so you can't talk to the Bluetooth_Dongle from the sim.

You could of course use the stack in another j2se java application. We don't need that because Bluetooth_Dongle is not an java app and directly communicates with the HCI device.

You don't need the stack for using the JavaMO with a real phone.

best regards,
Hari
rock your home - [url="http://www.agocontrol.com"]http://www.agocontrol.com[/url] home automation

Matthew

Quote from: hari on February 15, 2008, 08:58:08 PM
Quote from: JimmyGosling on February 15, 2008, 07:14:52 PM
Does that mean it's limited to 3 addresses.  Would everyone using this need to purchase this license for their bt dongles?
no. That stack is only for development. Together with it and the mpowerplayer you can emulate a real phone with jsr082 using bluez hardware. That really speeds up development as you don't have to test on the phone itself. The emulator included in Sun's wireless toolkit can't use real hardware so you can't talk to the Bluetooth_Dongle from the sim.

You could of course use the stack in another j2se java application. We don't need that because Bluetooth_Dongle is not an java app and directly communicates with the HCI device.

You don't need the stack for using the JavaMO with a real phone.

I would buy you the license for E25. Can I buy it and transfer it to you, rather than pay PayPal fees twice?

hari

Quote from: Matthew on February 15, 2008, 09:23:16 PM
Quote from: hari on February 15, 2008, 08:58:08 PM
Quote from: JimmyGosling on February 15, 2008, 07:14:52 PM
Does that mean it's limited to 3 addresses.  Would everyone using this need to purchase this license for their bt dongles?
no. That stack is only for development. Together with it and the mpowerplayer you can emulate a real phone with jsr082 using bluez hardware. That really speeds up development as you don't have to test on the phone itself. The emulator included in Sun's wireless toolkit can't use real hardware so you can't talk to the Bluetooth_Dongle from the sim.

You could of course use the stack in another j2se java application. We don't need that because Bluetooth_Dongle is not an java app and directly communicates with the HCI device.

You don't need the stack for using the JavaMO with a real phone.

I would buy you the license for E25. Can I buy it and transfer it to you, rather than pay PayPal fees twice?
of course. This is the address of my dongle: 00:09:DD:50:23:2D

best regards,
Hari
rock your home - [url="http://www.agocontrol.com"]http://www.agocontrol.com[/url] home automation

colinjones

Cool - great work Hari!! Don't suppose you know whether (crappy old) Blackberry's Java would handle anything you develop here? I'm guessing not, the web browser is pretty crap, and the Java seems pretty basic, also I have no idea whether it exposes any of the bluetooth functionality....

Col

hari

Quote from: colinjones on February 15, 2008, 10:19:51 PM
Cool - great work Hari!! Don't suppose you know whether (crappy old) Blackberry's Java would handle anything you develop here? I'm guessing not, the web browser is pretty crap, and the Java seems pretty basic, also I have no idea whether it exposes any of the bluetooth functionality....

Col
It needs to support MIDP2.0/CLDC1.1 and JSR082.

best regards,
Hari
rock your home - [url="http://www.agocontrol.com"]http://www.agocontrol.com[/url] home automation

colinjones

Surprise surprise, nothing on the BB website other than User Quick Guides!

JimmyGosling

Colin,
perhaps you want to list the blackberry phone model you have and see if anyone (myself included) can do some looking into it.

I don't think "crappy old" was an official model number  ;D Then again... I'm not a guru here
My Setup: [url="http://wiki.linuxmce.org/index.php/User:JimmyGosling"]http://wiki.linuxmce.org/index.php/User:JimmyGosling[/url]