AT^SJNET and AT^SJOTAP issues. (EHS5-E) | Telit Cinterion IoT Developer Community
March 24, 2015 - 12:28pm, 7097 views
Hi,
I created a Java midlet that simply tries to connect to a public server.
The steps I'm following are:
1.- Register my connection profile AT^SJNET
2.- Connect to the server
3.- send data
I'm registering using the AT^SJNET command:
AT^SJNET="gprs","ac.vodafone.es","vodafone","vodafone","10.32.0.1",0
The command itself works correctly and returns "OK" as expected.
However, if I try to connect to fast (I'm using SocketConnection class) I'm getting an IOException:
java.io.IOException: Profile could not be activated
After a few retries somehow the profile is finally active and I can connect.
The delay itself is a bit odd, because it even interferes with my OTAP.
If I try
AT^SJOTAP=,"http://80.37.229.215:19002/OTAP/ehs5.jad","a:/Java/jam/pqgprs",,,"gprs","ac.vodafone.es","vodafone","vodafone","10.32.0.1",
and then i run it (with AT^SJOTAP) I'm getting a not found error (due to a Timeout)
However, If I first use AT^SJNET, wait a little bit and the try the exact same AT^SJOTAP command, then it works.
To my knowledge, AT^SJOTAP, alreay registers with the given parameters, so a previous AT^SJNET should not required. Any clue what might be happening?
Is there any way to check whether the profile is active before trying to make the connection?
OK,
I managed to "fix" the issue by upgrading to
EHS5-E
REVISION 03.001
that runs a:/JRC-1.56.27.jad
For some reason the previous version (REVISION 02.000 with JRC-1.50.9.jad) just doesn't work and I can't find out why.
I don't think it's a bug so I'd apppreciate any insight on this issue because I feel a bit uneasy with this solution. I believe it must be some default parameter that might have changed
Is there any changelog from REVISION 3?
Hello,
You can check the status of the current internet connection profiles with the AT^SICI? command.
When you are using internet connections in the application it would be good to check if the module is registered to the network before starting - it can take some time for the module to register. If you don't do that this could be the reason of the problems with profile activation inside the application.
How about the network quality, antenna, SIM card - have you tested both versions in the same conditions?
Generally there should not be such difference between them like you describe.
I'd rather blame test conditions or some module configuration that might have been reset to default during the firmware update. Have you read the module configuration before the firmware update? If so it might be a good idea to compare with the current one.
Whatever the reason was it may be now difficult question to answer.
Best regards,
Bartłomiej
Hi Bartłomiej,
I'm a bit lost.
How does the AT^SICI command relate to AT^SJNET?
What I'm currently doing is just run my java midlet which will register via an AT^SJNET command with the network.
After that I'm using Java sockets to perform the communications.
This method worked just fine with earlier modems like TC45, TC65 and TC65i.
Is this the correct way to do it with EHS5? Or should I add some extra layer of Internet Service Commands like AT^SICI to ensure I can open a connection succesfully before opening my socket?
I noticed that some***** for no reason I just can't connect to the server. However, AT^SJNET return "OK" so all should be fine. I'm pretty sure this is an issue on my side, not network problems.
It appears like I'm reaching some connection limit or something similar.
Can I call AT^SJNET many *****, or that would be a problem?
Each time I reset my device (annd the modem), I run the java again, and that would call AT^SJNET. I'm thinking that I might need to check if I'm registered already, or something similar.
Sorry If I'm talking nonsense, I'm a bit lost in a sea of AT and Java commands right now.
Any advice would be greatly appreciated.
EDIT:
It seems when I can't connect, I'm getting the infamous "Profile could not be activated" message.(I know the network works just fine because the TC65i works without any issues)
Should I use the AT+COPS and/or AT+CREG commands before trying any connections?
Hello,
I've took the AT^SICI information from the Java User's Guide. I didn't use it in such context. After a short test it doesn't seem to be helpful here.
There are also Java classes BearerControl and BearerControlListener for monitoring of the data bearer state.
AT^SJNET command is for creating the profile for internet connections from Java and it will return OK if the parameters are correctly formatted. It's OK that you call this each time the application starts. You could also just pass the necessary parameters while you are opening the connection with Connector.open() instead of using this command.
When you start your application it is always good check if the module is registered to the network (using AT+CREG or AT+COPS commands) before trying to establish the internet connection.
Generally "Profile could not be activated" is thrown when the module cannot activate the profile which is done on first connection establishment and not on AT^SJNET command. In most cases this exception means the wrong parameters but in this case the parameters are probably OK. Please try to add waiting for the network.
If this does not help please try to observe how often and when this problem occurs. Do you still get this exception after the firmware update?
Best regards,
Bartłomiej
Hi,
after adding the AT+CREG, AT+COPS the situation appears to have improved a lot.
I also added a call to AT+CPBS? to ensure the SIM card is really ready to roll.
I try for up to 1min (if CREG='2') (normally 5-6 seconds and it works CREG=1 o 5)).
If I timeout or get a different CREG value (not 2,1 or 5), I go into airplane mode (AT+CFUN=4) and back to normal (AT+CFUN=1 and AT+COPS=0). After this I check again and it just works.
I'm still on the firmware ehsx_rev03.001_arn0000007.
I'll try to update to ehsx_gwinswup_rev03.001_arn0000014.
I was trying to lookup the release notes to make sure it was a necessary update, but I can't find them...
I have plenty of modems around and updating them is a bit of a pain.
Do I need to regenerate my JAVA application as well if I update?
Hi again,
It seems not all problems are gone.
Now I'm often getting a ConnectionNotFoundException with my first connection.
The description for this exception is quite misleading because it's supposed to happen "If the target of the name cannot be found, or if the requested protocol type is not supported."
The Connector.open() blocks for about 3minutes and then it returns the exception.
After that I go briefly into plane mode and back to connected and it all works like a charm.
Any clue what might be the problem?
Hello,
I think that such ConnectionNotFoundException could also happen when the signal quality is poor.
Have you checked the signal quality or at least signal strength? But on the other hand it is working well after the first fail.
It's not standard that module behaves like that.
I'd also check if module is in 2G or 3G when this problem happens and when the communication goes fine.
I think that this might be related to the network provider - I'd try to verify this behaviour with another SIM card from the different provider.
Regards,
Bartłomiej