System.out on ASC0 / Flash file system | Thales IoT Developer Community
April 6, 2014 - 1:18am, 7053 views
Hi,
With the out-of-the-box configuration of the concept board the Userware/Stdout (the setting that controls where System.out calls are redirected to) is set to this.
^SCFG: "Userware/Stdout","null",,,,"off"
When developing in Eclipse, I typically run my Midlet from Eclipse (connecting my PC to the USB port) and I see the output just fine.
I was taking my Concept board onto the field and wanted to see the logging through the ASC0 USB interface or log it on the flash drive.
I tried executing the following command (the comand itself returned OK)
AT^SCFG="Userware/Stdout","ASC0"
But when hooking up a serial monitor on the virtual COM port provided by ASC0 I didn't see output while I know my Midlet was doing System.out calls
I then tried to write the System.out to the flash drive using the following config:
AT^SCFG="Userware/Stdout","FILE",65535,"MY.LOG","buffered"
But that command resulted in ERROR.
Any ideas how to redirect the System.out calls to ASC0 or the Flash filesystem ?
Hi,
are you absolutely sure that your midlet was running? It can be checked with at^sjam=5. Did you start the midlet manually with ^sjam or used autostart? Forwarding stdout to asc0 generally doesn't cause any issues. Try double checking your setup and if you're stuck, please provide the answers to commands:
ATI1
AT^SCFG?
AT&V
AT^SJAM=4
AT^SJAM=5
Please note also that when the interface is reserved for stdout, AT command interpreter is not accessible on it, so you have to use USB (or ASC1 if it's possible in your setup) for inputting AT commands.
When saving stdout to FFS remember to pass number of bytes in quotes and specify drive path:
AT^SCFG="Userware/Stdout","FILE","10000","a:/MY.LOG","buffered"
Then you can read the content using AT^SFSA.
Regards
Jedrzej
I was using auto-start. (Added Oracle-MIDlet-Autostart: 1).
Midlet was running because it was communicating with a backend that I monitored.
I'll send the output of the AT commands later today.
I wasn't using any AT commands inside the midlet.
For FFS I might have forgotten the "a:/" prefix and the quotes around the number. I'll verify that tonight.
Thanks for the quick response !
I got the FSS logging working now. Thx.
It only worked with buffer 10000. If I specified 20000,30000 or 65535 it threw an error.
Also the filename only worked with "MY.LOG". If I used a longer name like "MYLOG.LOG" it didn't work.
Here;s a dump of my config:
^SYSLOADING
^SYSSTART
ATI1
Cinterion
EHS6
REVISION 02.000
A-REVISION 00.000.03
OK
AT^SCFG?
^SCFG: "Call/ECC","0"
^SCFG: "GPRS/AutoAttach","enabled"
^SCFG: "Gpio/mode/ASC1","std"
^SCFG: "Gpio/mode/DAI","gpio"
^SCFG: "Gpio/mode/DCD0","std"
^SCFG: "Gpio/mode/DSR0","std"
^SCFG: "Gpio/mode/DTR0","std"
^SCFG: "Gpio/mode/FSR","gpio"
^SCFG: "Gpio/mode/HSIC","rsv"
^SCFG: "Gpio/mode/PULSE","gpio"
^SCFG: "Gpio/mode/PWM","gpio"
^SCFG: "Gpio/mode/RING0","std"
^SCFG: "Gpio/mode/SPI","rsv"
^SCFG: "Gpio/mode/SYNC","gpio"
^SCFG: "Ident/Manufacturer","Cinterion"
^SCFG: "Ident/Product","EHS6"
^SCFG: "MEShutdown/Fso","0"
^SCFG: "MEopMode/SoR","off"
^SCFG: "Radio/Band","511"
^SCFG: "Radio/OutputPowerReduction","4"
^SCFG: "Serial/Interface/Allocation","1","1"
^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","on"
^SCFG: "Userware/Passwd",
^SCFG: "Userware/Stdout","asc0",,,,"off"
^SCFG: "Userware/Watchdog","0"
OK
AT&V
ACTIVE PROFILE:
E1 Q0 V1 X0 &C1 &D2 &S0 \Q3
S0:000 S3:013 S4:010 S5:008 S6:000 S7:060 S8:000 S10:002
+CBST: 71,0,1
+CRLP: 61,61,78,6
+CR: 0
+CMEE: 0
OK
AT^SJAM=4
^SJAM: "http://192.168.244.2:65310/HelloWorldMidlet3Test.jad","HelloWorldMidlet3 MIDlet Suite","MIDlet Suite Vendor","1.0.0",1,50029,0
^SJAM: "http://192.168.244.2:51600/HelloWorldMidlet2.jad","HelloWorldMidlet2 MIDlet Suite","MIDlet Suite Vendor","1.0.0",0,4464,0
^SJAM: "a:/JRC-1.50.9.jad","Java Remote Control MIDlet Suite","Cinterion","1.50.9",1,669007,0
OK
AT^SJAM=5
^SJAM: "http://192.168.244.2:65310/HelloWorldMidlet3Test.jad","HelloWorldMidlet3 MIDlet Suite","MIDlet Suite Vendor","1.0.0",1
^SJAM: "a:/JRC-1.50.9.jad","Java Remote Control MIDlet Suite","Cinterion","1.50.9",1
OK
For testing the logging I simply started my cinterion board by plugging in the USB cable in ASC0, starting HTERM on the virtual COM and pressing the ON button on the board. I didn't see any output (115200,8,N,1 CTS flow control).
Hi,
your SW configuration seems to be right. Maybe it's something with the driver of serial-USB converter? Does ASC0 work at all? Are you able to communicate with the module over AT commands via ASC0 when "Userware/Stdout" is set to "null"?
Regarding redirecting stdout to file: try setting stdout to null and then change settings back to file.
edit:
I've got another thought - maybe your ASC selector isn't configured properly? Please refer to following thread:
http://developer.gemalto.com/threads/concept-board-rx-tx
Regards
Jedrzej
OK. re-setting to AT^SCFG="Userware/Stdout","null",,,,"off" in between changes fixed the stdout to file.Mystery solved....
Now for the ASC0. Currently pin 3 and 4 are up.
If I connect the cable to ASC0 I get a virtual COM on my PC (COM9) that I can connect to using HTERM. I cannot execute AT commands.
I was under the assumption that this wouldn't work because that would only work through the USB connection. (connector labeled USB).
The goal to use ASC0 was not to send AT commands but to simply capture the output of my app. Are you saying that I should be able to send the same AT commands like I do via the USB connector ?
Found the issue ..... how embarrassing .... power saving :)
I was experimenting with the sleep modes and I must have de-activated the UARTs (ASC0 and ASC1) at some point with AT^SPOW.
Turning it back on again with AT^SPOW=1,0,0 solved the issue. I now have logging on ASC0 and a better understanding of the system so please ignore my previous incorrect assumptions.
Is there a way to dump all configuration settings (including the power savings) in one shot ? I was comparing the output of another board (using SCFG) but that didn't include the power save settings.
Anyway .. .thx for your patience with this....
I'm glad to read that you managed to get it working. According to Java userguide Power Saving "limits access to the serial interface (RS-232-API) and the GPIO pins."
There is no single command to read all module's settings at once
Regarding above question: Are you saying that I should be able to send the same AT commands like I do via the USB connector?
Yes, on both ASC0 and ASC1 AT command interface may be used, but you have to remember to properly setup AT^SCFG="Serial/Interface/Allocation". Remember also that when stdout is redirected AT commands can't be issued on corresponding interface - the same when CommConnection is used.
Regards
Jedrzej
Can I output something to ASC0 / 1 from USB Ports with AT Commands somehow also for testing?
Hello,
Generally you can't because you get the replies for AT commands on the same port.
But if you for example redirect the System.out for Java applications to some interface there will be "SYSTEM.OUT STARTED" displayed on that interface and if you switch it off there will be "SYSTEM.OUT STOPPED".
If you'd like to send some data from USB port to ASC0/1 you'd have to implement such functionality in the Java MIDlet.
Regards,
Bartłomiej