AT commands via Java MIDlet -question | Telit Cinterion IoT Developer Community
September 16, 2016 - 1:51pm, 8130 views
Hello, this program is functional?
"AT commands via Java MIDlet - UART via Java MIDlet to AT interpreter pipe"
this is what I get. After menssage "Ready for the next command..." there is no one reaction when typing commands, wrong commands or even typing "endOfATSessionCharacter".
maybe is necesary to change something to run it or I'm doing something wrong?
also I got the following, I didnt change the code, just imported the project
ATPipeExample: created
ATPipeExample: startApp called
SerialConnection: Conected to COM0:115200
ATService: started
ATPipeExample: destroyApp called
Ready for the next command...
java.io.IOException: Stream closed
- com.sun.midp.io.BufferedInputStream.ensureOpen(), bci=11
- com.sun.midp.io.BufferedInputStream.read(), bci=8
- com.gemalto.m2m.at.ATService$ServiceThread.run(ATService.java:147)
ATService: stopped
SerialConnection: disconnected
MIDlet:com.gemalto.m2m.ATPipeExample exited
Hello,
This is a demo application so there is no guarantee it will run with every module and regardless of the configuration.
According to the log it looks like there would be some problem with the COM0 port - the application didn't manage to open the streams and closed. So please make sure that the ASC0 interface is available. Are you using some other application that opens COM0 port? Please send ATI1, AT^SCFG?, AT^SJAM=5 replies.
Regards,
Bartłomiej
Hello, this are the replies. I think COM0 is available and free. I use other ports to communicate with the modules.
ati1:
Cinterion
EHS5-E
REVISION 03.001
A-REVISION 00.002.03
OK
at^scfg?:
^SCFG: "Audio/Loop","0"
^SCFG: "Call/ECC","0"
^SCFG: "Call/Ecall/AckTimeout","5000"
^SCFG: "Call/Ecall/Callback","0"
^SCFG: "Call/Ecall/CallbackTimeout","43200000"
^SCFG: "Call/Ecall/Msd","0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000"<\r><\n>
^SCFG: "Call/Ecall/Pullmode","0"
^SCFG: "Call/Ecall/SessionTimeout","20000"
^SCFG: "Call/Ecall/StartTimeout","5000"
^SCFG: "Call/Speech/Codec","0"
^SCFG: "GPRS/AutoAttach","enabled"
^SCFG: "Gpio/mode/ASC1","rsv"
^SCFG: "Gpio/mode/DAI","std"
^SCFG: "Gpio/mode/DCD0","gpio"
^SCFG: "Gpio/mode/DSR0","rsv"
^SCFG: "Gpio/mode/DTR0","gpio"
^SCFG: "Gpio/mode/FSR","gpio"^SCFG: "Gpio/mode/PULSE","gpio"
^SCFG: "Gpio/mode/PWM","gpio"
^SCFG: "Gpio/mode/RING0","gpio"
^SCFG: "Gpio/mode/SPI","std"
^SCFG: "Gpio/mode/SYNC","gpio"
^SCFG: "Ident/Manufacturer","Cinterion"
^SCFG: "Ident/Product","EHS5-E"
^SCFG: "MEShutdown/Fso","0"
^SCFG: "MEShutdown/sVsup/threshold","0","0"
^SCFG: "MEopMode/CFUN","0","1"
^SCFG: "MEopMode/Dormancy","0","0"
^SCFG: "MEopMode/SoR","off"
^SCFG: "Radio/Band","147"
^SCFG: "Radio/Mtpl","0"
^SCFG: "Radio/OutputPowerReduction","4"
^SCFG: "Serial/Interface/Allocation","0","0"
^SCFG: "Serial/USB/DDD","0","0","0409","1E2D","0058","Cinterion Wireless Modules","EHx",""
^SCFG: "Tcp/IRT","3"
^SCFG: "Tcp/MR","10"
^SCFG: "Tcp/OT","6000"
^SCFG: "Tcp/WithURCs","on"
^SCFG: "Trace/Syslog/OTAP","0"
^SCFG: "URC/Ringline","local"
^SCFG: "URC/Ringline/ActiveTime","2"
^SCFG: "Userware/Autostart","1"
^SCFG: "Userware/Autostart/Delay","0"
^SCFG: "Userware/DebugInterface","0.0.0.0","0.0.0.0","0"
^SCFG: "Userware/DebugMode","off"
^SCFG: "Userware/Passwd",
^SCFG: "Userware/Stdout","usb3",,,,"off"
^SCFG: "Userware/Watchdog","0"
at^sjam=5
SJAM: "a:/JRC-1.56.42.jad","Java Remote Control MIDlet Suite","Cinterion","1.56.42",1
Thanks for help
Hello,
Have you checked if it is possible to communicate with the module via ASC0 before starting the MIDlet? Maybe there's a hardware problem. Please also check AT^SPOW? output if the UART interfaces are activated and if there is no power saving. Also some of the ASC0 lines are used by other interfaces according to AT^SCFG output.
Regards,
Bartłomiej
Hi,
this is what I get from AT^SPOW? : ^SPOW: 0,0,0
Actually I dont know how to comminicate with the module via ASC0, this board has only one usb input
According to SPOW output the serial interfaces are deactivated so that's the reason why the application was unable to connect to ASC0. If your board has no serial lines to connect to ASC0 you need to use some other interface (USB).
Regards,
Bartłomiej
Hi, I changed the configuration using "ehs5- e_atc_v03001" , but still the demo stop working, same error :
java.io.IOException: Stream closed
- com.sun.midp.io.BufferedInputStream.ensureOpen(), bci=11
- com.sun.midp.io.BufferedInputStream.read(), bci=8
- com.gemalto.m2m.at.ATService$ServiceThread.run(ATService.java:151)
what more I can try to make this demo works ?
Now AT^SPOW? and AT^SCFG? shows the following :
^SCFG: "Audio/Loop","0"
^SCFG: "Call/ECC","0"
^SCFG: "Call/Ecall/AckTimeout","5000"
^SCFG: "Call/Ecall/Callback","0"
^SCFG: "Call/Ecall/CallbackTimeout","43200000"
^SCFG: "Call/Ecall/Msd","0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000"<\r><\n>
^SCFG: "Call/Ecall/Pullmode","0"
^SCFG: "Call/Ecall/SessionTimeout","20000"
^SCFG: "Call/Ecall/StartTimeout","5000"
^SCFG: "Call/Speech/Codec","0"
^SCFG: "GPRS/AutoAttach","enabled"
^SCFG: "Gpio/mode/ASC1","std"
^SCFG: "Gpio/mode/DAI","std"
^SCFG: "Gpio/mode/DCD0","gpio"
^SCFG: "Gpio/mode/DSR0","rsv"
^SCFG: "Gpio/mode/DTR0","gpio"
^SCFG: "Gpio/mode/FSR","gpio"
^SCFG: "Gpio/mode/PULSE","gpio"
^SCFG: "Gpio/mode/PWM","gpio"
^SCFG: "Gpio/mode/RING0","gpio"
^SCFG: "Gpio/mode/SPI","rsv"
^SCFG: "Gpio/mode/SYNC","gpio"
^SCFG: "Ident/Manufacturer","Cinterion"
^SCFG: "Ident/Product","EHS5-E"
^SCFG: "MEShutdown/Fso","0"
^SCFG: "MEShutdown/sVsup/threshold","0","0"
^SCFG: "MEopMode/CFUN","0","1"
^SCFG: "MEopMode/Dormancy","0","0"
^SCFG: "MEopMode/SoR","off"
^SCFG: "Radio/Band","147"
^SCFG: "Radio/Mtpl","0"
^SCFG: "Radio/OutputPowerReduction","4"
^SCFG: "Serial/Interface/Allocation","0","0"
^SCFG: "Serial/USB/DDD","0","0","0409","1E2D","0058","Cinterion Wireless Modules","EHx",""
^SCFG: "Tcp/IRT","3"
^SCFG: "Tcp/MR","10"
^SCFG: "Tcp/OT","6000"
^SCFG: "Tcp/WithURCs","on"
^SCFG: "Trace/Syslog/OTAP","0"
^SCFG: "URC/Ringline","local"
^SCFG: "URC/Ringline/ActiveTime","2"
^SCFG: "Userware/Autostart","1"
^SCFG: "Userware/Autostart/Delay","0"
^SCFG: "Userware/DebugInterface","0.0.0.0","0.0.0.0","0"
^SCFG: "Userware/DebugMode","off"
^SCFG: "Userware/Passwd",
^SCFG: "Userware/Stdout","usb3",,,,"off"
^SCFG: "Userware/Watchdog","0"
^SPOW: 1,0,0
Seems like some hardware problem. Do you have other modules to test? Please also try other interface, for example USB4 or other USB.
Is it possible to send AT commands on ASC0 when the MIDlet is not running?
Regards,
Bartłomiej
I changed to usb 4 and I also have two modules, concept board ehs6 and ehs5e. Didnt work in both...
When i send comands without Midlet I can successfully see information as at^sbv or at^smoni.
Also I tried changing COM0 for another port, but didnt work.
Hello,
I've tested it with my concept board. It was possible to use USB3 without any problems. I configured it in the jad file, loaded on the module and installed the MIDlet. You only need to reconfigure the system out to some other interface.
But I was also able to reproduce your exception while using COM0 but not always - I was starting the application many *****, it was failing but after a few tries it always started successfully.
When I added hardware flow control to the connection string (";autocts=on;autorts=on") it was working all the time. I was testing it on the concept board and B80 starter kit - both have same serial to USB converters, so maybe that was the reason of failure, some line states set by the converter were causing a connection failure.
Best regards,
Bartłomiej
Hi,
thanks, so surely I have a problem with USB ports.
I changed on jad file through Application descriptor > user defined > COM0 to COM15 (this is My USB3)
^SCFG: "Userware/Stdout","usb3",,,,"off"
My modem runs using Cinterion EHSx Java Debug Modem USB#2 port: COM13
when I run the application with at^sjam=1,"a:/ATPipeExample.jad","" on Hterm connected to COM13, I cannot see no one information from the Midlet, only the common AT commands .
Opening a new Hterm window connected to port COM15 I got the following:
ATPipeExample: created
ATPipeExample: startApp called
javax.microedition.io.ConnectionNotfoundException: COM15 port not found
- com.sun.midp.io.j2me.comm.Protocol.openPrim(), bci=326
- javax.microedition.io.Connector.open(), bci=47
- javax.microedition.io.Connector.open(), bci=3
- javax.microedition.io.Connector.open(), bci=2
- com.gemalto.m2m.serial.SerialConnection.connect(SerialConnection.java:88)
- com.gemalto.m2m.ATPipeExample.startApp(ATPipeExample.java:93)
- javax.microedition.midlet.MIDletTunnelImpl.callStartApp(), bci=1
- com.sun.midp.midlet.MIDletPeer.startApp(), bci=5
- com.sun.midp.midlet.MIDletStateHandler.startSuite(), bci=261
- com.sun.midp.main.AbstractMIDletSuiteLoader.startSuite(), bci=38
- com.sun.midp.main.CldcMIDletSuiteLoader.startSuite(), bci=5
- com.sun.midp.main.AbstractMIDletSuiteLoader.runMIDletSuite(), bci=134
- com.sun.midp.main.AppIsolateMIDletSuiteLoader.main(), bci=26
How can i configure the ports in right way to can run the Midlet ?
Thanks for your help
Pages