Fra87
Posts: 20
Joined: Sun Dec 21, 2014 5:31 pm

Java me embedded apllication don't start

Wed Feb 04, 2015 6:33 pm

Hi i have install netbean and sdk on my pc, after with putty i connect to raspberry then i go to my folder javame8 where i had unzip file oracle-jmee-8-1-rr-raspberrypi-linux-bin.zip, i go in to directory bin and then i run script sudo ./usertest.sh
Device Connections manager show me connected.
I have create project Java me embedded. Code is:

Code: Select all

/*
 * To change this license header, choose License Headers in Project Properties.
 * To change this template file, choose Tools | Templates
 * and open the template in the editor.
 */
package javameapplication1raspberry;

import javax.microedition.midlet.MIDlet;
import javax.microedition.midlet.MIDlet;
import jdk.dio.DeviceManager;
import jdk.dio.UnavailableDeviceException;
import jdk.dio.gpio.GPIOPin;
import java.io.IOException;
import java.util.logging.Level;
import java.util.logging.Logger;

/**
 *
 * @author Francesco
 */
public class JavaMEApplication1Raspberry extends MIDlet {
    
    @Override
    public void startApp() {
        try {
            System.out.println("Accessing GPIO...");
            try (GPIOPin pin = (GPIOPin)DeviceManager.open(8)) {
                System.out.println("Blinking...");
                System.out.println("HIGH");
                pin.setValue(true);
                Thread.sleep(3000);
                System.out.println("FALSE");
                pin.setValue(false);
                Thread.sleep(3000);
                System.out.println("HIGH");
                pin.setValue(true);
                System.out.println("FALSE");
                Thread.sleep(3000);
                pin.setValue(false);
                System.out.println("Done....");
            }
            } catch (UnavailableDeviceException ex) {
                Logger.getLogger(JavaMEApplication1Raspberry.class.getName()).log(
                Level.SEVERE, null, ex);
            }catch (InterruptedException | IOException ex){
                Logger.getLogger(JavaMEApplication1Raspberry.class.getName()).log(
                Level.SEVERE, null, ex);
            }
        
    }
    
    @Override
    public void destroyApp(boolean unconditional) {
    }
}
I click run but then i reiceive this message on putty:
[ERROR] [DAAPI] iso=2:StaticStorage error:8
On the console of netbeans i read accessing GPIO.. and the program don't start why?

Fra87
Posts: 20
Joined: Sun Dec 21, 2014 5:31 pm

Re: Java me embedded apllication don't start

Wed Feb 04, 2015 7:08 pm

I have try only this:

Code: Select all


/*
 * To change this license header, choose License Headers in Project Properties.
 * To change this template file, choose Tools | Templates
 * and open the template in the editor.
 */
package javameapplication1raspberry;

import javax.microedition.midlet.MIDlet;
import jdk.dio.DeviceManager;
import jdk.dio.UnavailableDeviceException;
import jdk.dio.gpio.GPIOPin;
import java.io.IOException;
import java.util.logging.Level;
import java.util.logging.Logger;
import jdk.dio.gpio.GPIOPort;

/**
 *
 * @author Francesco
 */
public class JavaMEApplication1Raspberry extends MIDlet {
    
    @Override
    public void startApp() {
      
        try {
            //System.out.println("Accessing GPIO...");
            boolean vero = true;
            GPIOPin pin2 = (GPIOPin)DeviceManager.open(2);
            GPIOPin pin4 = (GPIOPin)DeviceManager.open(4);
            GPIOPin pin6 = (GPIOPin)DeviceManager.open(6);
            GPIOPin pin8 = (GPIOPin)DeviceManager.open(8);
            GPIOPin pin10 = (GPIOPin)DeviceManager.open(10);
            GPIOPin pin12 = (GPIOPin)DeviceManager.open(12);
            GPIOPin pin14 = (GPIOPin)DeviceManager.open(14);
            GPIOPin pin16 = (GPIOPin)DeviceManager.open(16);
            GPIOPin pin18 = (GPIOPin)DeviceManager.open(18);
            GPIOPin pin20 = (GPIOPin)DeviceManager.open(20);
            pin2.setValue(vero);
            pin4.setValue(vero);
            pin6.setValue(vero);
            pin8.setValue(vero);
            pin10.setValue(vero);
            pin12.setValue(vero);
            pin14.setValue(vero);
            pin16.setValue(vero);
            pin18.setValue(vero);
            pin20.setValue(vero);
        } catch (IOException ex) {
            Logger.getLogger(JavaMEApplication1Raspberry.class.getName()).log(Level.SEVERE, null, ex);
        }          
        
    }
    
