🤖Have you ever tried Chat.M5Stack.com before asking??😎
    M5Stack Community
    • Categories
    • Recent
    • Tags
    • Popular
    • Users
    • Groups
    • Search
    • Register
    • Login

    SIM7080 connect to Thingspeak -->Solved

    Modules
    2
    4
    2.8k
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • H
      HappyUser
      last edited by HappyUser

      Any suggestions :
      I get a connection error after SMCONN despite having an IP address assigned to the SIM7080 module.
      Standard example works smoothly.
      Thanks

          device.sendMsg("AT+CNACT=0,1\r\n");
          readstr = device.waitMsg(200);
          log(readstr);
      
          device.sendMsg("AT+CNACT?\r\n");
          readstr = device.waitMsg(200);
          log(readstr);
      
          //device.sendMsg("AT+SMCONF=\"URL\",\"broker.emqx.io\",\"1883\"\r\n");
          device.sendMsg("AT+SMCONF=\"URL\",\"mqtt3.thingspeak.com\",\"1883\"\r\n"); // mqtt:// mqtt3.thingspeak.com
      
          readstr = device.waitMsg(1000);
          log(readstr);
      
          device.sendMsg("AT+SMCONF=\"KEEPTIME\",60\r\n");
          readstr = device.waitMsg(1000);
          log(readstr);
      
          device.sendMsg("AT+SMCONF=\"CLEANSS\",1\r\n");
          readstr = device.waitMsg(1000);
          log(readstr);
      
          //device.sendMsg("AT+SMCONF=\"CLIENTID\",\"simmqtt\"\r\n");
          device.sendMsg("AT+SMCONF=\"CLIENTID\",\"*************\"\r\n");
      
          readstr = device.waitMsg(1000);
          log(readstr);
      
          device.sendMsg("AT+SMCONN\r\n");
          readstr = device.waitMsg(5000);
          log(readstr);
      
      1 Reply Last reply Reply Quote 0
      • felmueF
        felmue
        last edited by

        @HappyUser

        you most likely are missing parameters USERNAME and PASSWORD for a successful connection.

        Thanks
        Felix

        GPIO translation table M5Stack / M5Core2
        Information about various M5Stack products.
        Code examples

        H 1 Reply Last reply Reply Quote 0
        • H
          HappyUser @felmue
          last edited by

          @felmue

          Thank you and indeed. The works :
          device.sendMsg("AT+CNACT=0,1\r\n");
          readstr = device.waitMsg(200);
          log(readstr);

              device.sendMsg("AT+CNACT?\r\n");
              readstr = device.waitMsg(200);
              log(readstr);
          
              //device.sendMsg("AT+SMCONF=\"URL\",\"broker.emqx.io\",\"1883\"\r\n");
              device.sendMsg("AT+SMCONF=\"URL\",\"mqtt3.thingspeak.com\",\"1883\"\r\n"); // mqtt:// mqtt3.thingspeak.com
          
              readstr = device.waitMsg(1000);
              log(readstr);
          
              device.sendMsg("AT+SMCONF=\"KEEPTIME\",60\r\n");
              readstr = device.waitMsg(1000);
              log(readstr);
          
              device.sendMsg("AT+SMCONF=\"CLEANSS\",1\r\n");
              readstr = device.waitMsg(1000);
              log(readstr);
          
              //device.sendMsg("AT+SMCONF=\"CLIENTID\",\"simmqtt\"\r\n");
              device.sendMsg("AT+SMCONF=\"CLIENTID\",\"&&&&&&&&\"\r\n");
              readstr = device.waitMsg(1000);
              log(readstr);
          
              device.sendMsg("AT+SMCONF=\"USERNAME\",\"&&&&&&&\"\r\n");
              readstr = device.waitMsg(1000);
              log(readstr);
          
              device.sendMsg("AT+SMCONF=\"PASSWORD\",\"&&&&\"\r\n");
              readstr = device.waitMsg(1000);
              log(readstr);
          
              device.sendMsg("AT+SMCONN\r\n");
              readstr = device.waitMsg(5000);
              log(readstr);
          
              if(readstr.indexOf("ERROR") == -1)
              {
                  Serial.println("We have a MQTT connection");
                  
                  break;
              }
              else {Serial.println("SMCONN ERROR " );}
          
          1 Reply Last reply Reply Quote 0
          • felmueF
            felmue
            last edited by

            Hello @HappyUser

            I am glad to read that it works for you now and that you are again a happy user. And thank you for reporting back.

            Thanks
            Felix

            GPIO translation table M5Stack / M5Core2
            Information about various M5Stack products.
            Code examples

            1 Reply Last reply Reply Quote 0
            • First post
              Last post