Author Topic: Java/ J2ME mobile orbiter  (Read 283511 times)

tschak909

  • LinuxMCE God
  • ****
  • Posts: 5549
  • DOES work for LinuxMCE.
    • View Profile
Re: Java/ J2ME mobile orbiter
« Reply #15 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.

-Thom

ddamron

  • Alumni
  • wants to work for LinuxMCE
  • *
  • Posts: 962
    • View Profile
    • My LinuxMCE User Page
Re: Java/ J2ME mobile orbiter
« Reply #16 on: December 19, 2007, 06:33:57 am »
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

  • Administrator
  • LinuxMCE God
  • *****
  • Posts: 2428
    • View Profile
    • ago control
Re: Java/ J2ME mobile orbiter
« Reply #17 on: December 19, 2007, 05:22:56 pm »
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
« Last Edit: December 19, 2007, 08:53:21 pm by hari »
rock your home - http://www.agocontrol.com home automation

Matthew

  • Douchebag
  • Addicted
  • *
  • Posts: 567
    • View Profile
Re: Java/ J2ME mobile orbiter
« Reply #18 on: December 20, 2007, 10:09:13 pm »
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

  • NEEDS to work for LinuxMCE
  • ***
  • Posts: 1019
  • Want to work with LinuxMCE
    • View Profile
    • Smart Home Blog
Re: Java/ J2ME mobile orbiter
« Reply #19 on: December 21, 2007, 11:33:29 am »
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: http://wiki.linuxmce.org/index.php/User:Nite_man#New_setup
Russian LinuxMCE community: http://linuxmce.ru

hari

  • Administrator
  • LinuxMCE God
  • *****
  • Posts: 2428
    • View Profile
    • ago control
Re: Java/ J2ME mobile orbiter
« Reply #20 on: February 12, 2008, 08:57:47 pm »
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:
Code: [Select]
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
« Last Edit: February 12, 2008, 09:11:56 pm by hari »
rock your home - http://www.agocontrol.com home automation

hari

  • Administrator
  • LinuxMCE God
  • *****
  • Posts: 2428
    • View Profile
    • ago control
Re: Java/ J2ME mobile orbiter
« Reply #21 on: February 15, 2008, 06:10:26 pm »
first successful chat with Bluetooth_Dongle:

Code: [Select]
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>

Code: [Select]
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 - http://www.agocontrol.com home automation

JimmyGosling

  • Veteran
  • ***
  • Posts: 105
    • View Profile
Re: Java/ J2ME mobile orbiter
« Reply #22 on: February 15, 2008, 07:14:52 pm »
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
Quote
To 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

hari

  • Administrator
  • LinuxMCE God
  • *****
  • Posts: 2428
    • View Profile
    • ago control
Re: Java/ J2ME mobile orbiter
« Reply #23 on: February 15, 2008, 08:58:08 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
« Last Edit: February 15, 2008, 09:06:11 pm by hari »
rock your home - http://www.agocontrol.com home automation

Matthew

  • Douchebag
  • Addicted
  • *
  • Posts: 567
    • View Profile
Re: Java/ J2ME mobile orbiter
« Reply #24 on: February 15, 2008, 09:23:16 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

  • Administrator
  • LinuxMCE God
  • *****
  • Posts: 2428
    • View Profile
    • ago control
Re: Java/ J2ME mobile orbiter
« Reply #25 on: February 15, 2008, 09:44:36 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 - http://www.agocontrol.com home automation

colinjones

  • Alumni
  • LinuxMCE God
  • *
  • Posts: 3003
    • View Profile
Re: Java/ J2ME mobile orbiter
« Reply #26 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

hari

  • Administrator
  • LinuxMCE God
  • *****
  • Posts: 2428
    • View Profile
    • ago control
Re: Java/ J2ME mobile orbiter
« Reply #27 on: February 15, 2008, 11:16:02 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 - http://www.agocontrol.com home automation

colinjones

  • Alumni
  • LinuxMCE God
  • *
  • Posts: 3003
    • View Profile
Re: Java/ J2ME mobile orbiter
« Reply #28 on: February 16, 2008, 12:08:38 am »
Surprise surprise, nothing on the BB website other than User Quick Guides!

JimmyGosling

  • Veteran
  • ***
  • Posts: 105
    • View Profile
Re: Java/ J2ME mobile orbiter
« Reply #29 on: February 16, 2008, 04:26:57 am »
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