    @Override
    public void destroyApp(boolean unconditional) {
    }
}
but led (on pin 8) don't lights Why?

Fra87
Posts: 20
Joined: Sun Dec 21, 2014 5:31 pm

Re: Java me embedded apllication don't start

Thu Feb 05, 2015 11:24 am

I have use this procedure:
Hi i have try Java me embedded for raspberry pi b+ but application don't work.
I have follow this procedure:
1 Enable ssh on raspberry
2 Download unzip file oracle-jmee-8-1-rr-raspberrypi-linux-bin.zip and unzip in to folder javame8,
then i go to javame8 folder and i do chmod -R 755 appdb bin
3 Then on my windows pc i download and install Netbeans and java sdk 1.8
4 I download Java ME SDK 8 plugin: oracle-jmesdk-8-0-rr-nb-plugins.zip and unzip file in to folder Netbeans Plugin
5 With Netbeans i add plugin Tools -> Plugins->Downloaded and I have add plugin previously download
6 I download putty telnet and then i connect to raspberry. I insert username and password, then i go to folder javame8/bin and i start script: sudo ./usertest.sh. After Device Manager application show me: Device Connected
7 Then with Netbeans I create project Java Me embedded application:
Project Name: JavaMEApplication1Raspberry
JDK: 1.8
Java Me platform: Oracle Java(TM) Platform Micro Edition SDK 8.1
Device: EmbeddedExternalDevice2
8 Then i write my code i have try this:

Code: Select all

/*
 * To change this license header, choose License Headers in Project Properties.
 * To change this template file, choose Tools | Templates
 * and open the template in the editor.
 */
package javameapplication1raspberry;

import javax.microedition.midlet.MIDlet;
import jdk.dio.DeviceManager;
import jdk.dio.UnavailableDeviceException;
import jdk.dio.gpio.GPIOPin;
import java.io.IOException;
import java.util.logging.Level;
import java.util.logging.Logger;
import jdk.dio.gpio.GPIOPort;

/**
 *
 * @author Francesco
 */
public class JavaMEApplication1Raspberry extends MIDlet {
    
    @Override
    public void startApp() {
      
        try {
            //System.out.println("Accessing GPIO...");
            boolean vero = true;
            GPIOPin pin2 = (GPIOPin)DeviceManager.open(2);
            GPIOPin pin4 = (GPIOPin)DeviceManager.open(4);
            GPIOPin pin6 = (GPIOPin)DeviceManager.open(6);
            GPIOPin pin8 = (GPIOPin)DeviceManager.open(8);
            GPIOPin pin10 = (GPIOPin)DeviceManager.open(10);
            GPIOPin pin12 = (GPIOPin)DeviceManager.open(12);
            GPIOPin pin14 = (GPIOPin)DeviceManager.open(14);
            GPIOPin pin16 = (GPIOPin)DeviceManager.open(16);
            GPIOPin pin18 = (GPIOPin)DeviceManager.open(18);
            GPIOPin pin20 = (GPIOPin)DeviceManager.open(20);
            pin2.setValue(vero);
            pin4.setValue(vero);
            pin6.setValue(vero);
            pin8.setValue(vero);
            pin10.setValue(vero);
            pin12.setValue(vero);
            pin14.setValue(vero);
            pin16.setValue(vero);
            pin18.setValue(vero);
            pin20.setValue(vero);
        } catch (IOException ex) {
            Logger.getLogger(JavaMEApplication1Raspberry.class.getName()).log(Level.SEVERE, null, ex);
        }          
        
    }
    
