ASC1 doesn't read | Telit Cinterion IoT Developer Community
May 8, 2015 - 4:07pm, 7945 views
I try to read ASC1 in my app, input.available() always returns 0 .
GND of device is connected to GPIOs GND and TX of device is connected to GPIOs RX.
Settings of ASC1 is the same as device:
String strCOM = "comm:COM1;baudrate=115200;bitsperchar=8;stopbits=1;parity=none;autocts=off;autorts=off;blocking=on";
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","gpio"
^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","std"
^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","file","10000","a:/MY.LOG",,"off"
^SCFG: "Userware/Watchdog","0"
AT^SPOW?
^SPOW: 1,0,0
Hello,
The configuration seems to be OK.
Are you using the terminal (EHS6T)?
Have you tried to connect to TX instead of RX on the terminal's connector?
I use ASC1 as System.out on my terminal and connect to RX on terminal's connector.
Best regards,
Bartłomiej
I'm using EHST USB. I tried RX and TX also crossing TX and RX with GND.
Have you tried to issue AT commands on that interface?
Can you share your code?
If you are using InputStream the available method always returns 0. Please check the API documentation. Please try to use DataInputStream instead.
If available method returns 0, so I think the problem is here:
int bytes_available = input.available();
messageIn = new byte[bytes_available];
input.read(messageIn);
I try to read zero lenght array.
Changing InputStream to DataInputStrem doesn't help. Here's part of code:
CommConnection commConn;
DataInputStream input;
private boolean isConnected;
public boolean openConnection() {
System.out.println("Available COM-Ports: " + System.getProperty("microedition.commports"));
try {
String strCOM = "comm:COM1;baudrate=115200;bitsperchar=8;stopbits=1;parity=none;autocts=off;autorts=off;blocking=on";
commConn = (CommConnection) Connector.open(strCOM);
Logger.info("CommConnection(" + strCOM + ") opened", X.class);
Logger.info("Real baud rate: " + commConn.getBaudRate(), X.class);
input = commConn.openDataInputStream();
Logger.info("InputStream and OutputStream opened", X.class);
return isConnected = true;
} catch (IOException e) {
System.out.println(e);
}
return isConnected = false;
}
public boolean closeConnection() {
try {
if (input != null) {
input.close();
}
if (commConn != null) {
commConn.close();
}
Logger.info("connection closed", X.class);
return true;
} catch (IOException ioe) {
Logger.error(ioe);
}
return false;
}
public Vector readRS() {
String m = "";
try {
int ch = -1;
while (ch != 'D') {
ch = input.read();
if (ch >= 0) {
m += ch;
Logger.info(mmm, X.class);
}
}
Hello,
The code fragment seems OK. You use readRS() method for reading.
I expect the System.out.println("Available COM-Ports: " + System.getProperty("microedition.commports")); displays ASC1 and the connection is also established.
One small thing: you add the read character to 'm' constant while you log the 'mmm' constant - but I expect this is only in the code forum fragment not in your real code.
In such case I'd start from the beginning:
1. Check if you are able to communicate on ASC1 with PC terminal - try to issue AT commands on that interface.
2. Try the same with Java application running. Use the RS232Demo app provided with Gemalto software - you should find it in 'C:\Users\Public\Cinterion\EHS5 WTK Examples'. Just change the interface to ASC1.
3. Then try with your application.
4. And if the above is working experiment with your device connected to the Gemalto terminal.
That would help to diagnose where the problem is located: hardware, configuration, software, wiring or maybe there are some compatibility issues with the device you are connecting.
Regards,
Bartłomiej
Available COM-Ports returns:
Available COM-Ports: COM0,COM1
Of course in Logger should be "m", it was an omission in editing of original code..
I'll let you know if your sugestions helped.
Thank you for your help.
ASC1 is not responding on AT commands. I tried also with RX and TX crossed.
ASC0 is responding properly
Also RS232Demo from examples doesn't work. Could be something wrong with configuration?
How about RTS and CTS lines - have you been using them anyhow?
Please try to connect RTS and CTS lines and use HW flow control or connect RTS to CTS and disable HW flow control.
Pages