SIM5320A - AT Commands not working with specific sketch?

Hi all,

I'm working on trying to send sensor values over 3G to a Thingspeak channel I have set up, using a SIM5320A shield. Now, I was able to successfully send some random values using the shield in an independent sketch, but now that I am trying to use real sensor values, my AT commands have crashed. When I send the AT+CHTTPSSTART command in the new sketch, it doesn't return anything. The exact same code returns OK in the original sketch. This is the function I am using to send the request:

void fonaSendHTTP() {
    int i=0;
    for(i=0;i<3 && !fona.sendCheckReply(F("AT+CHTTPSSTART"), F("OK"), 10000);i++);
    for(i=0;i<3 && !fona.sendCheckReply(F("AT+CHTTPSOPSE=\"\",443,2"), F("OK") ,10000);i++);
    for(i=0;i<3 && !fona.sendCheckReply(F("AT+CHTTPSSEND=87"),F(">"), 10000);i++);
    for(i=0;i<3 && !fona.sendCheckReply(GETStrArr, F("OK"), 10000);i++);
    for(i=0;i<3 && !fona.sendCheckReply(F("AT+CHTTPSCLSE"),F("OK"),10000);i++);

This is what I get:

The weird thing is that the shield starts flashing the blue LED fast, meaning there is data being transmitted.


After some debugging I have found that for SOME reason, running these exact commands in setup() allows them to happen normally, but if the commands are run in loop(), there is no communication over the softwareserial that belongs to the shield.

This is a really weird bug, if anyone can help it would be much appreciated.

You'd have to post your entire code in order to get help