I’m testing comms on an LTE network with a RAK5860 and a Hologram SIM. Using the Hologram_TCP example as a base, I want to find a way to get a consistent connection and to be able to test and retry a failed layer.
I noticed as I started running the example code that signal quality was an issue, so I ordered and installed an outside antenna. Now I have better signal strength, but the step to activate PDP context is extremely intermittent. Because of this, I put a test around that step and am now repeating the AT+QIACT=1 command in hopes of getting it established.
However, it fails all the time now. Here is an example session:
9:44:31.062 -> RAK11200 Cellular TEST With Hologram sim card!
09:44:32.995 -> Modem response after start:
09:44:32.995 -> ATI
09:44:32.995 -> Quectel
09:44:32.995 -> BG77
09:44:32.995 -> Revision: BG77LAR02A04
09:44:32.995 ->
09:44:32.995 -> OK
09:44:32.995 ->
09:44:37.018 -> BG77 power up!
09:44:37.986 -> AT+CFUN=1,0
09:44:37.986 -> OK
09:44:37.986 ->
09:44:39.915 -> AT+CPIN?
09:44:39.915 -> +CPIN: READY
09:44:39.915 ->
09:44:39.915 -> OK
09:44:39.915 ->
09:44:41.850 -> AT+QNWINFO
09:44:41.850 -> +QNWINFO: "eMTC","53005","LTE BAND 28",9310
09:44:41.850 ->
09:44:41.850 -> OK
09:44:41.850 ->
09:44:43.781 -> AT+QCSQ
09:44:43.781 -> +QCSQ: "eMTC",-67,-89,184,-9
09:44:43.781 ->
09:44:43.781 -> OK
09:44:43.781 ->
09:44:45.715 -> AT+CSQ
09:44:45.716 -> +CSQ: 23,99
09:44:45.716 ->
09:44:45.716 -> OK
09:44:45.716 ->
09:44:48.615 -> AT+CREG?
09:44:48.615 -> +CREG: 0,5
09:44:48.615 ->
09:44:48.615 -> OK
09:44:48.615 ->
09:44:50.515 -> PDP state 0
09:44:50.515 -> Attempt to activate PDP
09:44:51.515 -> AT+QIACT=1
09:44:51.515 -> ERROR
09:44:51.515 ->
09:44:51.515 -> PDP state 0
09:45:01.097 -> Attempt to activate PDP
09:45:02.063 -> AT+QIACT=1
09:45:02.063 -> ERROR
09:45:02.063 ->
09:45:02.063 -> PDP state 0
09:45:11.655 -> Attempt to activate PDP
09:45:12.654 -> AT+QIACT=1
09:45:12.654 -> ERROR
And here is the code that wraps the command:
//put a test around this to trap failure to establish PDP context
bool pdp = false;
Serial.print("PDP state ");
Serial.println(pdp);
while (pdp != true)
{
Serial.println("Attempt to activate PDP");
bg77_at("AT+QIACT=1", 1000);
if (bg77_rsp.equals("OK"))
{
pdp = true;
Serial.print("PDP state ");
Serial.println(pdp);
delay(1000);
}
else
{
Serial.print("PDP state ");
Serial.println(pdp);
delay(10000);
}
}
Any thoughts on what I should try next?