    @Override
    public void destroyApp(boolean unconditional) {
    }
}
9 Then i have configuration permission. I go Right-click on my project and i select Properties->Application Descriptor->API Permission and i Click add:
Permission: jdk.dio.DeviceMgmtPermission
Protected Resource Name: *:*
Action Requested: open
I click ok.
10 I run my application, start EmbeddedExternalDevice2 emulator but my led on raspberry don't light. On emulator status is running. Led on my raspberry is on pin 8
I have try but application don't work.On putty i read: [ERROR] [DAAPI] iso=2:StaticStorage error:8

Why don't work?
Help me please....

-rst-
Posts: 1316
Joined: Thu Nov 01, 2012 12:12 pm
Location: Dublin, Ireland

Re: Java me embedded apllication don't start

Thu Feb 05, 2015 11:45 am

Not 100% sure how it is with the latest tools, but back in the day when I worked with ME on mobile phones you either ran it in an emulator or on the device - both at the same time not possible. Now the question is: is your application running in the emulator or on RPi? If the first (like it does sound to me), it is not a surprise the led does not light...

You have done everything along this http://docs.oracle.com/javame/8.1/get-s ... pi/toc.htm ?
http://raspberrycompote.blogspot.com/ - Low-level graphics and 'Coding Gold Dust'

Fra87
Posts: 20
Joined: Sun Dec 21, 2014 5:31 pm

Re: Java me embedded apllication don't start

Thu Feb 05, 2015 1:19 pm

-rst- wrote:Not 100% sure how it is with the latest tools, but back in the day when I worked with ME on mobile phones you either ran it in an emulator or on the device - both at the same time not possible. Now the question is: is your application running in the emulator or on RPi? If the first (like it does sound to me), it is not a surprise the led does not light...

You have done everything along this http://docs.oracle.com/javame/8.1/get-s ... pi/toc.htm ?
Yes i have follow everything......What i can do to solve this problem?

WillemD
Posts: 29
Joined: Sat Jan 31, 2015 11:25 am

Re: Java me embedded apllication don't start

Thu Feb 05, 2015 9:15 pm

I had some trouble running a LED on some PINs, other than the standard one in the JAVE ME embedded course, and found that some PINs apparently as a standard were configured for input only, not for output.
In that case, simply opening the PIN does not work, you need to set it for output first before you can change the value. I am not sure whether your error message is related to it but I suggest you give it a try:

Try:
GPIOPinConfig config1 = new GPIOPinConfig(portID, ledID, GPIOPinConfig.DIR_OUTPUT_ONLY,DeviceConfig.DEFAULT, 0, false);
LED = DeviceManager.open(config1);
using portID=0 and ledID the PIn you want to use.

Instead of
LED=DeviceManager.open(ledID)
as in your example.

Fra87
Posts: 20
Joined: Sun Dec 21, 2014 5:31 pm

Re: Java me embedded apllication don't start

Fri Feb 06, 2015 8:59 am

WillemD wrote:I had some trouble running a LED on some PINs, other than the standard one in the JAVE ME embedded course, and found that some PINs apparently as a standard were configured for input only, not for output.
In that case, simply opening the PIN does not work, you need to set it for output first before you can change the value. I am not sure whether your error message is related to it but I suggest you give it a try:

Try:
GPIOPinConfig config1 = new GPIOPinConfig(portID, ledID, GPIOPinConfig.DIR_OUTPUT_ONLY,DeviceConfig.DEFAULT, 0, false);
LED = DeviceManager.open(config1);
using portID=0 and ledID the PIn you want to use.

Instead of
LED=DeviceManager.open(ledID)
as in your example.
I have try this code:

