www.SonyEricsson.com ContactDeveloper World   Contact中文
Contact Member Login Contact Register Help Contact Help Search
Currently Being Moderated

On device debugging on JP-8 phones using USB

VERSION 16

Created on: Dec 17, 2007 10:30 PM by Sony Ericsson Developer Support - Last Modified:  Sep 2, 2009 8:46 AM by Sony Ericsson Developer Support

Prerequisites

  1. Computer with XP or Vista.

  2. Sony Ericsson JavaME SDK 2.5.0.2 or later >>

  3. Sony Ericsson JP-8 phone (like W910 or K850).

  4. IP address must be obtained/obtainable (TCP IP Networking must be working on computer and phone.).

 

 

Please note that the procedure has changed between JavaME SDK 2.5.0.1 and 2.5.0.2. This SDK version also works better with Windows Vista.

 

 

Configure the phone

Follow the steps below to configure the JP-8 phone for on device debugging.

 

Enable Java developer mode on the phone from the service menu.

  • Enter the service menu, click: -> * <- <- * <- *

  • Click: Service settings -> Java developer mode -> On

 

Enable USB network on the phone.

  • Main menu -> Settings -> Connectivity -> USB -> USB network -> USB network type -> Via computer

 

Enable USB default mode (optional)

  • Main menu -> Settings -> Connectivity -> USB -> USB default mode -> Phone mode

 

The phone is now redy to connect via USB.

 

Configure Windows XP

Once the phone is connected to the USB port and the drivers are installed there will be a emulated network card installed in the system. All debug traffic will go over this network card in JP-8 instead of over a COMM port in JP-7.

 

Connect the USB cable

  • Windows will try to aquire an IP address.

  • Version 2.5.0.2 of the SDK will try to assign an address to the phone.

 

Start debugging

Now that the configuration is complete one can connect to the device to start debugging.

 

Connect with the connection proxy

  • Open the Sony Ericsson ConnectionProxy application.

  • If not automatically connected, click Settings and select the interface Sony Ericsson Device xxx USB Ethernet Emulation (NDIS 5)

 

 

  • Click Connect

 

 

Use the device explorer

Once connected with the connection proxy you can start the device explorer. With the device explorer you can:

  • See installed applications.

  • Install applications.

  • Start and stop applications.

  • Get debug output from System.out.print from running applications.

 

 

Debug on device using NetBeans or Eclipse

Once connected with the connection proxy it is possible to debug on device / step in the code from NetBeans or Eclipse. Be sure to select the appropriate "debug on device"-profile for the target phone. For JP-8 phones please select Sony Ericsson SDK 2.5.0.1 beta for the Java(TM) ME Platform(Debug On-Device) and the phone Sony Ericsson JP-8.

 

On Device Debugging with Wireless Internet Connection

If you are trying to debug while using wireless internet connection(GPRS, UMTS, etc..) and it fails, do as follows:

 

On your device enter the following menus:

  • Main menu -> Settings -> Connectivity -> Internet settings

  • Change 'Allow local conn' to 'Off'

 

If you want to do the same thing for 'Streaming'.

  • Main menu -> Settings -> Connectivity -> Streaming settings

  • Change 'Allow local conn' to 'No'

 

Those setting will make it possible to use internet access and SDK Connection Proxy at the same time.

 

 

Still not working?

Please try the steps below one by one if the connection is not working.

 

  1. Unplug the phone and restart the connection proxy before inserting the phone.

  2. Reinitialize the USB network on the phone.

  3. Make sure there is a valid network connection to the phone.

  4. If not try configuring the firewall settings for the network card.

 

Reinitialize the USB network on the phone.

  • Re-enable the USB network on the phone. Simply re-select "Via computer" to re-enable the USB network.

 

Make sure there is a valid network connection to the phone.

  • Open a terminal window.

  • Check the IP address of the network card. The address should be something like 192.168.8.8 / 255.255.255.0

 

  • Try pinging the broadcast address for this network card. In this case: 192.168.8.255. The phone should answer to this call and reveal it's own address.

 

If the phone does not respond to the broadcast address there might be a firewall issue.

 

Configure firewalls for the device

If there is no connection to the device there is probably a packet filter of some sort installed on this network interface. In order for debugging to work, the network card must be able to send and receive ICMP and TCP traffic.

For more information on firewall issues on JP-8 and symbian phones see this article:

http://developer.sonyericsson.com/community/docs/DOC-1694

 

 

ICS issues during connecting

