EHS6 Rev 04.003 http connection immediately closed | Telit Cinterion IoT Developer Community
May 6, 2021 - 9:06pm, 2409 views
EHS6 Rev 04.003 http connection immediately closed
Hello
I use the new EHS6 Rev 04.003 but my software, previously running on EHS6 Rev 03.**** does mostly not connect.
I did implement the
try {
System.out.println("PdpErrCause:" + PdpErrCause);
System.out.println("APN: " + APN);
System.out.println("BEARER state change: " + state);
System.out.println("BEARER ADDR: "
+ BearerControl.GetBearerV4Addr(APN));
System.out.println("BEARER DNS1: "
+ BearerControl.GetBearerV4Dns1(APN));
System.out.println("BEARER DNS2: "
+ BearerControl.GetBearerV4Dns2(APN));
} catch (IOException e) {
e.printStackTrace();
}
Already
Getting the following output:
PdpErrCause:0
APN: webaut
BEARER state change: 2
BEARER ADDR: 0.0.0.0
BEARER DNS1: 8.8.8.8
BEARER DNS2: 0.0.0.0
connecting
PdpErrCause:0
APN: webaut
BEARER state change: 3
BEARER ADDR: 10.58.155.31
BEARER DNS1: 8.8.8.8
BEARER DNS2: 0.0.0.0
connection up
PdpErrCause:0
APN: webaut
BEARER state change: 4
java.io.IOException: cannot resolve Addr
- com.cinterion.io.BearerControl.GetBearerV4Addr(), bci=0
- networklistener.stateChanged(networklistener.java:41)
- com.cinterion.io.BearerControl$ListenThread.callListeners(), bci=207
- com.cinterion.io.BearerControl$ListenThread.run(), bci=30
closing connection
PdpErrCause:0
APN: webaut
BEARER state change: 1
java.io.IOException: cannot resolve Addr
- com.cinterion.io.BearerControl.GetBearerV4Addr(), bci=0
- networklistener.stateChanged(networklistener.java:41)
- com.cinterion.io.BearerControl$ListenThread.callListeners(), bci=207
- com.cinterion.io.BearerControl$ListenThread.run(), bci=30
connection down
Any Exception IOError in socket::open = 0
I am stock solving the problem on my own. So I seek help in the forum.
Thanks
Sincerely
Jürgen
Hello,
I assume that APN, PdpErrCause and state come from the stateChanged callback method of the listener. Connection is up and than it's closing. And later you get the exception.
Looks like there might be a problem with PDP context. Maybe the network signal quality is poor. Please check at least AT^SMONI output. Or there is a problem with subscription or APN. Please check some other SIM provider.
Is the result always the same - that there is a connection and than a disconnection of a bearer? How much time does it take to loose the connection? I can't see any attempt to establish an http connection after the bearer gets connected. The exception comes from GetBearerV4Addr() that you probably call in your listener when the bearer is already lost. Maybe there is some problem in http connection establishment code.
Best regards,
Bartłomiej
Hello
Thanks for the quick response. Your are right the information is from the BearlistenerEx.
the code does run on EHS6 Rev3 without changes perfectly. We do use diefferent providers, all worke fine with Rev3. non work with Rev4.
Fiering a couple of https request (~ 100) sometimes lead to a stable connection until we restart. Observed also more than 1000 attempts with no successful stable connection – last night until 09:00 today in the morning.
Open https connection to google
Listener gets called – connecting
Listener gets called – connection up
https reports error
Listener gets called – closing connection
At the moment I can not distinguish what error is fired first (http or listener) because of the threading we do.
I will post some connection status later today where we use the AT^SMONI output.
We did test in different geo locations with the same basic hardware (1x PLS62 and 1x EHS6 Rev4) with the same outcome.
Sincerly
Jürgen
Hello,
So it looks more like a stability issue not the configuration or subscription especially that you experience it on two different modules. Maybe it's related to hardware, antenna circuit or similar. So it could be good to monitor AT^SMONI and configure some URCs to get notified about network registration changes.
My point with time to loose the connection was to make sure if it's not the case that bearer is released because http is not started because of some other reason/error. Depending on the configured timeout the bearer is released by the module after the last socket is closed.
Is the same build used for EHS6 Rev3 and newer modules? Or you have rebuilt it with the newer libraries?
Regards,
Bartłomiej
Hello
the sdk for this revison on
https://files.c-wm.net/index.php/s/GRPgoz5m7a73c54?path=%2FJava_SDK%2Feh...
is 2 years old. Can i consider this still as the new libraries?
Thank you.
Jürgen
Hello,
The
If it sometimes works and sometimes not I'd start from making sure that the signal quality is reliable, verifying with another operator etc. If that would never work and the code was complied for EHS6 rel3 I'd try libraries update and code debugging.
As for SDK in general there should be a backward compatibility and the MIDlet compiled for older version should work for newer.
But on the other hand there may be also some changes applied to Java libraries sometimes and therefore it is recommended to use the Java libraries released for the firmware revision for which the software is dedicated when you develop the new application.
If you already use SDK for rev4 and rev4 module I don't think that Java libraries have anything to do with your issues.
Best regards,
Bartłomiej
Hi
I updated the firmware to
ati
Cinterion
EHS6
REVISION 04.013
still no change in the behavior.
try{
conn = (HttpsConnection) Connector.open(Address + ".json?auth=******************" + ";" + connProfile);
.
.
.
.
}catch (Exception e){
System.out.print("Any Exception " + e.getMessage());
this.interrupt();
}finally{
try {
if (is!=null){
is.close();
}
if (conn!=null){
conn.close();
conn=null;
}
}
fires the exception
Any Exception IOError in socket::open = 0
if I open a socketserver
try {
conn = (ServerSocketConnection) Connector.open("socket://:9002" + ";" + connProfile);
//System.out.println(conn.getLocalAddress());
} catch (IOException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
and do not close it I can run https without any problems.
if I close socketserver. connection will be droped.
Http does try to open the connection but fails imedeatly.
I do not know where to still look for the error. putting the same jar to en Rev03 EHS6 module - running as it is supposed to run.
Thanks
Jürgen
Hello,
This is strange. Are you sure that exactly the same parameters are used as 'connProfile' for both connections? Can you paste the whole string here?
Regards,
Bartłomiej
Hi Bartłomiej
sorry for my late response. other stuff keept me busy. I did figure out what is the different.
My class which handels the APN for our projects dates back to TC65i *****. The apn contains the usuall stuff needed.
example:
bearer_type=gprs;access_point=webaut;username=;password=;dns=8.8.8.8;timeout=0
On old ***** the timeout 0 was set for unlimited
until Rev4 of EH6 this worked at least without big troubles. It does not work with Rev4 and http nor https. It does work opening a socketserver:
try {
conn = (ServerSocketConnection) Connector.open("socket://:9002" + ";" + connProfile);
//System.out.println(conn.getLocalAddress());
} catch (IOException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
Changing the timeout to mor than 2 sec did solve the topic. Now the timeout is set to 200 sec and we are up and running.
We noticed in the first tests, that the older modules do handel http and https request faster.
So far so good. We are ready to use Rev4 EHS6 models.
Best regards
Jürgen
Good to hear that. In general timeout 0 should work as before. Short timeouts can be problematic like a few seconds. Then I can imagine such problems like you had. I think that at least 30 seconds would be reasonable but 200 is also fine.
Regards,
Bartłomiej