GPIOPinConfig config1 = new GPIOPinConfig(0, 8, GPIOPinConfig.DIR_OUTPUT_ONLY,DeviceConfig.DEFAULT, 0, false);
GPIOPin pin8 = DeviceManager.open(config1);
pin8.setValue(false);
but i have this error:
TRACE: <at java.security.AccessControlException: >, startApp threw an Exception
java.security.AccessControlException:
- com/oracle/meep/security/AccessControllerInternal.checkPermission(), bci=118
- java/security/AccessController.checkPermission(), bci=1
- com/oracle/dio/gpio/impl/GPIOPinImpl.<init>(), bci=54
- com/oracle/dio/gpio/impl/GPIOPinFactory.create(), bci=6
- com/oracle/dio/gpio/impl/GPIOPinFactory.create(), bci=3
- jdk/dio/DeviceManager.openWithConfig(), bci=49
- jdk/dio/DeviceManager.open(), bci=6
- jdk/dio/DeviceManager.open(), bci=2
- javameapplication1raspberry/JavaMEApplication1Raspberry.startApp(), bci=26
- javax/microedition/midlet/MIDletTunnelImpl.callStartApp(), bci=1
- com/sun/midp/midlet/MIDletPeer.startApp(), bci=5
- com/sun/midp/midlet/MIDletStateHandler.startSuite(), bci=246
- com/sun/midp/main/AbstractMIDletSuiteLoader.startSuite(), bci=38
- com/sun/midp/main/CldcMIDletSuiteLoader.startSuite(), bci=5
- com/sun/midp/main/AbstractMIDletSuiteLoader.runMIDletSuite(), bci=130
- com/sun/midp/main/AppIsolateMIDletSuiteLoader.main(), bci=26
java.security.AccessControlException:
- com/oracle/meep/security/AccessControllerInternal.checkPermission(), bci=118
- java/security/AccessController.checkPermission(), bci=1
- com/oracle/dio/gpio/impl/GPIOPinImpl.<init>(), bci=54
- com/oracle/dio/gpio/impl/GPIOPinFactory.create(), bci=6
- com/oracle/dio/gpio/impl/GPIOPinFactory.create(), bci=3
- jdk/dio/DeviceManager.openWithConfig(), bci=49
- jdk/dio/DeviceManager.open(), bci=6
- jdk/dio/DeviceManager.open(), bci=2
- javameapplication1raspberry/JavaMEApplication1Raspberry.startApp(), bci=26
- javax/microedition/midlet/MIDletTunnelImpl.callStartApp(), bci=1
- com/sun/midp/midlet/MIDletPeer.startApp(), bci=5
- com/sun/midp/midlet/MIDletStateHandler.startSuite(), bci=246
- com/sun/midp/main/AbstractMIDletSuiteLoader.startSuite(), bci=38
- com/sun/midp/main/CldcMIDletSuiteLoader.startSuite(), bci=5
- com/sun/midp/main/AbstractMIDletSuiteLoader.runMIDletSuite(), bci=130
- com/sun/midp/main/AppIsolateMIDletSuiteLoader.main(), bci=26

Why?

WillemD
Posts: 29
Joined: Sat Jan 31, 2015 11:25 am

Re: Java me embedded apllication don't start

Fri Feb 06, 2015 11:26 am

I see you have set devicemgmt permission. You also need to set GPIOpinpermission with *:*
See lesson 2 of the Oracle JAVA course, episode titled "using the JAVA ME embedded security model".
Link here:
https://apexapps.oracle.com/pls/apex/f? ... D:144,1033

Fra87
Posts: 20
Joined: Sun Dec 21, 2014 5:31 pm

Re: Java me embedded apllication don't start

Fri Feb 06, 2015 12:31 pm

WillemD wrote:I see you have set devicemgmt permission. You also need to set GPIOpinpermission with *:*
See lesson 2 of the Oracle JAVA course, episode titled "using the JAVA ME embedded security model".
Link here:
https://apexapps.oracle.com/pls/apex/f? ... D:144,1033
I have try set GPIOpinpermission with *:* but led don't light. I have try this code:
System.out.println("Accessing GPIO...");
boolean vero = true;
GPIOPinConfig config1 = new GPIOPinConfig(0, 19, GPIOPinConfig.DIR_OUTPUT_ONLY,DeviceConfig.DEFAULT, 0, false);
GPIOPin pin19 = DeviceManager.open(config1);
pin19.setValue(true);
Emulator start status is running but led don't light on output i read only Accessing GPIO...
Why don't work i can not understand

WillemD
Posts: 29
Joined: Sat Jan 31, 2015 11:25 am

Re: Java me embedded apllication don't start

Fri Feb 06, 2015 1:58 pm

Well, look at the positive side, at least the error messages have gone :-)
Is your wiring correct, maybe the led is the wrong way around?
I suggest you check again the relevant sections of lesson1 and 2 in the course carefully.

