BGS5 - Creating a DatagramConnection with poor signal causes hang | Telit Cinterion IoT Developer Community
September 26, 2017 - 12:42pm, 1770 views
Hi,
I am currently in the process of updating an older Java MIDlet originally written for the EGS5 module to work with the BGS5.
Most of the changes have been successful, but I am having a problem when it tries to create a new DatagramConnection object. The code in question looks like this:
System.out.println("DC Settings: " + connString ); dc = (DatagramConnection) Connector.open(connString); // This is the problem System.out.println("DC created");
An example of connString (IP, APN and login details have been replaced):
datagram://0.0.0.0:12345;bearer_type=gprs;access_point=example.net;username=user;password=password;timeout=20;reverse_dns_lookup=no
Whenever this code executes where there is a poor mobile signal (for example when AT+CSQ is less than about 8), the entire MIDlet will freeze for anything up to 2 or 3 minutes, despite the timeout being set to 20 seconds.
This also causes a couple of separate running threads alongside this to also hang, which is causing a problem when notifying an external hardware watchdog connected to one of the GPIO pins, and when flashing a status LED on another pin.
The old EGS5 didn't seem to have the problem when testing the two side by side with the same signal conditions. It would return with an error fairly quickly if it couldn't connect.
Is there any way to stop the module from hanging like this? It doesn't matter if the command itself takes a while to run, as long as it doesn't stop the other threads executing while it waits.
Thanks in advance,
David
PS - ATI1 for the module I'm using is:
Cinterion
BGS5
REVISION 01.100
A-REVISION 00.000.21
Hello,
Thank you for this report.
I have analyzed your description and searched our databases. It seems that this problem was already discovered and fixed.
However your BGS5 firmware, which is currently the latest officially released, does not contain this fix. There should not be such problem in EHS6 A-REVISION 00.000.51.
The temporary workaround is to check if the module is registered to the network before opening a connection. As in your case it also happens when the module is registered but the network signal is weak you'd need to check the signal strenght before the connection.
I suggest you to contact your local Gemalto office personally or via your distributor to report that you have faced such a problem and to ask what what could be done for you.
Best regards,
Bartłomiej
Hi Bartłomiej,
Thank you for your response, I will feed this information back and see what can be done.
Kind regards,
David