Error when trying to execute AT#SGACT=1,1

  • 1
  • Problem
  • Updated 3 years ago
Hi,

I am trying to execute the basic commands in order to start data session, but get errors. I am using Nimbelink's SkyWire GSM modem (NL-SW-GPRS) mounted via shield on Arduino Leonardo. This is the code I use for the part that gives me errors:

  ....
 Serial1.println("AT+CGDCONT?"); 
  delay(50);
  // get modem response and print to debug serial on PC via USB port
  while(PrintModemResponse() > 0);  
  Serial.println("");
  
  Serial1.println("AT#SGACT=1,1");
  delay(50);
  while(PrintModemResponse() > 0);  
  Serial.println("");
  
  Serial1.println("AT#PING=\"www.aeris.net\"");
  delay(50);
  while(PrintModemResponse() > 0);
  Serial.println("");

And this is the response:

AT+CREG?

+CREG: 0,5

Connection successful!


OK

AT+CGDCONT?

+CGDCONT: 1,"IP","neo.iot.net","",0,0


OK


AT#SGACT=1,1


ERROR


AT#PING="
www.aeris.net";

ERROR
I am clueless what to do next. HELP!
Photo of Alex Zehnbacht

Alex Zehnbacht

  • 18 Posts
  • 0 Reply Likes

Posted 3 years ago

  • 1
Photo of Bob Heckmann

Bob Heckmann, Official Rep

  • 349 Posts
  • 12 Reply Likes
Hi Alex,

Thanks for the post. We see your device registering with the correct APN. Here are some suggestions:

Terminate and re-establish the session as follows:

AT#SGACT=1,0
AT#SGACT=1,1

Also, note that in order to ping the device it must be enabled to ECHO_reply using:

AT#ICMP=2


Good luck,
Bob
Photo of Alex Zehnbacht

Alex Zehnbacht

  • 18 Posts
  • 0 Reply Likes
Bob,

Thanks again. In fact I am familiar with those commands from my research earlier digging through your answers to similar questions. I did give it a try though, and got this:

AT+CREG?
+CREG: 0,5
Connection successful!

OK

AT+CGDCONT?
+CGDCONT: 1,"IP","neo.iot.net","",0,0
OK

AT#SGACT=1,0

OK

AT#SGACT=1,1

ERROR

AT#ICMP=2

OK

AT#PING="
www.aeris.net";
ERROR
I even tried to add a 30 seconds delay for the command AT#SGACT=1,1 to try to maybe give it a longer change to obtain IP address, but no luck. What could be the reasons for the error? Any way to debug it?
Photo of Alex Zehnbacht

Alex Zehnbacht

  • 18 Posts
  • 0 Reply Likes
I activated AT+CMEE=2, to display extended verbose result codes, and now I get this:

AT#SGACT=1,1
+CME ERROR: activation failed

AT#PING="www.aeris.net";
+CME ERROR: Can not resolve name
Photo of Alex Zehnbacht

Alex Zehnbacht

  • 18 Posts
  • 0 Reply Likes
OK - I did something that activated it. Now I am stuck on pinging Aeris website. 

Here is the entire process, not that after I ping I get no error, but also no Echo Reply (I presume the reply would be transmitted by the modem back to serial just as any command does?):


--> activate first PDP context (aeris):
AT+CGACT=1,1
OK

AT#SGACT=1,1
#SGACT: 10.136.244.96
OK

--> ping Aeris website:
AT#PING="www.aeris.net";
I tries AT#PING=www.aeris.net (no "") and AT#PING=174.120.146.146,4,100,100, same result for all of them..
Photo of Bob Heckmann

Bob Heckmann, Official Rep

  • 349 Posts
  • 12 Reply Likes
Hi Alex,

I don't see a problem with your command sequence. The ping operation should re-direct to www.aeris.com but have you tried that URL rather than ".net"? Also, have you tried pinging another URL (e.g. www.google.com)?

Regards,
Bob
Photo of Alex Zehnbacht

Alex Zehnbacht

  • 18 Posts
  • 0 Reply Likes
Bob,

I tried a bunch of sites, IP addresses and various configurations of this command to no avail. Curiously, my dashboard shows lots of packets received and even some sent (see image below). I am also working with Nimbelink engineer on this problem, this is what he wrote, maybe it would make sense to you: 