What if you run the program against the emulator, so not against the Pi, do you then see a change in PIN value?
I downloaded from somewhere (need to google again) a predefined emulator which shows the PIN values and allows you to push buttons. You can also define your own with the custom device editor in the tools, java me menu, which then can be used to run the program against, but it is of course easier to load the work someone already did. Will do a search......

update... found the emulator here : https://github.com/SubOptimal/Raspberry ... atorDevice

Fra87
Posts: 20
Joined: Sun Dec 21, 2014 5:31 pm

Re: Java me embedded apllication don't start

Fri Feb 06, 2015 5:16 pm

WillemD wrote:Well, look at the positive side, at least the error messages have gone :-)
Is your wiring correct, maybe the led is the wrong way around?
I suggest you check again the relevant sections of lesson1 and 2 in the course carefully.

What if you run the program against the emulator, so not against the Pi, do you then see a change in PIN value?
I downloaded from somewhere (need to google again) a predefined emulator which shows the PIN values and allows you to push buttons. You can also define your own with the custom device editor in the tools, java me menu, which then can be used to run the program against, but it is of course easier to load the work someone already did. Will do a search......

update... found the emulator here : https://github.com/SubOptimal/Raspberry ... atorDevice
I found no solution so I leave the project

Fra87
Posts: 20
Joined: Sun Dec 21, 2014 5:31 pm

Re: Java me embedded apllication don't start

Sat Feb 07, 2015 10:15 am

I want make one last attemp. I want use eclipse with emulator. I have install eclipse , then i have install plugin Java me embedded sdk. Now i have a problem with permission, when i read guide there is step that i not undestand:
Accessing the Peripherals on the Raspberry Pi

There are two ways to allow access to the peripherals on the Raspberry Pi. The first is to use unsigned applications and modify the security policy file, and the second is to digitally sign the application with the appropriate API permissions requested in the JAD file.

There are two method but i didn't understand.
This is link: http://docs.oracle.com/javame/config/cl ... ugging.htm
What i do?

WillemD
Posts: 29
Joined: Sat Jan 31, 2015 11:25 am

Re: Java me embedded apllication don't start

Sat Feb 07, 2015 1:02 pm

So you were 99% ready using netbeans and then you restart with eclipse running into similar problems? I would recommend to continue with netbeans and:
1) check the wiring of your led circuit
2) try with the PI as device and see whether the LED lights up
2) try with the PI emulator as device, as available on github, check the PIN values in the emulator
3) check details steps of the oracle course to find your error, must be somewhere, be patient
Sorry can't help with eclipse, have only used Java ME with netbeans.

Fra87
Posts: 20
Joined: Sun Dec 21, 2014 5:31 pm

Re: Java me embedded apllication don't start

Sat Feb 07, 2015 6:35 pm

WillemD wrote:So you were 99% ready using netbeans and then you restart with eclipse running into similar problems? I would recommend to continue with netbeans and:
1) check the wiring of your led circuit
2) try with the PI as device and see whether the LED lights up
2) try with the PI emulator as device, as available on github, check the PIN values in the emulator
3) check details steps of the oracle course to find your error, must be somewhere, be patient
Sorry can't help with eclipse, have only used Java ME with netbeans.

I redid the whole procedure again.
Now i have write this code:

Code: Select all

  @Override
    public void startApp() {
        System.out.println("Starting...");
       
        try {
            System.out.println("1");
            GPIOPinConfig config1 = new GPIOPinConfig(0, 12, GPIOPinConfig.DIR_OUTPUT_ONLY,DeviceConfig.DEFAULT, 0, false);
            System.out.println("2");
            GPIOPin pin12 = DeviceManager.open(config1);
            System.out.println("3");
            pin12.setValue(true);
            Thread.sleep(3000);
            System.out.println("4");
            pin12.setValue(false);
            System.out.println("5");
        } catch (IOException ex) {
            Logger.getLogger(TestME8Embedded.class.getName()).log(Level.SEVERE, null, ex);
        } catch (InterruptedException ex) {
            Logger.getLogger(TestME8Embedded.class.getName()).log(Level.SEVERE, null, ex);
        }
        
    }
    
    @Override
    public void destroyApp(boolean unconditional) {
        System.out.println("Destroyed...");
    }

