Checking Internet Connection Status if AT^SJNET was used to Setup connection | Telit Cinterion IoT Developer Community
June 8, 2017 - 11:52am, 3743 views
Hello,
-In the AT command manual there are two ways defined to setup an Internet connection using the AT commands. The easiet of them is using the AT^SJNET which is a one line command with APN, username, password and others things and setup the connection by dial-up.
On the other hand, AT ^SICS can be used to do the same with set of commands. AT^SICI? can be used to check the connection profile status ( it returns profile id, current status of connection, number of services and local Ip address of the Internet connection profile).
I was assuming the AT^SICI? would also return the profile status, if the connection was made using AT^SJNET, but this is not the case I get OK as response from AT^SICI?.
Why this behaviour is happening or it is the expected behaviour. If that is the expected behaviour is there any way to check the internet connection if AT^SJNET was used?
Best Regards,
Umair
Hello,
AT^SJNET belongs to the commands related to Java applications. It does not establish the connection, but just configures the parameters which can be used by the Java MIDlet running on the module while establishing the connection. These parameters can also be configured with Java API inside the application.
AT^SICS configures the connection profiles for the internet services over AT commands where you can for example configure and open an http, ftp or other connection and then exchange the data with AT commands. AT^SICI is also related to that.
Regards,
Bartłomiej
Hello Mr. Bartlomiej,
Sorry ,I have misunderstood this. Which funtion then dials the connection using apn and other credentials if provided ? I have a java MIDlet running inside EHS5. First, I configure using SJNET command and then run the MIDlet and it connects to server and exchange data. I am using sockets in order to exchange information.
I am calling socketConnection = (SocketConnection)Connector.open(addressAndPort) on a specific address and port. Does the function Connector.open dials and gets network access and then connects to the server I have given.
I think using using AT^SICS and others mentioned in Concept Board:Internet Service-basics would be a bit difficult to follow and implement for such small application in my case.
Best Regards,
Umair
Hello,
If you are using the Java MIDlet you can either use SJNET command or add the parameters to your connection addressAndPort string. (SocketConnection)Connector.open(addressAndPort + ";bearer_type=gprs;access_point=apn_address;username=some_username_if_needed;password=password")
The profile activation and dialup is done in the background when the Connector.open() is called.
Generally for Java applications the Java API is recommended over AT commands for network connections.
Regards,
Bartłomiej
Hello Mr. Bartlomiej,
Thanks for your quick reply. It was really a useful information. I really appreciate that and it cleared quite a few more things as well.
Now, I want to inspect about the connection state ( whether the connection is down, up etc or suddenly it is broken) how should I do that ? Should I use BearerControl and BearerControlListener java classes as mentioned by you in this thread : https://iot-developer.thalesgroup.com/threads/atsjnet-and-atsjotap-issue... or there is some other easy mechanism can be followed ?
Best Regards,
Umair
I'd recommend you to use BearerControlListener for bearer monitoring.
Regards,
Bartłomiej
Hello Mr. Bartlomiej,
Thanks for your E-mail. I have implemented it and it is working. One more thing I would like to know is that we set bearer_type as GPRS ( in Concept Board : Internet Services-basics thread it is written that EHS6 or EHS5 which I am using only supports GPRS). Does it mean that if my network provider supports 3G, i am still not able to use it because of EHS5 restrictions ( as it only supports GPRS). If that's true it means having lower data rates only in kbps. Am I right on that ?
Best Regards,
Umair
Hello,
In this case GPRS setting only means the packet oriented mobile data service which can be 2G, 3G or 4G regarding on the module. This is on the contrary to CSD transfer - so the support for GPRS only would mean that CSD is not supported.
Regards,
Bartłomiej