"AERIS is assigning a private IP address to your device, so no matter how many times you PING the device IP address, the AERIS network will block it.  The only way to get a PING to work is if you can get an unrestricted Public Static IP address from AERIS."
Photo of Bob Heckmann

Bob Heckmann, Official Rep

  • 349 Posts
  • 12 Reply Likes
Hi Alex,

There may be some confusion about the process you're employing. The Neo connectivity service doesn't allow external devices to access devices on the network, for security reasons. If that's what you're attempting to do it won't work. However, you can ping your device from the portal, as shown in the screen shot below. Does this answer your question?

Regards,
Bob


Photo of Alex Zehnbacht

Alex Zehnbacht

  • 18 Posts
  • 0 Reply Likes
Ok, I was merely trying to recreate the example here: http://neo.aeris.com/resources/get-started/transmit-packet-data/. It could have been more helpful if the example had an explanation of the problems to expect when trying to activate the service.

Anyway, I tried pinging the device this is what I get: 

AT#SGACT=1,1
#SGACT: 10.136.255.232
OK
Pinging from the console:

5:58:03 PM$ ping 89185014080500176788
no answer from 10.136.255.232
no answer from 10.136.255.232
Assuming we can get it to be pinged somehow, what should I do to be able to use this device to connect to my server and transmit some data?
Photo of Bob Heckmann

Bob Heckmann, Official Rep

  • 349 Posts
  • 12 Reply Likes
Hi Alex,

I don't see a problem with your command sequences. One suggestion is for you to initiate a PDP context for the device so we can perform some troubleshooting on our end and capture live transactions in the logs.

Regards,
Bob
Photo of Alex Zehnbacht

Alex Zehnbacht

  • 18 Posts
  • 0 Reply Likes
Bob,

Activated, see below. I will keep the device powered as is for as long as you guys need to have it troubleshot.

AT#SGACT=1,1
#SGACT: 10.136.21.153
OK
Photo of Bob Heckmann

Bob Heckmann, Official Rep

  • 349 Posts
  • 12 Reply Likes
Hi Alex,

Just to confirm, did you execute the ICMP command? Please issue the command again, even if you did previously, and try to ping www.google.com again.

Regards,
Bob
Photo of Alex Zehnbacht

Alex Zehnbacht

  • 18 Posts
  • 0 Reply Likes
I did,  yes. Rerun the whole thing, here is a more detailed report (below). Nothing changed, and the device is still not pinging

11:37:03 AM$ ping 89185014080500176788
no answer from 10.136.28.48

AT+CREG?
+CREG: 0,5
Connection successful!
OK
--> send command to modem to get the network information:
AT+COPS?
+COPS: 0,0,"T-Mobile"
OK
--> send command to modem to check the signal quality:
AT+CSQ
+CSQ: 23,0
OK
--> send command to modem to check a GPRS Attach:
AT+CGATT?
+CGATT: 1
OK
--> in order to ping the device it must be enabled to ECHO_reply:
AT#ICMP=2
OK
--> list all the PDP contexts that are defined:
AT+CGDCONT?
+CGDCONT: 1,"IP","neo.iot.net","",0,0
OK
--> check if there were any issues with the PDP activation:
AT+CEER=?
OK
--> send command to modem to enable detailed error messages:
AT+CMEE=2
OK
--> activate first PDP context (aeris):
AT+CGACT=1,1
OK
AT#SGACT=1,1
#SGACT: 10.136.15.69
OK
--> ping Google:
AT#PING="www.google.com";
Photo of Bob Heckmann

Bob Heckmann, Official Rep

  • 349 Posts
  • 12 Reply Likes
Alex,

Our network engineers don't see anything returned from your device when they ping it. All Neo network services are up and the network team is able to ping other Neo devices currently in data sessions (yours being the only one they can't). Additionally, we've eliminated the possibility of AT command set issues, PDP context, etc., so our best advice is to consider the problem to be device specific until that possibility is eliminated.

Good luck and keep the community updated as you learn more about the issue.

Regards,
Bob
Photo of Alex Zehnbacht

Alex Zehnbacht

  • 18 Posts
  • 0 Reply Likes
Bob,