The output is:

Starting...
1
2
3
4
5
Destroyed...

Now run the lines of code that only the LED does not light. I have try program on my raspberry with python , i have used pin 12 and the led light.

WillemD
Posts: 29
Joined: Sat Jan 31, 2015 11:25 am

Re: Java me embedded apllication don't start

Sat Feb 07, 2015 6:56 pm

So it runs correctly with a python program and then the LED lights up? So the electronic circuit is o.k.

Also your program looks o.k.
The output you mention, it shows up on the output screen of netbeans?
Does the output also show up on the raspberry? Are you still using the EmbeddedExternalDevice2 ?

Running out of options......

Fra87
Posts: 20
Joined: Sun Dec 21, 2014 5:31 pm

Re: Java me embedded apllication don't start

Sat Feb 07, 2015 7:42 pm

WillemD wrote:So it runs correctly with a python program and then the LED lights up? So the electronic circuit is o.k.

Also your program looks o.k.
The output you mention, it shows up on the output screen of netbeans?
Does the output also show up on the raspberry? Are you still using the EmbeddedExternalDevice2 ?

Running out of options......
Yes with python program run.
The output is on putty, emulator and netbeans. I am using EmbeddedExternalDevice1.

WillemD
Posts: 29
Joined: Sat Jan 31, 2015 11:25 am

Re: Java me embedded apllication don't start

Sun Feb 08, 2015 9:00 am

I have copied your code and have run it on my Pi, only changed to PIN 16 where I had a LED connected. It works fine and the LED lights up. Using same configuration as you do with netbeans etc.

Also when I use the PI emulator on netbeans I see the pin value change. No problem.

Fra87
Posts: 20
Joined: Sun Dec 21, 2014 5:31 pm

Re: Java me embedded apllication don't start

Sun Feb 08, 2015 9:10 am

WillemD wrote:I have copied your code and have run it on my Pi, only changed to PIN 16 where I had a LED connected. It works fine and the LED lights up. Using same configuration as you do with netbeans etc.
I have try change emulator but the output is the same. I think that emulator don't comunicate with raspberry.
This is the tmp_jwc_properties.ini of EmbeddedExternalDevice1:

Code: Select all

application]
microedition.media.version = 1.2
system.default_storage = ../appdb
microedition.profiles = MEEP-8.0
xml.jaxp.subset.version = 1.0
microedition.smartcardslots = 0C,1H
microedition.locale = en-US
system.storage_root = ../appdb
javax.microedition.xmlapi.events.version = 1.0
file.separator = \
path.separator = ;

