Sketch to http post to thingspeak and what I have learned so far

you are totally right, the code is almost identical, the modem(lte) is a beast diva,
the modem is actually much more stable since the new firmware (also my (denied by u-blox)sms problem has also suddenly disappeared)

About the 1024 byte : I use the MQTT lib from GitHub - 256dpi/arduino-mqtt: MQTT library for Arduino
with the Mosquitto Broker2.0.10 and i noticed that if i put data into the socket twice in a row the whole thing crashed. Since the data goes in in one go (also less overhead) it is stable.

Questions for you:

  • Do you do the communication with the modem all by yourself or do you also use the MKRNB lib? If both: Do you have problems in mixed mode?
    I have worked with modem which definitely does not work.

  • Could you explain the communication with the modem with str and sprintf a bit broader with your code?

    if (strstr(response, "+UUSORD:") != NULL) {
    delayStartTime = millis();
    sprintf(formattedCommand, "AT+USORD=%i,1024", socket);
    stage++;
    }
    if (millis() - delayStartTime > 60000) {
    stage = 0;
    }

How do you initialize the communication, how do you handle the responses etc. ?

Another hint I found out yesterday laboriously:
When changing the SIM, always cut the power from the mkr1500 or the modem will still talk half with the old SIM.

Would be happy about a little lesson from you. thx for your contributions so far, they were often enlightening....