I scrapped my original equipment and rebuilt the device using Adafruit FONA 800 Arduino shield mounted on Arduino Uno. I use SIM #89185014080500176796. FONA uses SIM800 modem, so I used this manual: http://www.adafruit.com/datasheets/sim800_series_at_command_manual_v1.01.pdf

After a few hours of tinkering with the equipment and code I managed to get all the way to pinging, but hit the wall there, again. This time I get an error: +CME ERROR: operation not allowed so we might be very close. Here is the activation string:
--> send command to modem to get firmware version:
---> AT+CGMR
<--- Revision:1308B06SIM800L16

--> checking if SIM is ready to use:
---> AT+CSMINS?
<--- +CSMINS: 0,1
---> AT+CPIN?
<--- +CPIN: READY

--> network status:
---> AT+CREG?
<--- +CREG: 0,5

--> send command to modem to get the network information:
---> AT+COPS?
<--- +COPS: 0,0,"T-Mobile USA"

--> send command to modem to check the signal quality:
---> AT+CSQ
<--- +CSQ: 21,0

--> send command to modem to check a GPRS Attach:
---> AT+CGATT?
<--- +CGATT: 1

--> send command to modem to enable detailed error messages:
---> AT+CMEE=2
<--- OK

--> list all the PDP contexts that are defined:
---> AT+CGDCONT?
<--- +CGDCONT: 1,"IP","neo.iot.net","10.136.144.200",0,0

--> check if first PDP context activated:
---> AT+CGACT?
<--- +CGACT: 1,1

--> Check PDP address
---> AT+CGPADDR=1
<--- +CGPADDR: 1,"10.136.144.200"

--> Ping Aeris
---> AT+CIPPING="www.aeris.net"
<--- +CME ERROR: operation not allowed
Any ideas what to try here?

Thanks.
Photo of Dean Chang

Dean Chang

  • 2 Posts
  • 0 Reply Likes
Hi Alex,

Did you try pinging an IP address instead of Hostname.

Ex: AT+CIPPING: "8.8.8.8", 6, 32, 600, 255

Thanks
Vaibhav
Photo of Alex Zehnbacht

Alex Zehnbacht

  • 18 Posts
  • 0 Reply Likes
Tried now, got this:

---> AT+CIPPING: "8.8.8.8", 6, 32, 600, 255
<--- +CME ERROR: unknown
Photo of Vaibhav Mareddy

Vaibhav Mareddy, Official Rep

  • 24 Posts
  • 0 Reply Likes
Sorry for typo, please try the following command
AT+CIPPING="8.8.8.8", 6, 32, 600, 255

Thanks
Photo of Alex Zehnbacht

Alex Zehnbacht

  • 18 Posts
  • 0 Reply Likes
Right - didn't catch it myself, was wondering maybe parameters are wrong...

Anyway - tried it the right way, back to same:
---> AT+CIPPING="8.8.8.8", 6, 32, 600, 255
<--- +CME ERROR: operation not allowed
Photo of Vaibhav Mareddy

Vaibhav Mareddy, Official Rep

  • 24 Posts
  • 0 Reply Likes
Alex,
From the error it seems that we need to execute additional commands before doing the ping operation. We are reaching out to SIMCOM for additional details on this.

Thanks
Photo of Alex Zehnbacht

Alex Zehnbacht

  • 18 Posts
  • 0 Reply Likes
Thanks, I am looking forward for your research results.
Photo of Vaibhav Mareddy

Vaibhav Mareddy, Official Rep

  • 24 Posts
  • 0 Reply Likes
Alex,
Can you try the following sequence and check if it works:

AT+csq

OK

AT+creg?

+CREG: 0,1

 OK

AT+CSTT="aer.aerisapn.net"

 OK

AT+CIICR # activate PDP context

 OK

AT+CIFSR  # gives the ip assigned to device

AT+CIPPING="WWW.AERIS.NET"

AT+CIPPING="8.8.8.8",6,32,600,255

Photo of Alex Zehnbacht

Alex Zehnbacht

  • 18 Posts
  • 0 Reply Likes
Vaibhav,

I ran it the first time, got this:

--> send command to modem to check the signal quality:
---> AT+CSQ
<--- +CSQ: 11,0

--> network status:
---> AT+CREG?
<--- +CREG: 0,5