[internal]
JC_EVENTS = 2
JC_SERIAL = 2
com.sun.midp.io.multicast.joinsupported = true
com.sun.cardreader.deviceClass0 = com.sun.cardreader.PlatformCardDevice
com.sun.midp.io.j2me.comm.inputTimeout = 2000
proxy.connection.check_timeout = 300
MAX_ISOLATES = 7
LC_I18N = 2
JC_WMA = 0
system.network.reconnect = false
LC_AMS = 2
com.sun.j2me.location.CreateLandmarkStoreSupported = true
SSL_HANDSHAKE_TIMEOUT = 20000
JC_LIFECYCLE = 2
security.domainsfile = _domains.txt
RMS_CACHE_LIMIT = 3072
LC_DAAPI = 2
LC_EVENTS = 2
LC_LOWUI = 2
com.sun.j2me.location.ProximitySupported = true
SSL_SERVER_SESSION_CACHE_SIZE = 0
JC_TIME = 2
com.sun.midp.io.j2me.sms.DatagramPortOut = 12345
com.sun.javacard.version = 2.2
JC_MOBILE = 2
JC_MEMORY = 2
JC_DIO = 2
system.jam_space = 20971520
AuthenticationName = user
JC_SECURITY = 2
JC_MMA = 0
com.sun.j2me.location.DeleteLandmarkStoreSupported = true
DTLS_HANDSHAKE_TIMEOUT = 20000
security.policyfile = _policy.txt
com.sun.j2me.location.nmea.DefaultMaxage = 2000
JC_NETWORK = 2
LC_PUSH = 2
proxy.secured = no
SSL_FORBIDDEN_CIPHERS_FILTER = !RC2:!aNULL:!eNULL
JC_SYSTEMEVENT = 2
JC_SENSOR = 2
com.sun.j2me.location.CreateCategorySupported = true
com.sun.midp.io.imc.timout.push = 4000
JAVA_HEAP_SIZE = 1782580
destroyMIDletTimeout = 5000
proxy.cert_subject_dn = 
AMS_MEMORY_RESERVED_MVM = 270
com.sun.satsa.certsig = true
proxy.server_connection_port = 0
LC_PROTOCOL = 2
JC_SIMCARD = 2
AuthenticationPwd = password
AMS_MEMORY_LIMIT_MVM = -1
JC_MAINLOOP = 2
LC_CORE = 2
LC_NETWORK = 2
com.sun.satsa.store_csr_list = true
LC_MMAPI = 2
com.sun.j2me.location.nmea.DefaultTimeout = 3000
LC_SECURITY = 2
com.sun.midp.io.preferIPv6Address = false
com.sun.j2me.location.nmea.DefaultDelayState = 3000
com.sun.cardreader.deviceNumber = 1
keystore.config = platform
com.sun.satsa.keygen = true
GPS_NMEA_CONFIG_ID = -1
LC_MIDPSTRING = 2
com.sun.io.j2me.apdu.hostsandports = jcemulhost:9025,jcemulhost:9026
JC_NONE = 2
JC_FC = 0
log.tcp.port = 65000
LC_STORAGE = 2
JC_SOCKET = 2
com.sun.midp.io.imc.timout.accept = 500
destroy_midlet_on_error = true
LC_RMS = 2
com.sun.midp.io.j2me.imc.ChunkSize = 4096
SSL_CLIENT_SESSION_CACHE_SIZE = 0
JC_LOCATION = 0
com.sun.j2me.location.DeleteCategorySupported = true
JC_FILE = 2
proxy.connection_mode = server
LC_LIFECYCLE = 2
com.sun.midp.io.j2me.sms.PhoneNumber = +5551212
com.sun.midp.io.j2me.sms.DatagramPortIn = 54321
deviceaccess.configuration = C:/Users/Alex/./javame-sdk/8.1/work/EmbeddedExternalDevice1/daapi_config.json
com.sun.io.j2me.apdu.satselectapdu = 00.a4.04.00.07.a0.00.00.00.62.3.1.7F
com.sun.j2me.location.nmea.DefaultInterval = 2000
JC_PROXY = 2
JC_PERFORMANCE = 2
proxy.cert_password = 
proxy.client_connection_address = 127.0.0.1
LC_NONE = 2
com.sun.j2me.location.ResetTimeout = 10
proxy.client_connection_port = 2200
I think that some parameter isn't correct

It may be the fault of the router
Do I have to change some parameters on the router ?
Can you explain step by step as you did?

WillemD
Posts: 29
Joined: Sat Jan 31, 2015 11:25 am

Re: Java me embedded apllication don't start

Sun Feb 08, 2015 10:12 am

You either run it against the emulator (download from Github) or to the PI, not to both at the same time.
If you run it against the emulator you will see a separate tab in the AMS screen with the PIN values.
If you run it against the PI you will see the output messages both on the PI and the netbeans output screen, but you will not see the PIN values, you will only see (should see) the LED light up on the PI.

One mroe questions: are you using the PIn number of the GPIO number in your program? You should use the GPIO nr, so if the led is connected to the PIN 8 then this is GPIOnr 14. Maybe that is it?

Fra87
Posts: 20
Joined: Sun Dec 21, 2014 5:31 pm

Re: Java me embedded apllication don't start

Sun Feb 08, 2015 11:04 am

WillemD wrote:You either run it against the emulator (download from Github) or to the PI, not to both at the same time.
If you run it against the emulator you will see a separate tab in the AMS screen with the PIN values.
If you run it against the PI you will see the output messages both on the PI and the netbeans output screen, but you will not see the PIN values, you will only see (should see) the LED light up on the PI.

