SIM7600 and ThingSpeak, unable to publish

  • Dear all,
    I nearly got SIM7600, MQTT and Thingspeak working. But I am not able to get the public working.
    This is my basic syntax:
    The module returns OK status, so so far so good. But no data shows up in my channel.
    The weird things is I use the same Topic and message structure as with my SIM7080 module, and that works. Any suggestions?

    My last part of the code :

    String payload="channels/"+ String(ChannelId)+"/publish";
    int Payload_Length;

    SerialAT.println("AT+CMQTTTOPIC=0,"+String(Payload_Length)); // Input the publish message topic <client_index,req_length>

    Serial.print(" ");
    Serial.println ("AT+CMQTTPAYLOAD=0,"+String(Payload_Length));
    SerialAT.println("AT+CMQTTPAYLOAD=0,"+String(Payload_Length)); // input the publish message body <client_index,req_length>

    SerialAT.println("AT+CMQTTPUB=0,0,60,0,0"); // Publish a message to the server <client_id,qos,pub_timeout,retained>

  • Hello @HappyUser

    according to the documentation, after sending the AT+CMQTTTOPIC=0,<length> command the modem answers with a prompt > after which the topic can be sent. However your code seems to sent the topic right after issuing the command. Maybe try adding a short delay?

    Same for the payload - try with a short delay before sending the payload.

    If that solves the issue then of course the proper solution would be to actually wait for the prompt (or error) with a timeout.


  • @felmue And indeed, I needed to add a delay before sending the payload. I had hoped that it would be necessary (in order to speed up he process of waking up, sending and going to sleep).