Internet Connection Sharing (ICS) can be used together with Connection Proxy. Make sure that ICS is started BEFORE the Connection Proxy.

 

The Connection Proxy will in this case run without the ipprovider. See below for more information about the Connection Proxy running without the ipprovider.

 

 

If you have started the Connection Proxy before the ICS, the Connection Proxy starts the ipprovider, that continues to run for the entire pc session. You then have to manually shutdown the ipprovider. You do this by either restart the pc or find the process named java.exe in the 'Task manager' and kill it. (A bit ugly! The problem is that there could be several processes with that name.)

 

After shutting down the ipprovider, start the ICS, then start the Connection Proxy.

 

Proxy Disconnects even if device is still connected

Cause The proxy has a supervision to detect a removed device. If response from device is too slow the proxy may disconnect a working connection.

 

Solution Disable the supervision by changing the property ping.time to 0 in the C:\SonyEricsson\JavaME_SDK_CLDC\OnDeviceDebug\lib\sdkme.properties file.

 

In newer SDK versions the property timeout.ping can be increased instead.

 

Can not connect and "Safely Remove Hardware" icon shows up in the notification area

When connecting the device to the computer via the usb cable, the "Safely Remove Hardware icon" shows up in the notification area and on the device the text Do not remove the USB-cable before you have closed the program on the computer.

 

Cause If the device starts when it is connected to a computer, it assumes that it should be started in file transfer mode.

 

Solution Unplug the device. Restart it. Then connect it again. It should now show a list of possible modes to connect it in. Choose phone mode.

 

The device never gets an IP, it's stuck in 'Acquiring network address'

When connecting the device to the computer via the usb-cable the local interface never gets an IP. It just keeps trying to acquire an internet address without succeeding.

 

Cause The IPProvider tries to 'give out' IP-addresses on a subnet which is already used by the local computer and a collision(another internet host already has this IP) occurs.

 

Solution Update the file ipprovider.settings to start using another subnet. The file can be found here:

\SonyEricsson\JavaME_SDK_CLDC\OnDeviceDebug\lib\

 

 

 

Running Connection Proxy without a ipprovider

 

 

This is only valid for JavaME SDK 2.5.0.1 and does NOT work on Java ME SDK 2.5.0.2!

 

 

Every time a device is plugged in, the user has to wait a little while before the device is ready to be used with Connection proxy. The reason for this is that a network interface needs to be created and an IP-address has to be assigned to that interface. Since there is no DHCP server on the computer, a link local address will eventually be generated. This can take up to one minute. To speed things up, the user can assign a static IP-address to the network interface that belongs to the device. This is how to assign a static IP-address to a network interface:

1. Connect device with USB cable to the computer.

2. Choose 'Phone Mode'

3. Wait!

The device now starts to search for an IP-address for the new network interface. On Windows XP without Ipprovider this usually takes about a minute and on Vista or 'XP with Ipprovider' it's almost immediate. (There is a tray-icon indicating 'work in progress..') There is a small trick (see below) to make this faster but use it at your own risk!! (Only useful for Windows XP without Ipprovider.)

Wait until you receive an IP for the interface. You can start a command prompt for this and enter 'ipconfig /all'. Look for the IP Configuration with the Description starting with some thing like: Sony Ericsson Device 117 USB Ethernet Emulation (NDIS 5)

4. When the new network interface is ready, open a command prompt and type in ipconfig and press Enter.

A new local area connection has been added. For example:

 

Ethernet adapter Local Area Connection 8:

      Connection-specific DNS Suffix  . :

      IP Address. . . . . . . . . . . . : 169.254.66.37

      Subnet Mask . . . . . . . . . . . : 255.255.0.0

      Default Gateway . . . . . . . . . :

 

Remember the IP-address (in this case 169.254.66.37).

5. Now go to Windows "Start"->"Settings"->"NetworkConnections"

6. Select the network interface that belongs to the device. Right click and choose "Properties".

7. Select "Internet Protocol(TCP/IP)" and press the "Properties" button.

8. Select "Use the following IP Address" and type in the IP-address you've got in step 3 (in this example "169.254.66.37"). "Subnet mask" should be 255.255.0.0.

9. Press OK.

Next time the device is reconnected, it will just take a few seconds before the device is ready to be used with Connection proxy. Be aware that this static IP-address is only valid for this specific network interface. If switching to another device, a new network interface will be created and the same procedure has to be done to the new interface. Theoretically, the user can use any IP-address as the static address. The reason ipconfig was used in this example is that we want to make sure that the IP-address is really available, i.e no other devices already uses it.

 