One mroe questions: are you using the PIn number of the GPIO number in your program? You should use the GPIO nr, so if the led is connected to the PIN 8 then this is GPIOnr 14. Maybe that is it?
I did not understand how to use the emulator downloaded from github. I run program only on the emulator,what does it mean: if you run it against the pi? When i run app then start emulator but there is only tab ams there isn't tab pin

WillemD
Posts: 29
Joined: Sat Jan 31, 2015 11:25 am

Re: Java me embedded apllication don't start

Sun Feb 08, 2015 12:47 pm

If you switch on the PI, start javame8 with sudo ./usertest and then choose in the device selector EmbeddedExternalDevice1 then you are running the program on the PI itself and the LED should light up.

If you follow the emulator instructions on github in the "usage" section to install it, then the result is that in netbeans you will not only have the three standard emulators, but also a RaspberryPI_emulatordevice in the device selector. If you right click on your project, go to properties, go to platform and then choose as the device the RaspberryPI_emulatordevice then you will get during the run a pop-up of the AMS, with a second tab showing the GPIO values etc.

Did you run your program with GPIOnr 14 ?

Fra87
Posts: 20
Joined: Sun Dec 21, 2014 5:31 pm

Re: Java me embedded apllication don't start

Sun Feb 08, 2015 5:35 pm

WillemD wrote:If you switch on the PI, start javame8 with sudo ./usertest and then choose in the device selector EmbeddedExternalDevice1 then you are running the program on the PI itself and the LED should light up.

If you follow the emulator instructions on github in the "usage" section to install it, then the result is that in netbeans you will not only have the three standard emulators, but also a RaspberryPI_emulatordevice in the device selector. If you right click on your project, go to properties, go to platform and then choose as the device the RaspberryPI_emulatordevice then you will get during the run a pop-up of the AMS, with a second tab showing the GPIO values etc.

Did you run your program with GPIOnr 14 ?
I have install emultator of github my steps are:

1 Open Custom Device Editor and import file zip RaspberryPI_EmulatorDevice-master.zip(this information into instruction "usage" there wasn't)
2 After i have select all optional package because project don't work without optional . Since this emulator have only 17 pin and pin 12 doesn't exist i have move led from pin 12 to pin 8. This is image of RaspberryPI_EmulatorDevice:
Image
3 I open Putty, connect to raspberry go to directory cd Desktop/javame/bin and start script: sudo ./usertest.sh. Device connection Manager show me Connected
4 Then i open Netbeans and click right on my project and go to properties, go to platform and then choose the device the RaspberryPI_emulatordevice
5 Start program (I have change code lines: GPIOPinConfig config1 = new GPIOPinConfig(0, 8, GPIOPinConfig.DIR_OUTPUT_ONLY,DeviceConfig.DEFAULT, 0, false); because now pin is 8 ) and start emulator but led don't lights. This is image:
Image
Image
On emulator and on Netbeans output is:
Starting...
1
2
3
true
true
4
false
5

But on putty there isn't oputput.

Why led don't lights?

WillemD
Posts: 29
Joined: Sat Jan 31, 2015 11:25 am

Re: Java me embedded apllication don't start

Sun Feb 08, 2015 6:14 pm

I can't see anything from your screenprints, too small.

The LED will not light if you use the emulator, but do you see the value of the PIN change in the emulator screen?

Did you use 14 instead of 8? Are you using the GPIOnr or the PIN number in your program?

Fra87
Posts: 20
Joined: Sun Dec 21, 2014 5:31 pm

Re: Java me embedded apllication don't start

Sun Feb 08, 2015 6:34 pm

WillemD wrote:I can't see anything from your screenprints, too small.

The LED will not light if you use the emulator, but do you see the value of the PIN change in the emulator screen?

Did you use 14 instead of 8? Are you using the GPIOnr or the PIN number in your program?
If you want see image rigth-click and open in new windows
The value of pin change from high to low. I use pin number and into program pin is 8 because pin 14 on raspberry b+ is gnd

WillemD
Posts: 29
Joined: Sat Jan 31, 2015 11:25 am

Re: Java me embedded apllication don't start

Sun Feb 08, 2015 6:44 pm

If you have connected the LED to pin 8 then this is gpio number 14 and you need to use 14 in your program, not 8.

Return to “Java”