--> start task and select APN:
---> AT+CSTT="aer.aerisapn.net"
<--- OK

--> activate PDP context:
---> AT+CIICR
<--- +PDP: DEACT

--> give the ip assigned to device:
---> AT+CIFSR
<--- +CME ERROR: operation not allowed

--> Ping Aeris
---> AT+CIPPING="WWW.AERIS.NET";
<--- +CME ERROR: operation not allowed
Ran the second time and all other times, getting this:

--> send command to modem to check the signal quality:
---> AT+CSQ
<--- +CSQ: 11,0

--> network status:
---> AT+CREG?
<--- +CREG: 0,5

--> start task and select APN:
---> AT+CSTT="aer.aerisapn.net"
<--- +CME ERROR: operation not allowed

--> activate PDP context:
---> AT+CIICR
<--- +CME ERROR: operation not allowed

--> give the ip assigned to device:
---> AT+CIFSR
<--- +CME ERROR: operation not allowed

--> Ping Aeris
---> AT+CIPPING="WWW.AERIS.NET";
<--- +CME ERROR: operation not allowed

........
Photo of Vaibhav Mareddy

Vaibhav Mareddy, Official Rep

  • 24 Posts
  • 0 Reply Likes
Alex,
Please use the APN  "neo.iot.net" and try to establish the connection.
Photo of Alex Zehnbacht

Alex Zehnbacht

  • 18 Posts
  • 0 Reply Likes
Same effect:


--> send command to modem to check the signal quality:
---> AT+CSQ
<--- +CSQ: 22,0

--> network status:
---> AT+CREG?
<--- +CREG: 0,5

--> start task and select APN:
---> AT+CSTT="neo.iot.net"
<--- +CME ERROR: operation not allowed

--> activate PDP context:
---> AT+CIICR
<--- +CME ERROR: operation not allowed

--> give the ip assigned to device:
---> AT+CIFSR
<--- +CME ERROR: operation not allowed

--> Ping Aeris
---> AT+CIPPING="WWW.AERIS.NET";
<--- +CME ERROR: operation not allowed
Photo of Alex Zehnbacht

Alex Zehnbacht

  • 18 Posts
  • 0 Reply Likes
Somehow, I managed to activate it:

---> AT+CIPSHUT
<--- SHUT OK

---> AT+CGATT=1
<--- OK

---> AT+SAPBR=3,1,"CONTYPE","GPRS"
<--- OK

---> AT+SAPBR=3,1,"APN","neo.iot.net"
<--- OK

---> AT+SAPBR=3,1,"USER",""
<--- OK

---> AT+SAPBR=3,1,"PWD",""
<--- OK

---> AT+SAPBR=1,1
<--- OK
Then I ran this:

--> send command to modem to check the signal quality:
---> AT+CSQ
<--- +CSQ: 20,0

--> network status:
---> AT+CREG?
<--- +CREG: 0,5

--> start task and select APN:
---> AT+CSTT="neo.iot.net"
<--- OK

--> activate PDP context:
---> AT+CIICR
<--- OK

--> give the ip assigned to device:
---> AT+CIFSR
<--- 10.136.178.247

--> Ping Aeris
---> AT+CIPPING="WWW.AERIS.NET";
<--- +CIPPING: 1,"50.97.213.210",6,56
<--- +CIPPING: 2,"50.97.213.210",4,56
<--- +CIPPING: 3,"50.97.213.210",5,56
<--- +CIPPING: 4,"50.97.213.210",5,56
<--- OK
SUCCEESS! 

However when I try to ping it I get this:

8:03:31 PM$ ping 89185014080500176796
no answer from 10.136.178.247
Are we there yet?
Photo of Vaibhav Mareddy

Vaibhav Mareddy, Official Rep

  • 24 Posts
  • 0 Reply Likes
Alex,

Good to know above procedure for this particular modem, did you enable ping reply on the device  AT+CIPCTL = 1.
Photo of Alex Zehnbacht

Alex Zehnbacht

  • 18 Posts
  • 0 Reply Likes
Yes:

--> enable ping reply:
---> AT+CIPCTL = 1
<--- OK
Still getting:
10:45:35 AM$ ping 89185014080500176804
no answer from 10.136.231.176

(The IP is correct)