Resource Monitor

The resource monitor is a fairly useful tool which can be used control the amount of memory etc your aplication uses. Keep in mind that a valid data account to be chosen in the phone.

 

Further reading

Have more questions? Look in the forums.

You can browse for more articles and postings on this subject using the tags below, such as this one.

Average User Rating
(6 ratings)
My Rating:




er4z0r  says:

When debugging an application, that connects to the internet it will try to do this via USB-Networking and not via the Wireless Network . This can be problematic, if you want to debug things like. connectivity via UMTS/GPRS etc.

 

Can this be changed?

raju_ajmera  says:

Even after following above document, my w910i does not connect to connectionproxy. It keeps showing alert telling USB settings and steps to turn on java developer mode (this has already been done). Any help?

raju_ajmera  says in response to er4z0r:

Still it does not work...

tjabodog tjabodog  says:

The Connection Proxy still works like crap on Vista.

2.5.0 is still the only version I been able to connect with.

Halaseh Halaseh  says:

I have been trying to connect my SE K850, but unfortunately it is not working Can you please help me, this is a description of my case:

1. When I connect my phone I get limited or no connectivity to the phone.

2. The device ip is 169.254.51.81, and it is replying when I ping it.

3. The firewall is off.

4. The ip detection is set to automatic i.e. no static IP is used.

5. I am using Sony Ericsson SDK 2.5.0.2.

6. When I try to connect to the interface using the Connection Proxy I get this message:

 

"The proxy could not connect to the handset.

 

The local interface was found, but wasn't ok. Perhaps it hasn't acquired an ip yet. If so please wait and try again!

 

If the local interface has acuired an local link address (169.254.xxx.xxx) it might be faster to unplug the handset and plug it again!

 

if you have set the ip address yourself  (static ip), please undo it and let it be set automatically!

 

For more connectivity issues refer to:

http://developer.sonyericsson.com/community/java_me"

 

Do you have any suggestions?

Sony Ericsson Developer Support Sony Ericsson Developer Support  says in response to Halaseh:

When using SDK 2.5.0.2 the IP configuration have changed. There is now a DHCP server that gives the phone an IP address in the 192.168.x.x range.

 

/gustav

Vampire0  says:

I don't get it running.

I have a W760i prototype. I try to get ODB running from within IntelliJ IDEA.

I have done all that is described here. I was able to connect the connection proxy with the phone. I can use ejava without problems.

But if I try to start on-device debuging from within IDEA, it starts to upload the MIDlet after a while, then it hangs a huge amount of time at 99% and then comes

 

 

The application itself is ok and runs fine if installed manually on the phone

paladino paladino  says:

Hi,

I have different behavior:

If not connected to internet (by wifi) the connection proxy fails because port taken by another @,

If connected to internet (by wifi) the computer hang (reboot needed due to lost of internet connection)

I followed the procedure here above followed: at step "Connect the USB cable" no address is negotiated

 

WXP, SDK 2.5.0.2, SE K850i

Attilio

vpaoli vpaoli  says in response to Sony Ericsson Developer Support:

I am using Sony Ericsson SDK 2.5.0.2. too.

The device ip is 169.254.20.31

I have the same error message as  Mr. Halaseh.

 

"IP address in the 192.168.x.x range"  is  the property of SDK 2.5.0.2. How it info can help me ? 

 

After following above instruction -   "Solution Update the file ipprovider.settings to start using another subnet.

The file can be found here: \SonyEricsson\JavaME_SDK_CLDC\OnDeviceDebug\lib\" , my SE K660i  does not connect to connectionproxy.

 

gladiola gladiola  says:

I am using Sony Ericsson SDK 2.5.0.2 and also tried version 2.5.0.3. After installing Windows service pack 3, emulator won't connect or seems to recognize the phone anymore. I can get an ip address and nothing has changed except when trying to connect from emulator the phone is not finding. I'm getting the "make sure the device is connected" error. This is after installing sp3. I have a machine that still has windows service pack 2 and works ok there. Has anyone seen this issue? Could this be a compatibility issue and if so, which ones? Help is appreciated.

Chris Greening Chris Greening  says:

Ok, I've got the same problem that er4z0had, but his solution has dissappeared.

 

I've got the phone connected but I need to debug an internet connection - how do I do this. i'd really appreciate some help.

More Like This

  • Retrieving data ...