Xinyuan-LilyGO / T-SIM7600X

114 stars 38 forks source link

MQTTS 8883 #49

Open droidblastnz opened 1 year ago

droidblastnz commented 1 year ago

Please provide some example code using the Tiny_GSM library to connect to a cloud MQTT broker on 8883.

Example in the library will not connect to a private xxxxx.s1.eu.hivemq.cloud 8883 but connects to broker.hivemq.com 1883 without issue.

// MQTT details
const char* broker = "broker.hivemq.com";
boolean mqttConnect() {
  SerialMon.print("Connecting to ");
  SerialMon.print(broker);

  // Connect to MQTT Broker
  boolean status = mqtt.connect("GsmClientTest");  //works 1883

  // Or, if you want to authenticate MQTT:
  // boolean status = mqtt.connect("GsmClientName", "mqtt_user", "mqtt_pass"); //doesnt worj 8883 with user/password added

  if (status == false) {
    SerialMon.println(" fail");
    return false;
  }
  SerialMon.println(" success");
  mqtt.publish(topicInit, "GsmClientTest started");
  mqtt.subscribe(topicLed);
  return mqtt.connected();
}
droidblastnz commented 1 year ago

Revised code yet to test keen for advice on this below....?

Added SPIFFS #include "SPIFFS.h

Downloaded isrgrootx1.pem You can download the root certificate here 1.2k. This will create a file called “isrgrootx1.pem”, which you can use as “Server Certificate”.

Created a data dir and copied the isrgrootx1.pem which is C:\Users\ddd\Documents\Arduino\SIM7600\5.5502\data\isrgrootx1.pem

Used ESP32 Sketch Data Upload to add the isrgrootx1.pem to the ESP32

Serial port COM6
Connecting........_____....._____....._____....._____....._____.....___
Chip is ESP32D0WDQ5 (revision 1)
Features: WiFi, BT, Dual Core, 240MHz, VRef calibration in efuse, Coding Scheme None
MAC: f4:cf:a2:aa:2a:18
Uploading stub...
Running stub...
Stub running...
Changing baud rate to 921600
Changed.
Configuring flash size...
Auto-detected Flash size: 4MB
Compressed 1507328 bytes to 4832...
Wrote 1507328 bytes (4832 compressed) at 0x00290000 in 0.1 seconds (effective 204383.4 kbit/s)...
Hash of data verified.

Leaving...
Hard resetting via RTS pin...

boolean mqttConnect() //boolean true or false
{
  SerialMon.print("Connecting to ");
  SerialMon.println(broker);
  SerialMon.println("");  //add CR

  // Connect to MQTT Broker

  String serverAddress = "xxxxxxxx.s1.eu.hivemq.cloud";
  int serverPort = 8883;
  int keepAliveSeconds = 60;
  int cleanSession = 1;
  String username = "xxxxxx";
  String password = "xxxxxx";

  // Set SSL version and authentication mode
  modem.sendAT("+CSSLCFG=\"sslversion\",0,4"); //Set the SSL version of the first SSL context
  if (!modem.waitResponse(1000)) {
    Serial.println("CSSLCFG command failed");
    return false;
  }

  modem.sendAT("+CSSLCFG=\"authmode\",0,1"); //Set the authentication mode(verify server) of the first SSL context
  if (!modem.waitResponse(1000)) {
    Serial.println("CSSLCFG command failed");
    return false;
  }

  // Set server root CA
  modem.sendAT("+CSSLCFG=\"cacert\",0,\"isrgrootx1.pem\""); //Set the server root CA of the first SSL context
  if (!modem.waitResponse(1000)) {
    Serial.println("CSSLCFG command failed");
    return false;
  }

  // Start MQTT service and activate PDP context
  modem.sendAT("+CMQTTSTART");
  if (!modem.waitResponse(1000)) {
    Serial.println("MQTT START command failed");
    return false;
  }

  // Acquire a client
  modem.sendAT("+CMQTTACCQ=0,\"Client1\",1,4"); //1 MQTT server with SSL/TLS 4 MQTT version 3.1.1
  if (!modem.waitResponse(1000)) {
    Serial.println("MQTT ACCQ command failed");
    return false;
  }

  // Set the first SSL context to be used in the SSL connection
  modem.sendAT("+CMQTTSSLCFG=0,0");
  if (!modem.waitResponse(1000)) {
    Serial.println("MQTT SSLCFG command failed");
    return false;
  }

  // Connect to MQTT server
  String mqttConnectCommand = "AT+CMQTTCONNECT=0,\"tcp://" + serverAddress + ":" + String(serverPort) + "\"," + String(keepAliveSeconds) + "," + String(cleanSession) + ",\"" + username + "\",\"" + password + "\"";
  boolean status = SerialAT.print(mqttConnectCommand);

  if (status == false) {
    SerialMon.println("MQTT Connect fail");
    return false;
  }
  SerialMon.println("MQTT Connect success");

  //If GRPS Connected
  if ((status == true) && modem.isGprsConnected()) { 
  }

  mqtt.subscribe(topicLed);                                                     
  return mqtt.connected();
}

Output

22:49:11.310 -> +IPADDR: xxx.xxx.xxx.xxx
22:49:11.357 -> 
22:49:11.357 -> OK
22:49:11.403 -> Connecting to xxxxxxxx.s1.eu.hivemq.cloud
22:49:11.403 -> 
22:49:11.546 -> File: /isrgrootx1.pem
22:49:11.592 -> AT+CSSLCFG="sslversion",0,4
22:49:11.592 -> 
22:49:11.639 -> OK
22:49:11.639 -> AT+CSSLCFG="authmode",0,1
22:49:11.639 -> 
22:49:11.639 -> OK
22:49:11.639 -> AT+CSSLCFG="cacert",0,"isrgrootx1.pem"
22:49:11.685 -> 
22:49:11.685 -> ERROR
22:49:11.685 -> AT+CMQTTSTART
22:49:11.685 -> 
22:49:11.685 -> +CMQTTSTART: 23
droidblastnz commented 1 year ago

Update using tera term to write isrgrootx1.pem cert directly then list which now I can see the cert file on the module.

AT+CCERTDOWN="isrgrootx1.pem", 1939
AT+CCERTLIST

Added due to 09:00:28.533 -> +CMQTTSTART: 23

// Start MQTT service release the client first
  modem.sendAT("+CMQTTREL=0");
  if (!modem.waitResponse(1000)) {
    Serial.println("CMQTTREL RELEASE command failed");
    return false;
  }

  // Stop MQTT service
  modem.sendAT("+CMQTTSTOP");
  if (!modem.waitResponse(1000)) {
    Serial.println("CMQTTSTOP STOP command failed");
    return false;
  }

  // Start MQTT service and activate PDP context
  modem.sendAT("+CMQTTSTART");
  if (!modem.waitResponse(1000)) {
    Serial.println("CMQTTSTART START command failed");
    return false;
  }

which is returning these logs

10:39:37.199 -> AT+IPADDR
10:39:37.199 -> 
10:39:37.199 -> +IPADDR: 100.67.101.191
10:39:37.245 -> 
10:39:37.245 -> OK
10:39:37.245 -> 1
10:39:37.245 -> AT+NETOPEN?
10:39:37.292 -> 
10:39:37.292 -> +NETOPEN: 1
10:39:37.292 -> 
10:39:37.292 -> OK
10:39:37.339 -> AT+IPADDR
10:39:37.339 -> 
10:39:37.339 -> +IPADDR: xx.xx.xx.xx
10:39:37.385 -> 
10:39:37.385 -> OK
10:39:37.385 -> Connecting to xxx.s1.eu.hivemq.cloud
10:39:37.431 -> 
10:39:37.431 -> AT+CNSMOD
10:39:37.431 -> 
10:39:37.431 -> ERROR
10:39:37.431 -> AT+CSSLCFG="sslversion",0,4
10:39:37.431 -> 
10:39:37.431 -> OK
10:39:37.479 -> AT+CSSLCFG="authmode",0,1
10:39:37.479 -> 
10:39:37.479 -> OK
10:39:37.479 -> AT+CCERTLIST
10:39:37.479 -> 
10:39:37.526 -> +CCERTLIST: "isrgrootx1.pem"
10:39:37.573 -> 
10:39:37.573 -> OK
10:39:37.573 -> AT+CSSLCFG="cacert",0,"isrgrootx1.pem"
10:39:37.573 -> 
10:39:37.573 -> OK
10:39:37.619 -> AT+CMQTTREL=0
10:39:37.619 -> 
10:39:37.619 -> OK
10:39:37.619 -> AT+CMQTTSTOP
10:39:37.666 -> 
10:39:37.666 -> +CMQTTSTOP: 0
10:39:37.666 -> 
10:39:37.666 -> OK
10:39:37.712 -> AT+CMQTTSTART
10:39:37.712 -> 
10:39:37.712 -> +CMQTTSTART: 0
10:39:37.760 -> 
10:39:37.760 -> OK
10:39:37.760 -> AT+CMQTTACCQ=0,"Client1",1,4
10:39:37.760 -> 
10:39:37.760 -> OK
10:39:37.808 -> AT+CMQTTSSLCFG=0,0
10:39:37.808 -> 
10:39:37.808 -> OK
10:39:37.808 -> AT+CMQTTCONNECT=0,"tcp://xxx.s1.eu.hivemq.cloud",8883,60,1,"xxx","xxx"
10:39:38.789 -> MQTT Connect success
10:39:38.789 -> AT+NETOPEN?
10:39:38.836 -> 
10:39:38.836 -> +CMQTTCONNECT: 0,12
10:39:38.883 -> 
10:39:38.883 -> ERROR
10:39:38.883 -> AT+CIPRXGET=4,0
10:39:38.929 -> 
10:39:38.929 -> +CIPRXGET: 4,0,0
10:39:38.929 -> 
10:39:38.929 -> OK
10:39:38.976 -> AT+CIPCLOSE?
10:39:38.976 -> 
10:39:38.976 -> +CIPCLOSE: 0,0,0,0,0,0,0,0,0,0
10:39:39.023 -> 
10:39:39.023 -> OK
10:39:39.116 -> AT+CGREG?
10:39:39.162 -> 
10:39:39.162 -> +CGREG: 0,1
10:39:39.162 -> 
10:39:39.162 -> OK
10:39:39.162 -> MQTT NOT CONNECTED! 
10:39:39.162 -> Disconnecting from: xxx.s1.eu.hivemq.cloud
10:39:39.208 -> AT+CIPSEND=0,2

Error is +CMQTTCONNECT: 0,12 which is invalid parameter??

droidblastnz commented 1 year ago

Revised code

Result error is +CMQTTCONNECT: 0,12 which ‘invalid parameter’

10:39:37.199 -> AT+IPADDR
10:39:37.199 -> 
10:39:37.199 -> +IPADDR: xx.xx.xx.xx
10:39:37.245 -> 
10:39:37.245 -> OK
10:39:37.245 -> 1
10:39:37.245 -> AT+NETOPEN?
10:39:37.292 -> 
10:39:37.292 -> +NETOPEN: 1
10:39:37.292 -> 
10:39:37.292 -> OK
10:39:37.339 -> AT+IPADDR
10:39:37.339 -> 
10:39:37.339 -> +IPADDR: xx.xx.xx.xx
10:39:37.385 -> 
10:39:37.385 -> OK
10:39:37.385 -> Connecting to xxx.s1.eu.hivemq.cloud
10:39:37.431 -> 
10:39:37.431 -> AT+CNSMOD
10:39:37.431 -> 
10:39:37.431 -> ERROR
10:39:37.431 -> AT+CSSLCFG="sslversion",0,4
10:39:37.431 -> 
10:39:37.431 -> OK
10:39:37.479 -> AT+CSSLCFG="authmode",0,1
10:39:37.479 -> 
10:39:37.479 -> OK
10:39:37.479 -> AT+CCERTLIST
10:39:37.479 -> 
10:39:37.526 -> +CCERTLIST: "isrgrootx1.pem"
10:39:37.573 -> 
10:39:37.573 -> OK
10:39:37.573 -> AT+CSSLCFG="cacert",0,"isrgrootx1.pem"
10:39:37.573 -> 
10:39:37.573 -> OK
10:39:37.619 -> AT+CMQTTREL=0
10:39:37.619 -> 
10:39:37.619 -> OK
10:39:37.619 -> AT+CMQTTSTOP
10:39:37.666 -> 
10:39:37.666 -> +CMQTTSTOP: 0
10:39:37.666 -> 
10:39:37.666 -> OK
10:39:37.712 -> AT+CMQTTSTART
10:39:37.712 -> 
10:39:37.712 -> +CMQTTSTART: 0
10:39:37.760 -> 
10:39:37.760 -> OK
10:39:37.760 -> AT+CMQTTACCQ=0,"Client1",1,4
10:39:37.760 -> 
10:39:37.760 -> OK
10:39:37.808 -> AT+CMQTTSSLCFG=0,0
10:39:37.808 -> 
10:39:37.808 -> OK
10:39:37.808 -> AT+CMQTTCONNECT=0,"tcp://xxx.s1.eu.hivemq.cloud",8883,60,1,"xxx","xxx"
10:39:38.789 -> MQTT Connect success
10:39:38.789 -> AT+NETOPEN?
10:39:38.836 -> 
10:39:38.836 -> +CMQTTCONNECT: 0,12
10:39:38.883 -> 
10:39:38.883 -> ERROR
10:39:38.883 -> AT+CIPRXGET=4,0
10:39:38.929 -> 
10:39:38.929 -> +CIPRXGET: 4,0,0
10:39:38.929 -> 
10:39:38.929 -> OK
10:39:38.976 -> AT+CIPCLOSE?
10:39:38.976 -> 
10:39:38.976 -> +CIPCLOSE: 0,0,0,0,0,0,0,0,0,0
10:39:39.023 -> 
10:39:39.023 -> OK
10:39:39.116 -> AT+CGREG?
10:39:39.162 -> 
10:39:39.162 -> +CGREG: 0,1
10:39:39.162 -> 
10:39:39.162 -> OK
10:39:39.162 -> MQTT NOT CONNECTED! 
10:39:39.162 -> Disconnecting from: xxx.s1.eu.hivemq.cloud
10:39:39.208 -> AT+CIPSEND=0,2

Q. Do I need to send a AT+CMQTTWILLTOPIC and then AT+CMQTTWILLMSG prior to the AT+CMQTTCONNECT?

Added

 // Set the first SSL context to be used in the SSL connection
  modem.sendAT("+CMQTTSSLCFG=0,0");
  if (!modem.waitResponse(1000)) {
    Serial.println("CMQTTSTART SSLCFG command failed");
    return false;
  }

  // Send AT+CMQTTWILLTOPIC=0,20 test/temperature
  modem.sendAT("+CMQTTWILLTOPIC=0,28,\"test/temperature\"");
  if (!modem.waitResponse(1000)) {
    Serial.println("CMQTTWILLTOPIC command failed");
    return false;
  }

  // Send AT+CMQTTWILLMSG=0,17,1  
  modem.sendAT("+CMQTTWILLMSG=0,2,1");
  if (!modem.waitResponse(1000)) {
    Serial.println("CMQTTWILLMSG command failed");
    return false;
  }

Result

  // Send AT+CMQTTWILLTOPIC=0,20 test/temperature
  modem.sendAT("+CMQTTWILLTOPIC=0,28,\"test/temperature\"");
  if (!modem.waitResponse(1000)) {
    Serial.println("CMQTTWILLTOPIC command failed");
    return false;
  }

  // Send AT+CMQTTWILLMSG=0,17,1  
  modem.sendAT("+CMQTTWILLMSG=0,2,1");
  if (!modem.waitResponse(1000)) {
    Serial.println("CMQTTWILLMSG command failed");
    return false;
  }

Result

11:11:38.110 -> +NETOPEN: 1
11:11:38.110 -> 
11:11:38.158 -> OK
11:11:38.158 -> AT+IPADDR
11:11:38.158 -> 
11:11:38.158 -> +IPADDR: xx.xx.xx.xx
11:11:38.206 -> 
11:11:38.206 -> OK
11:11:38.206 -> Connecting to xxx.s1.eu.hivemq.cloud
11:11:38.252 -> 
11:11:38.252 -> AT+CNSMOD?
11:11:38.252 -> 
11:11:38.252 -> +CNSMOD: 0,8
11:11:38.252 -> 
11:11:38.252 -> OK
11:11:38.299 -> AT+CSSLCFG="sslversion",0,4
11:11:38.299 -> 
11:11:38.299 -> OK
11:11:38.299 -> AT+CSSLCFG="authmode",0,1
11:11:38.299 -> 
11:11:38.346 -> OK
11:11:38.346 -> AT+CCERTLIST
11:11:38.346 -> 
11:11:38.346 -> +CCERTLIST: "isrgrootx1.pem"
11:11:38.395 -> 
11:11:38.395 -> OK
11:11:38.440 -> AT+CSSLCFG="cacert",0,"isrgrootx1.pem"
11:11:38.440 -> 
11:11:38.440 -> OK
11:11:38.440 -> AT+CMQTTREL=0
11:11:38.440 -> 
11:11:38.487 -> OK
11:11:38.487 -> AT+CMQTTSTOP
11:11:38.487 -> 
11:11:38.487 -> +CMQTTSTOP: 0
11:11:38.533 -> 
11:11:38.533 -> OK
11:11:38.533 -> AT+CMQTTSTART
11:11:38.580 -> 
11:11:38.580 -> +CMQTTSTART: 0
11:11:38.580 -> 
11:11:38.580 -> OK
11:11:38.628 -> AT+CMQTTACCQ=0,"Client1",1,4
11:11:38.628 -> 
11:11:38.628 -> OK
11:11:38.628 -> AT+CMQTTSSLCFG=0,0
11:11:38.628 -> 
11:11:38.674 -> OK
11:11:38.674 -> AT+CMQTTWILLTOPIC=0,28,"test/temperature"
11:11:38.674 -> 
11:11:38.674 -> +CMQTTWILLTOPIC: 0,12
11:11:38.722 -> 
11:11:38.722 -> ERROR
11:11:38.770 -> AT+CMQTTWILLMSG=0,2,1
11:11:38.770 -> 
11:11:38.770 -> >CMQTTWILLMSG command failed
11:11:39.844 -> AT+CGREG?
11:11:39.844 -> 
11:11:39.844 -> OK
11:11:40.874 -> Network disconnected
11:11:40.874 -> AT+CSQ
11:11:40.874 -> 
11:11:40.874 -> +CSQ: 24,99
11:11:40.874 -> 
11:11:40.874 -> OK
11:11:40.922 -> AT+CGREG?
11:11:40.922 -> 
11:11:40.922 -> +CGREG: 0,1
11:11:40.922 -> 
11:11:40.968 -> OK
11:11:40.968 -> AT+CGREG?
11:11:40.968 -> 
11:11:40.968 -> +CGREG: 0,1
11:11:41.014 -> 
11:11:41.014 -> OK
11:11:41.014 -> Network re-connected
11:11:41.014 -> AT+NETOPEN?

My error is

11:11:38.674 -> AT+CMQTTWILLTOPIC=0,28,"test/temperature"
11:11:38.674 -> 
11:11:38.674 -> +CMQTTWILLTOPIC: 0,12
11:11:38.722 -> 
11:11:38.722 -> ERROR

Added so whats wrong with the format/syntax? Documentation says...

AT+CMQTTWILLTOPIC=<client_index>,<req_length>

AT+CMQTTWILLTOPIC=0,10
>0123456789
Response
><
input data here>
OK
or
+CMQTTWILLTOPIC: <client_index>,<err>
ERROR
or
ERROR
  modem.sendAT("+CMQTTWILLTOPIC=0,25,\"test/temperature\"");
  if (!modem.waitResponse(1000)) {
    Serial.println("CMQTTWILLTOPIC command failed with /");
    return false;
  }

  delay(1000);

  // Send AT+CMQTTWILLMSG=0,25 test/temperature then 29
  modem.sendAT("+CMQTTWILLMSG=0,2,1,\"29\"");
  if (!modem.waitResponse(1000)) {
    Serial.println("CMQTTWILLMSG command failed");
    return false;
  }
droidblastnz commented 1 year ago

Update to this issue

Revised and minimized the code

  // Show current network system mode
  modem.sendAT("+CNSMOD?");
  if (!modem.waitResponse(1000)) {
    Serial.println("CNSMOD network system mode command failed");
    return false;
  }

  // Set SSL version and authentication mode
  modem.sendAT("+CSSLCFG=\"sslversion\",0,4"); //ALL Set the SSL version of the first SSL context
  if (!modem.waitResponse(1000)) {
    Serial.println("CSSLCFG SSLVersion command failed");
    return false;
  }

  modem.sendAT("+CSSLCFG=\"authmode\",0,1"); //Server authentication. It needs the root CA of the serverSet the authentication mode(verify server) of the first SSL context
  if (!modem.waitResponse(1000)) {
    Serial.println("CSSLCFG Authmode command failed");
    return false;
  }

  // Set server root CA
  modem.sendAT("+CSSLCFG=\"cacert\",0,\"isrgrootx1.pem\""); //Set the server root CA of the first SSL context
  if (!modem.waitResponse(1000)) {
    Serial.println("CSSLCFG CACert command failed");
    return false;
  }

  modem.sendAT("+CMQTTSSLCFG?");
  modem.waitResponse(1000);

  // Connect to MQTT server
  modem.sendAT("+CMQTTCONNECT=0,\"tcp://xxx.s1.eu.hivemq.cloud:8883\",60,1,\"xxx\",\"xxx\"");
  if (!modem.waitResponse(120000)) {
    Serial.println("CMQTTCONNECT command failed");
    return false;
  }

  modem.sendAT("+CMQTTCONNECT?");
  modem.waitResponse(1000);

  delay(5000); //Allow sufficient time for the SSL handshake to finish
  Serial.println("done!");

Logs

18:03:34.127 -> AT+NETOPEN?
18:03:34.174 -> 
18:03:34.174 -> +NETOPEN: 1
18:03:34.174 -> 
18:03:34.174 -> OK
18:03:34.221 -> AT+IPADDR
18:03:34.221 -> 
18:03:34.221 -> +IPADDR: xx.xx.xx.xx
18:03:34.268 -> 
18:03:34.268 -> OK
18:03:34.268 -> Connecting to xxx.s1.eu.hivemq.cloud
18:03:34.268 -> 
18:03:34.268 -> AT+CNSMOD?
18:03:34.316 -> 
18:03:34.316 -> +CNSMOD: 0,8
18:03:34.316 -> 
18:03:34.316 -> OK
18:03:34.361 -> AT+CSSLCFG="sslversion",0,4
18:03:34.361 -> 
18:03:34.361 -> OK
18:03:34.361 -> AT+CSSLCFG="authmode",0,1
18:03:34.361 -> 
18:03:34.361 -> OK
18:03:34.408 -> AT+CSSLCFG="cacert",0,"isrgrootx1.pem"
18:03:34.408 -> 
18:03:34.408 -> OK
18:03:34.408 -> AT+CMQTTSSLCFG=0,0
18:03:34.408 -> 
18:03:34.455 -> OK
18:03:34.455 -> AT+CMQTTSSLCFG?
18:03:34.455 -> 
18:03:34.455 -> +CMQTTSSLCFG: 0,0
18:03:34.502 -> +CMQTTSSLCFG: 1,
18:03:34.548 -> 
18:03:34.548 -> 
18:03:34.548 -> OK
18:03:34.548 -> AT+CMQTTCONNECT=0,"tcp://xxx.s1.eu.hivemq.cloud:8883",60,1,"xxx","xxx"
18:03:34.594 -> 
18:03:34.594 -> OK
18:03:39.600 -> done!
18:03:39.600 -> AT+CIPRXGET=4,0
18:03:39.600 -> 
18:03:39.600 -> +CIPRXGET: 4,0,0
18:03:39.649 -> 
18:03:39.649 -> OK
18:03:39.649 -> AT+CIPCLOSE?
18:03:39.649 -> 
18:03:39.694 -> +CIPCLOSE: 0,0,0,0,0,0,0,0,0,0
18:03:39.694 -> 
18:03:39.694 -> OK
18:03:39.838 -> AT+CGREG?
18:03:39.838 -> 
18:03:39.838 -> +CGREG: 0,1
18:03:39.887 -> 
18:03:39.887 -> OK
18:03:39.887 -> MQTT NOT CONNECTED! 
18:03:39.887 -> Disconnecting from: xxx.s1.eu.hivemq.cloud
18:03:39.887 -> AT+CIPSEND=0,2

Command AT+CMQTTCONNECT returns ok but not +CMQTTCONNECT: 0,0 as per the manual?

AT+CMQTTCONNECT=0,"tcp://hooleeping.com:8883",60,1
OK
+CMQTTCONNECT: 0,0
20:22:47.382 -> 
20:22:47.382 -> 
20:22:47.382 -> OK
20:22:47.382 -> AT+CMQTTCONNECT=0,"tcp://xxx.s1.eu.hivemq.cloud:8883",60,1,"xxx","xxx"
20:22:47.428 -> 
20:22:47.428 -> OK
20:22:47.428 -> AT+CMQTTCONNECT?
20:22:47.428 -> 
20:22:47.428 -> +CMQTTCONNECT: 0
20:22:47.476 -> +CMQTTCONNECT: 1
20:22:47.523 -> 
20:22:47.523 -> OK
20:22:52.554 -> done!
droidblastnz commented 1 year ago

Using this code


#define uS_TO_S_FACTOR      1000000ULL  /* Conversion factor for micro seconds to seconds */
#define TIME_TO_SLEEP       30          /* Time ESP32 will go to sleep (in seconds) */

#define UART_BAUD           115200

#define MODEM_TX            27
#define MODEM_RX            26
#define MODEM_PWRKEY        4
#define MODEM_DTR           32
#define MODEM_RI            33
#define MODEM_FLIGHT        25
#define MODEM_STATUS        34

#define SD_MISO             2
#define SD_MOSI             15
#define SD_SCLK             14
#define SD_CS               13

#define LED_PIN             12

#define TINY_GSM_MODEM_SIM7600
#define TINY_GSM_RX_BUFFER 1024 // Set RX buffer to 1Kb
#define SerialAT Serial1

// See all AT commands, if wanted
#define DUMP_AT_COMMANDS

// set GSM PIN, if any
#define GSM_PIN ""

// Your GPRS credentials, if any
const char apn[]  = "xxxx";     //SET TO YOUR APN
const char gprsUser[] = "";
const char gprsPass[] = "";

#include <TinyGsmClient.h>
#include <SPI.h>
#include <SD.h>
#include <Ticker.h>

#ifdef DUMP_AT_COMMANDS  // if enabled it requires the streamDebugger lib
#include <StreamDebugger.h>
StreamDebugger debugger(SerialAT, Serial);
TinyGsm modem(debugger);
#else
TinyGsm modem(SerialAT);
#endif

int counter, lastIndex, numberOfPieces = 24;
String pieces[24], input;

bool reply = false;

void modem_on() {
    /*
    The indicator light of the board can be controlled
    */
    pinMode(LED_PIN, OUTPUT);
    digitalWrite(LED_PIN, HIGH);

    /*
    MODEM_PWRKEY IO:4 The power-on signal of the modulator must be given to it,
    otherwise the modulator will not reply when the command is sent
    */
    pinMode(MODEM_PWRKEY, OUTPUT);
    digitalWrite(MODEM_PWRKEY, HIGH);
    delay(300); //Need delay
    digitalWrite(MODEM_PWRKEY, LOW);

    /*
    MODEM_FLIGHT IO:25 Modulator flight mode control,
    need to enable modulator, this pin must be set to high
    */
    delay(1000); //Need delay
    pinMode(MODEM_FLIGHT, OUTPUT);
    digitalWrite(MODEM_FLIGHT, HIGH);

  int i = 10;
  Serial.println("\nTesting Modem Response...\n");
  Serial.println("****");
  while (i) {
    SerialAT.println("AT");
    delay(500);
    if (SerialAT.available()) {
      String r = SerialAT.readString();
      Serial.println(r);
      if ( r.indexOf("OK") >= 0 ) {
        reply = true;
        break;;
      }
    }
    delay(500);
    i--;
  }
  Serial.println("****\n");
}

void setup() {
  Serial.begin(115200); // Set console baud rate
  SerialAT.begin(115200, SERIAL_8N1, MODEM_RX, MODEM_TX);
  delay(100);

  modem_on();
  if (reply) {
    Serial.println(F("***********************************************************"));
    Serial.println(F(" You can now send AT commands"));
    Serial.println(F(" Enter \"AT\" (without quotes), and you should see \"OK\""));
    Serial.println(F(" If it doesn't work, select \"Both NL & CR\" in Serial Monitor"));
    Serial.println(F(" DISCLAIMER: Entering AT commands without knowing what they do"));
    Serial.println(F(" can have undesired consiquinces..."));
    Serial.println(F("***********************************************************\n"));
  } else {
    Serial.println(F("***********************************************************"));
    Serial.println(F(" Failed to connect to the modem! Check the baud and try again."));
    Serial.println(F("***********************************************************\n"));
  }
}

void loop() {
  while (true) {
    if (SerialAT.available()) {
      Serial.write(SerialAT.read());
    }
    if (Serial.available()) {
      SerialAT.write(Serial.read());
    }
    delay(1);
  }

}

I can give AT commands direct to the Modem.

PDN
AT+CPIN?
AT+CSQ
AT+CGREG?
AT+COPS?
AT+NETOPEN
AT+NETOPEN?
AT+IPADDR

Connected with IP and network

AT+CSSLCFG="sslversion",0,4
AT+CSSLCFG="authmode",0,1
AT+CSSLCFG="ignorelocaltime",0,1
AT+CSSLCFG="cacert",0,"isrgrootx1.pem"
AT+CSSLCFG="enableSNI",0,1
AT+CMQTTSTART
AT+CMQTTACCQ=0,"Client1",1,4
AT+CMQTTSSLCFG=0,0

Here is the issues 1 If I use TeraTerm to do a copy and paste of the cert - error is+CMQTTCONNECT: 0,34 open SSL session failed 2 Copy the copy and paste into Teraterm via Paster CR +CMQTTCONNECT: 0,32 handshake fail

Both can list the Cert AT+CCERTLIST result is +CCERTLIST: "isrgrootx1.pem"

So I delete the cert with AT+CCERTDELE="isrgrootx1.pem" of 1,939 (1.89 KB (1,939 bytes))

Right click the cert file in windows to get the size

AT+CCERTDOWN="isrgrootx1.pem",1939

Upload the cert 1 If I use TeraTerm to do a copy and paste - I dont get a OK 2 Copy the copy and paste into Teraterm via Paste CR and paste the cert with only the cert info it comes back with OK

What is the correct method to upload the Cert PEM file to the modem?

This link is method 1 that doesnt finish with ok and hangs https://www.hackster.io/victorffs/connecting-sim7600x-h-to-aws-using-mqtt-and-at-commands-2a693c

Manual says.... There are two ways to download certificate files to module:

  1. By AT+CCERTDOWN.
  2. By FTPS or HTTPS commands. Please refer to chapter 12 and 13
droidblastnz commented 1 year ago

So the question is how do you upload a cert in this case .PEM to the modem? Does anyone have the steps please?

droidblastnz commented 1 year ago

Tried FTP to get the cert

AT+CPIN?
AT+CSQ
AT+CGREG?
AT+COPS?
AT+NETOPEN
AT+NETOPEN?
AT+IPADDR

then

AT+CFTPSSTART
AT+CFTPSLOGIN="xxx.com",21,"xxx","xxx",0
AT+CFTPSLIST="/"
AT+CFTPSCWD="xxx.com"
AT+CFTPSPWD
AT+CFTPSGETFILE="xx.pem",4
AT+CFTPSGETFILE="xxx.der",4
AT+CFTPSLOGOUT

then

AT+CSSLCFG="enableSNI",0,1
AT+CMQTTSTART
AT+CMQTTACCQ=0,"xxx",1,4
AT+CMQTTSSLCFG=0,0

then

AT+CMQTTCONNECT=0,"tcp://xxx.s1.eu.hivemq.cloud:8883",60,1,"xxx","xxx"

result Error is 32 handshake fail

tried to convert pem to der openssl x509 -in isrgrootx1.pem -out isrgrootx1.der -outform DER

same result

20:53:33.709 -> Connecting to xxx.s1.eu.hivemq.cloud
20:53:33.709 -> 
20:53:33.709 -> AT+CNSMOD?
20:53:33.709 -> 
20:53:33.709 -> +CNSMOD: 0,8
20:53:33.758 -> 
20:53:33.758 -> OK
20:53:33.758 -> AT+CSSLCFG="sslversion",0,4
20:53:33.758 -> 
20:53:33.758 -> OK
20:53:33.758 -> AT+CSSLCFG="authmode",0,1
20:53:33.805 -> 
20:53:33.805 -> OK
20:53:33.805 -> AT+CSSLCFG="ignorelocaltime",0,1
20:53:33.805 -> 
20:53:33.805 -> OK
20:53:33.805 -> AT+CCERTLIST
20:53:33.853 -> 
20:53:33.853 -> +CCERTLIST: "isrgrootx1.pem"
20:53:33.900 -> 
20:53:33.900 -> OK
20:53:33.900 -> AT+CSSLCFG="cacert",0,"isrgrootx1.pem"
20:53:33.948 -> 
20:53:33.948 -> OK
20:53:33.948 -> AT+CCHSET=1,1
20:53:33.948 -> 
20:53:33.948 -> OK
20:53:33.948 -> AT+CSSLCFG?
20:53:33.995 -> 
20:53:33.995 -> +CSSLCFG: 0,4,1,1,300,"isrgrootx1.pem","","",1,"",0x0
20:53:34.121 -> +CSSLCFG: 1,4,0,1,300,"","","",0,"",0x0
20:53:34.166 -> +CSSLCFG: 2,4,0,1,300,"","","",0,"",0x0
20:53:34.260 -> +CSSLCFG: 3,4,0,1,300,"","","",0,"",0x0
20:53:34.356 -> +CSSLCFG: 4,4,0,1,300,"","","",0,"",0x0
20:53:34.447 -> +CSSLCFG: 5,4,0,1,300,"","","",0,"",0x0
20:53:34.494 -> +CS+CSSAT+CSSLCFG="enableSNI",0,1

Error is 32 handshake fail

droidblastnz commented 1 year ago

Quick update appears to be a firmware bug with B03 (LE20B03SIM7600M22). To connected to MQTT TLS 8883 update to B04 (LE20B04V03SIM7600M22) to fix the problem. I have asked Lilygo to provide a update.

Manufacturer: SIMCOM INCORPORATED

Model: SIMCOM_SIM7600G-H

Revision: LE20B03SIM7600M22

SIM7600M22_B03V02_200828

image

lewisxhe commented 1 year ago

Hi, please take the label of the module that needs to be upgraded. I will send a request to SIMCom for the latest firmware

droidblastnz commented 1 year ago

Hi, please take the label of the module that needs to be upgraded. I will send a request to SIMCom for the latest firmware

Thanks

image

Been working with Simcom this is the supplied B04 firmware but I cant upload the way they instructed?

lewisxhe commented 1 year ago

The picture cannot scan the QR code on the modem. I need to confirm the information in the QR code. Can you scan the QR code and copy the information to me?

droidblastnz commented 1 year ago

Done

image try P/N:S2-1097D-Z307J;SN:MP06211763960A0;IMEI:868822041632330;SW:LE20B03SIM7600M22

lewisxhe commented 1 year ago

This is the latest firmware that SIMCOM provides for this version https://1drv.ms/u/s!AmbpOqVezk5dsiYweoOa6OkU_p8I?e=6MEeJ1

droidblastnz commented 1 year ago

Thanks lewisxhe but doesn't this needs to be B04 (LE20B04V03SIM7600M22.rar) not B03(LE20B03SIM7600M22.rar)?

Mine SIM7600 details are this which has SW:LE20B03SIM7600M22 firmware isnt this the same as your link? P/N:S2-1097D-Z307J;SN:MP06211763960A0;IMEI:868822041632330;SW:LE20B03SIM7600M22

The SIMCOM engineer said that B03 doesnt work with MQTT TLS 8883 hence a bug and it needs to be B04?

Please confirm which firmware to use and the steps to apply the firmware?

lewisxhe commented 1 year ago

They didn't say anything, just let me try flashing the latest firmware to try it out

  1. You need to toggle the DIP switch at the bottom of the board to USB TO MODEM
  2. Install the complete driver, the tool can be obtained here https://github.com/Xinyuan-LilyGO/LilyGo-T-PCIE/tree/master/update_simxxxx_firmware
  3. There are steps here https://github.com/Xinyuan-LilyGO/LilyGo-T-PCIE/blob/master/doc/sim7600SA_update_firmware.md
droidblastnz commented 1 year ago

They didn't say anything, just let me try flashing the latest firmware to try it out

1. You need to toggle the DIP switch at the bottom of the board to USB TO MODEM

2. Install the complete driver, the tool can be obtained here https://github.com/Xinyuan-LilyGO/LilyGo-T-PCIE/tree/master/update_simxxxx_firmware

3. There are steps here https://github.com/Xinyuan-LilyGO/LilyGo-T-PCIE/blob/master/doc/sim7600SA_update_firmware.md

Thanks if possible can you also create a hivemq instance and see that the firmware allows you to connect via MQTT TLS 8883 please?

lewisxhe commented 1 year ago

I don't have time for testing at the moment, I need some time

droidblastnz commented 1 year ago

They didn't say anything, just let me try flashing the latest firmware to try it out

1. You need to toggle the DIP switch at the bottom of the board to USB TO MODEM

2. Install the complete driver, the tool can be obtained here https://github.com/Xinyuan-LilyGO/LilyGo-T-PCIE/tree/master/update_simxxxx_firmware

3. There are steps here https://github.com/Xinyuan-LilyGO/LilyGo-T-PCIE/blob/master/doc/sim7600SA_update_firmware.md

Thanks if possible can you also create a hivemq instance and see that the firmware allows you to connect via MQTT TLS 8883 please?

Thanks lewisxhe will wait for your firmware test.

droidblastnz commented 1 year ago

lewisxhe any update on the firmware test?

lewisxhe commented 1 year ago

I just found a modem with the same version as yours, I will test it after upgrading, please give me some time.

image

lewisxhe commented 1 year ago

Today I first updated the upgrade guide

lewisxhe commented 1 year ago
AT+CMQTTSTART

+CGREG: 0,1

OK

SMS DONE

OK

+CMQTTSTART: 0
AT+CCERTDOWN="ca_cert.pem",1338

>-----BEGIN CERTIFICATE-----
MIIDrzCCApegAwIBAgIQCDvgVpBCRrGhdWrJWZHHSjANBgkqhkiG9w0BAQUFADBh
MQswCQYDVQQGEwJVUzEVMBMGA1UEChMMRGlnaUNlcnQgSW5jMRkwFwYDVQQLExB3
d3cuZGlnaWNlcnQuY29tMSAwHgYDVQQDExdEaWdpQ2VydCBHbG9iYWwgUm9vdCBD
QTAeFw0wNjExMTAwMDAwMDBaFw0zMTExMTAwMDAwMDBaMGExCzAJBgNVBAYTAlVT
MRUwEwYDVQQKEwxEaWdpQ2VydCBJbmMxGTAXBgNVBAsTEHd3dy5kaWdpY2VydC5j
b20xIDAeBgNVBAMTF0RpZ2lDZXJ0IEdsb2JhbCBSb290IENBMIIBIjANBgkqhkiG
9w0BAQEFAAOCAQ8AMIIBCgKCAQEA4jvhEXLeqKTTo1eqUKKPC3eQyaKl7hLOllsB
CSDMAZOnTjC3U/dDxGkAV53ijSLdhwZAAIEJzs4bg7/fzTtxRuLWZscFs3YnFo97
nh6Vfe63SKMI2tavegw5BmV/Sl0fvBf4q77uKNd0f3p4mVmFaG5cIzJLv07A6Fpt
43C/dxC//AH2hdmoRBBYMql1GNXRor5H4idq9Joz+EkIYIvUX7Q6hL+hqkpMfT7P
T19sdl6gSzeRntwi5m3OFBqOasv+zbMUZBfHWymeMr/y7vrTC0LUq7dBMtoM1O/4
gdW7jVg/tRvoSSiicNoxBN33shbyTApOB6jtSj1etX+jkMOvJwIDAQABo2MwYTAO
BgNVHQ8BAf8EBAMCAYYwDwYDVR0TAQH/BAUwAwEB/zAdBgNVHQ4EFgQUA95QNVbR
TLtm8KPiGxvDl7I90VUwHwYDVR0jBBgwFoAUA95QNVbRTLtm8KPiGxvDl7I90VUw
DQYJKoZIhvcNAQEFBQADggEBAMucN6pIExIK+t1EnE9SsPTfrgT1eXkIoyQY/Esr
hMAtudXH/vTBH1jLuG2cenTnmCmrEbXjcKChzUyImZOMkXDiqw8cvpOp/2PV5Adg
06O/nVsJ8dWO41P0jmP6P6fbtGbfYmbW0W5BjfIttep3Sp+dWOIrWcBAI+0tKIJF
PnlUkiaY4IBIqDfv8NZ5YBberOgOzW6sRBc4L0na4UU+Krk2U886UAb3LujEV0ls
YSEY1QSteDwsOoBrp+uvFRTp2InBuThs4pFsiv9kuXclVzDAGySj4dzp30d8tbQk
CAUw7C29C79Fv1C5qfPrmAESrciIxpg0X40KPMbp1ZWVbd4=
-----END CERTIFICATE-----

OK
AT+CSSLCFG="sslversion",0,4

OK
AT+CSSLCFG="authmode",0,1

OK
AT+CSSLCFG="cacert",0,"ca_cert.pem"

OK
AT+CSSLCFG="clientcert",0,"cert.pem"

ERROR
AT+CSSLCFG="clientkey",0,"key_cert.pem"

ERROR
AT+CMQTTSSLCFG=0,0

OK
AT+CMQTTREL=0

OK
AT+CMQTTACCQ=0,"Sim7600_fa7d2288",1

OK
AT+CMQTTCONNECT=0,"tcp://broker.emqx.io:8883",60,1

OK

+CMQTTCONNECT: 0,0

Everything seems to be working fine, of course I'm connecting to a public server.

droidblastnz commented 1 year ago
AT+CMQTTSTART

+CGREG: 0,1

OK

SMS DONE

OK

+CMQTTSTART: 0
AT+CCERTDOWN="ca_cert.pem",1338

>-----BEGIN CERTIFICATE-----
MIIDrzCCApegAwIBAgIQCDvgVpBCRrGhdWrJWZHHSjANBgkqhkiG9w0BAQUFADBh
MQswCQYDVQQGEwJVUzEVMBMGA1UEChMMRGlnaUNlcnQgSW5jMRkwFwYDVQQLExB3
d3cuZGlnaWNlcnQuY29tMSAwHgYDVQQDExdEaWdpQ2VydCBHbG9iYWwgUm9vdCBD
QTAeFw0wNjExMTAwMDAwMDBaFw0zMTExMTAwMDAwMDBaMGExCzAJBgNVBAYTAlVT
MRUwEwYDVQQKEwxEaWdpQ2VydCBJbmMxGTAXBgNVBAsTEHd3dy5kaWdpY2VydC5j
b20xIDAeBgNVBAMTF0RpZ2lDZXJ0IEdsb2JhbCBSb290IENBMIIBIjANBgkqhkiG
9w0BAQEFAAOCAQ8AMIIBCgKCAQEA4jvhEXLeqKTTo1eqUKKPC3eQyaKl7hLOllsB
CSDMAZOnTjC3U/dDxGkAV53ijSLdhwZAAIEJzs4bg7/fzTtxRuLWZscFs3YnFo97
nh6Vfe63SKMI2tavegw5BmV/Sl0fvBf4q77uKNd0f3p4mVmFaG5cIzJLv07A6Fpt
43C/dxC//AH2hdmoRBBYMql1GNXRor5H4idq9Joz+EkIYIvUX7Q6hL+hqkpMfT7P
T19sdl6gSzeRntwi5m3OFBqOasv+zbMUZBfHWymeMr/y7vrTC0LUq7dBMtoM1O/4
gdW7jVg/tRvoSSiicNoxBN33shbyTApOB6jtSj1etX+jkMOvJwIDAQABo2MwYTAO
BgNVHQ8BAf8EBAMCAYYwDwYDVR0TAQH/BAUwAwEB/zAdBgNVHQ4EFgQUA95QNVbR
TLtm8KPiGxvDl7I90VUwHwYDVR0jBBgwFoAUA95QNVbRTLtm8KPiGxvDl7I90VUw
DQYJKoZIhvcNAQEFBQADggEBAMucN6pIExIK+t1EnE9SsPTfrgT1eXkIoyQY/Esr
hMAtudXH/vTBH1jLuG2cenTnmCmrEbXjcKChzUyImZOMkXDiqw8cvpOp/2PV5Adg
06O/nVsJ8dWO41P0jmP6P6fbtGbfYmbW0W5BjfIttep3Sp+dWOIrWcBAI+0tKIJF
PnlUkiaY4IBIqDfv8NZ5YBberOgOzW6sRBc4L0na4UU+Krk2U886UAb3LujEV0ls
YSEY1QSteDwsOoBrp+uvFRTp2InBuThs4pFsiv9kuXclVzDAGySj4dzp30d8tbQk
CAUw7C29C79Fv1C5qfPrmAESrciIxpg0X40KPMbp1ZWVbd4=
-----END CERTIFICATE-----

OK
AT+CSSLCFG="sslversion",0,4

OK
AT+CSSLCFG="authmode",0,1

OK
AT+CSSLCFG="cacert",0,"ca_cert.pem"

OK
AT+CSSLCFG="clientcert",0,"cert.pem"

ERROR
AT+CSSLCFG="clientkey",0,"key_cert.pem"

ERROR
AT+CMQTTSSLCFG=0,0

OK
AT+CMQTTREL=0

OK
AT+CMQTTACCQ=0,"Sim7600_fa7d2288",1

OK
AT+CMQTTCONNECT=0,"tcp://broker.emqx.io:8883",60,1

OK

+CMQTTCONNECT: 0,0

Everything seems to be working fine, of course I'm connecting to a public server.

Thanks thats great. Can you please confirm which firmware it was just so I am clear? e.g., https://1drv.ms/u/s!AmbpOqVezk5dsiYweoOa6OkU_p8I?e=6MEeJ1

And could I ask you to test to a private hiveMQ MQTT on 8883? Free to create a private instance here

https://auth.hivemq.cloud/login?state=hKFo2SBpUzdIcXFGc29Kam5uTmRHVjVVUlZzajBCTUlMWjZGeaFupWxvZ2luo3RpZNkgWmJjQWIxNzBMamd4d2xpYzRSLWZ5OUdEUXU2ejUtMEajY2lk2SBJYWpvNGUzMmp4d1VzOEFkRnhneFFuMlZQM1l3SVpUSw&client=Iajo4e32jxwUs8AdFxgxQn2VP3YwIZTK&protocol=oauth2&audience=hivemq-cloud-api&redirect_uri=https%3A%2F%2Fconsole.hivemq.cloud&scope=openid%20profile%20email&response_type=code&response_mode=query&nonce=V1JtcWV0QzRPWjlaQm80cVI1TVdHd3VFbG45MzFhNWJyeEZsUWZLVTFMaQ%3D%3D&code_challenge=Z2jSfGDkHRMFaZ8d_BazDO3fSNnRvmukoKFYo4ukC1o&code_challenge_method=S256&auth0Client=eyJuYW1lIjoiYXV0aDAtc3BhLWpzIiwidmVyc2lvbiI6IjEuMTMuNiJ9 it only needs the server pem/Cert and test a connect please?

lewisxhe commented 1 year ago

I am currently using version B04 , hivemq cloud I will test it again when I have time.

Manufacturer: SIMCOM INCORPORATED
Model: SIMCOM_SIM7600G-H
Revision: LE20B04SIM7600G22
QCN: 
IMEI: 862205052xxxxxxxx
MEID: 
+GCAP: +CGSM
DeviceInfo: 173,170
droidblastnz commented 1 year ago

Thanks so thats the B04 (LE20B04V03SIM7600M22.rar) I supplied correct just want to make sure please. If not can you supply a link please?

On Fri, Jun 2, 2023 at 2:25 PM Lewis He @.***> wrote:

I am currently using version B04 of hivemq and I will test it again when I have time.

Manufacturer: SIMCOM INCORPORATED Model: SIMCOM_SIM7600G-H Revision: LE20B04SIM7600G22 QCN: IMEI: 862205052xxxxxxxx MEID: +GCAP: +CGSM DeviceInfo: 173,170

— Reply to this email directly, view it on GitHub https://github.com/Xinyuan-LilyGO/T-SIM7600X/issues/49#issuecomment-1573047348, or unsubscribe https://github.com/notifications/unsubscribe-auth/AGHRBTYWDKTIRIG4TPX3DU3XJFFJTANCNFSM6AAAAAAXWJDRXY . You are receiving this because you authored the thread.Message ID: @.***>

lewisxhe commented 1 year ago

The screenshot of the upgrade guide is the version I upgraded https://github.com/Xinyuan-LilyGO/T-SIM7600X/blob/master/docs/UpdateGuide/UpdateGuide.md

image

lewisxhe commented 1 year ago

这是SIMCOM为此版本提供的最新固件 https://1drv.ms/u/s!AmbpOqVezk5dsiYweoOa6OkU_p8I?e=6MEeJ1

@droidblastnz

droidblastnz commented 1 year ago

这是SIMCOM为此版本提供的最新固件 https://1drv.ms/u/s!AmbpOqVezk5dsiYweoOa6OkU_p8I?e=6MEeJ1

@droidblastnz

Sorry still confused with which firmware am I upgrading to B03 or B04?

This link you posted is B03 LE20B03SIM7600M22.rar https://1drv.ms/u/s!AmbpOqVezk5dsiYweoOa6OkU_p8I?e=6MEeJ1

but you mentioned The screenshot of the upgrade guide is the version I upgraded

https://github.com/Xinyuan-LilyGO/T-SIM7600X/blob/master/docs/UpdateGuide/UpdateGuide.md

LE20B04SIM7600G22 after you said you had found the same SIM

https://github.com/Xinyuan-LilyGO/T-SIM7600X/issues/49#issuecomment-1571229547

Thanks running through the instructions this is missing -ATdebug.ino

https://github.com/Xinyuan-LilyGO/T-SIM7600X/blob/master/docs/examples/ATdebug/ATdebug.ino

Drivers link is not working https://onedrive.live.com/?authkey=%21AGn%2DFhVsbmpxoeg&id=5D4ECE5EA53AE966%215803&cid=5D4ECE5EA53AE966&parId=root&parQt=sharedby&o=OneUp

https://github.com/Xinyuan-LilyGO/T-SIM7600X/blob/master/docs/examples/ATdebug/ATdebug.ino
https://github.com/Xinyuan-LilyGO/T-SIM7600X/blob/master/examples/ATdebug/ATdebug.ino

Also please confirm the process for uploading the cert to the SIM? Which USB is used when flashing the modem please?

lewisxhe commented 1 year ago

Sorry, this is for B04.

The one where the USB is near the modem, and the UpdateGuide has been updated I am using B04, B03 I have not tested, because you have tested I have not tested.

droidblastnz commented 1 year ago

Sorry, this is for B04.

* [LE20B04SIM7600G22.rar](https://1drv.ms/u/s!AmbpOqVezk5dsiUfnlitTsJBGQ3v?e=o388ew)

* [Windows USB Drivers](https://1drv.ms/u/s!AmbpOqVezk5drSuQMtGsXvJIYrhX?e=EMGq5o)

* [ATdebug](https://github.com/Xinyuan-LilyGO/T-SIM7600X/tree/master/examples/ATdebug)

The one where the USB is near the modem, and the UpdateGuide has been updated I am using B04, B03 I have not tested, because you have tested I have not tested.

Thanks again, please confirm the process for uploading the cert to the SIM/Modem and what location does the cert go to?

Oswaldott commented 1 year ago

Hello @lewisxhe I have same problem: I get +CMQTTCONNECT: 0,34. It’s necessary create other Issues? or can you help me in this issues?

Sending command: -- AT+COPS?
AT+COPS?
+COPS: 0,0,"TELCEL TELCEL",7

OK
I (44731) SIM7600: 
********Information !!!
I (44731) SIM7600: ********Loading certificate:

Sending command: -- AT+CCERTDOWN="clientcert.pem",1224
AT+CCERTDOWN="clientcert.pem",1224
>
I (45871) SIM7600: **CERT ACCEPTED!

-----BEGIN CERTIFICATE-----
MIIDWjCCAkKgAwIBAgIVAJZhhS1zVRVWPXfHvssGjJQcaA51MA0GCSqGSIb3DQEB
CwUAME0xSzBJBgNVBAsMQkFtYXpvbiBXZWIgU2VydmljZXMgTz1BbWF6b24uY29t
IEluYy4gTD1TZWF0dGxlIFNUPVdhc2hpbmd0b24gQz1VUzAeFw0yMzA0MzAxOTQz
MzBaFw00OTEyMzEyMzU5NTlaMB4xHDAaBgNVBAMME0FXUyBJb1QgQ2VydGlmaWNh
dGUwggEiMA0GCSqGSIb3DQEBAQUAA4IBDwAwggEKAoIBAQDkoUizNgKzQm9eBr+B
rt/SjNTxa6HxbL8uE9I/wYDCHNvRqp5ZGW6A0zweLCir803WTzL1f1TQc4d4qkAs
+BBGUAzNcAuMAPlGIjJ658qAmY8QOFNEQVdvz3Y5Z5KOZezFurm6iTtCMVkSLnkZ
dQeBSgH14nt3m5wCj1Tgp2ZIBnJimlO7Kxoe5kUfTv+/lR2Rxts/H/x9tyby+Cdg
4VFoG/Lf4bDngC/F4Ww0k2EYLJsi0cUMjekb5OfPimCsuNTzH+A6qkoqVLc1vCmw
4jwrkIxwD8qVkwcAiA7OmXZl2ATv96nHrdmjy+ZA0q4dAHYXa3bgqNhCpkX9xGtr
5ABRAgMBAAGjYDBeMB8GA1UdIwQYMBaAFJeIGPyz9mHJsLAkMPj6q7fmeSW4MB0G
A1UdDgQWBBS4wW/6vFxQlna9Ow1T/vO0BAAsUzAMBgNVHRMBAf8EAjAAMA4GA1Ud
DwEB/wQEAwIHgDANBgkqhkiG9w0BAQsFAAOCAQEAnqqySToJZqEmBYkEEn4/T9/V
ZUE2VHer//QVznaP5+P2WF7DH97sFGQl4XqK2tUARwDVWbO7Ut+DCkZkcSlXrsBw
1SCfopuiYxsgdEk+hpfcGH/RTEI8uSL9yn5Ov7MP1QMLQ19J6afzF7VK8WGYXmSg
Pkd/0rLYzra+F1XhVXBo7cCMXe0aiOr6PAAaW4apae0CAfeOT2GrS9817WSyYsfW
xS9Pfxxj3kkrCFDSSFH0JMOx/p6Pe9/DqqtuomfFOFKVV+mzLAcJ7dzSBwUjpK8f
egKFxZJKIAKXajK/tCXruTRrnSEqeq5s3PiULDZcjw1g2HFhm8aa55GgZypVvg==
E (54971) SIM7600: 
max_ATTEMPTS 20

I (55971) SIM7600: ********Loading certificate:

Sending command: -- AT+CCERTDOWN="clientkey.pem",1679
-----END CERTIFICATE----
OK
AT+CCERTDOWN="clientkey.pem",1679
>
I (58011) SIM7600: **CERT ACCEPTED!

-----BEGIN RSA PRIVATE KEY-----
MIIEpQIBAAKCAQEA5KFIszYCs0JvXga/ga7f0ozU8Wuh8Wy/LhPSP8GAwhzb0aqe
WRlugNM8Hiwoq/NN1k8y9X9U0HOHeKpALPgQRlAMzXALjAD5RiIyeufKgJmPEDhT
REFXb892OWeSjmXsxbq5uok7QjFZEi55GXUHgUoB9eJ7d5ucAo9U4KdmSAZyYppT
uysaHuZFH07/v5UdkcbbPx/8fbcm8vgnYOFRaBvy3+Gw54AvxeFsNJNhGCybItHF
DI3pG+Tnz4pgrLjU8x/gOqpKKlS3NbwpsOI8K5CMcA/KlZMHAIgOzpl2ZdgE7/ep
x63Zo8vmQNKuHQB2F2t24KjYQqZF/cRra+QAUQIDAQABAoIBAQDMLb1fTrzamloa
/qvIhQQeZOdHM3hMw3F5FPqPNaBnup4VgOopaCznn73wtD8eUQsSeWhpFm4IOySg
/mqRvnfKU3MbhRTK05PKrn+mg5q1fm3lbmfubOxJTl2mpnib8yqg60Ey9ZuWYbvK
IPbFZV5ueEmH7duV1cJeBuMmPll5t5eIPEsRtnpsHiDYgTgN5fFYfLZIRM6Y+JBh
ZRwahNRjLTR9rV92xSLI1ZspKmD3hWbY1RQrSa2rzXv9CiQ7KhrG8ZBet8BA0LEg
zxNqEHWnp6yXWhT7JWfoKP6KA1b30SXA2daJiJP9hNz9Z4FIgCXR+Y1lhP+U+zrp
gbq+dHaBAoGBAP5O45cpSsvXdJHoUs1jRZkfDRMZ6SuzqOob8yNmSrKtZKtGin/n
muqjtRSQ1Gg5qbOVLnFm5dQoVMk7uYafpupH+ExQyh8IFw7DKvWEfmXDEGDfPGW/
n3NeIRI/2LBq6CWqh+9Gie+N5sETrEYKXxUTv4wPxUZsvTbJXlt/5ml/AoGBAOYm
qaKdWMOzQF/5q6SlzVnnrUKYSeQdTgWUTRwOCirxBCh6iibnYZbQL4tK+4ibcG+b
7rZShoVASUMQFHNKu5nVOxI7lLsNc5taocV9RipsSp05LVa/BXqpL89nsacRk4Ei
ckkdxHe0pi8ap5oca/0jcmS7QOfNQU8mIv/TJl4vAoGBAJCfIILYcrbVwm8vpdcz
u2LG69KPC7FUrJzmZDEffR97yCI3LZBrkAgcLWCStJjJIh8EmbLYB5/Nh9og4vMS
E (67151) SIM7600: 
max_ATTEMPTS 20

I (68151) SIM7600: ********Loading certificate:

Sending command: -- AT+CCERTDOWN="cacert.pem",1187
XAQkBaqwzyEyopo8l3Okc5U/h1Lv4RMkFHOxdjFAqeQ6B+dTwZZrkQnwsufeXjw+
ra/42Re36EKSmFBN2CFE7S3VAoGAd7H731q942nCPSf4ILUqS2u2LEBPjZfAEB7E
y6Zxm0ulwfeZCgqkMm8riuIAV1ef7ivGxoO8+mgosfwW5q8jSiofgqgB/hZM3asR
H0i7ySxw0bv+3HKUQuritpdTSXRWpn5nuacFmswU8cKHEBtf/lMFF2ZbpzKUmLlY
0nvaJHkCgYEA7P5XGzTRsr++H+5XVCraT4elW5QCbhcC9xE5ERqkBAuDMjQammZ2
+EI7DNUr2v30pCj7QZcPn/1Bchmmn+KOhM2Naup/xagSGfXy8iHMoU2KSQSb7DCv
pTeLSjf3Egdn+lWN2BufByBWCl1zuIkIeF2k+M2EyU35uCkniLNEbAQ=
-----END RSA PRIVATE KEY----
OK
AT+CCERTDOWN="cacert.pem",1187
>
I (73341) SIM7600: **CERT ACCEPTED!

-----BEGIN CERTIFICATE-----
MIIDQTCCAimgAwIBAgITBmyfz5m/jAo54vB4ikPmljZbyjANBgkqhkiG9w0BAQsF
ADA5MQswCQYDVQQGEwJVUzEPMA0GA1UEChMGQW1hem9uMRkwFwYDVQQDExBBbWF6
b24gUm9vdCBDQSAxMB4XDTE1MDUyNjAwMDAwMFoXDTM4MDExNzAwMDAwMFowOTEL
MAkGA1UEBhMCVVMxDzANBgNVBAoTBkFtYXpvbjEZMBcGA1UEAxMQQW1hem9uIFJv
b3QgQ0EgMTCCASIwDQYJKoZIhvcNAQEBBQADggEPADCCAQoCggEBALJ4gHHKeNXj
ca9HgFB0fW7Y14h29Jlo91ghYPl0hAEvrAIthtOgQ3pOsqTQNroBvo3bSMgHFzZM
9O6II8c+6zf1tRn4SWiw3te5djgdYZ6k/oI2peVKVuRF4fn9tBb6dNqcmzU5L/qw
IFAGbHrQgLKm+a/sRxmPUDgH3KKHOVj4utWp+UhnMJbulHheb4mjUcAwhmahRWa6
VOujw5H5SNz/0egwLX0tdHA114gk957EWW67c4cX8jJGKLhD+rcdqsq08p8kDi1L
93FcXmn/6pUCyziKrlA4b9v7LWIbxcceVOF34GfID5yHI9Y/QCB/IIDEgEw+OyQm
jgSubJrIqg0CAwEAAaNCMEAwDwYDVR0TAQH/BAUwAwEB/zAOBgNVHQ8BAf8EBAMC
AYYwHQYDVR0OBBYEFIQYzIU07LwMlJQuCFmcx7IQTgoIMA0GCSqGSIb3DQEBCwUA
A4IBAQCY8jdaQZChGsV2USggNiMOruYou6r4lK5IpDB/G/wkjUu0yKGX9rbxenDI
U5PMCCjjmCXPI6T53iHTfIUJrU6adTrCC2qJeHZERxhlbI1Bjjt/msv0tadQ1wUs
N+gDS63pYaACbvXy8MWy7Vu33PqUXHeeE6V/Uq2V8viTO96LXFvKWlJbYK8U90vv
o/ufQJVtMVT8QtPHRh8jrdkPSHCa2XV4cdFyQzR1bldZwgJcJmApzyMZFo6IQ6XU
5MsI+yMRQ+hDKXJioaldXgjUkK642M4UwtBV8ob2xJNDd2ZhwLnoQdeXeGADbkpy
rqXRfboQnoZsG4q5WTP468SQvvG5
E (82441) SIM7600: 
max_ATTEMPTS 20

Sending command: -- AT+CCERTLIST
-----END CERTIFICATE---
OK
AT+CCERTLIST
+CCERTLIST: "cacert.pem"
+CCERTLIST: "clientcert.pem"
+CCERTLIST: "clientkey.pem"

I (84341) SIM7600: 
********Certs verified!

Sending command: -- AT+CSSLCFG="sslversion",0,4
OK
AT+CSSLCFG="sslversion",0,4
OK

Sending command: -- AT+CSSLCFG="authmode",0,2
AT+CSSLCFG="authmode",0,2
OK

Sending command: -- AT+CSSLCFG="ignorelocaltime",0,1
AT+CSSLCFG="ignorelocaltime",0,1
OK

Sending command: -- AT+CSSLCFG="negotiatetime",0,120
AT+CSSLCFG="negotiatetime",0,120
OK
I (88911) SIM7600: 
********SSL CONFIGURED!!

Sending command: -- AT+CSSLCFG="cacert",0,"cacert.pem"
AT+CSSLCFG="cacert",0,"cacert.pem"
OK
I (90211) SIM7600: 
***configure cacert SSL

Sending command: -- AT+CSSLCFG="clientcert",0,"clientcert.pem"
AT+CSSLCFG="clientcert",0,"clientcert.pem"
OK
I (91311) SIM7600: 
***configure clientcert SSL

Sending command: -- AT+CSSLCFG="clientkey",0,"clientkey.pem"
AT+CSSLCFG="clientkey",0,"clientkey.pem"
OK
I (92411) SIM7600: 
***configure clientkey SSL

Sending command: -- AT+NETOPEN

AT+NETOPEN
OK

+NETOPEN: 0
I (124951) SIM7600: 
********Start TCPIP service

Sending command: -- AT+IPADDR
AT+IPADDR
+IPADDR: 10.206.180.140

OK
I (126951) SIM7600: 
**Get IP address of PDP context

Sending command: -- AT+CMQTTSTART

AT+CMQTTSTART
+CMQTTSTART: 0

OK
W (129451) SIM7600: 
********Start MQTT service, activate PDP context....

Sending command: -- AT+CMQTTACCQ=0,"SIMCom_client01",1
AT+CMQTTACCQ=0,"SIMCom_client01",1
OK
I (131051) SIM7600: 
********Acquire one client which will connect to a MQTTserver not SSL/TLS!!!

Sending command: -- AT+CMQTTSSLCFG=0,0
AT+CMQTTSSLCFG=0,0
OK
I (132651) SIM7600: 
********Set the SSL context

Sending command: -- AT+CMQTTCFG="checkUTF8",0,0

AT+CMQTTCFG="checkUTF8",0,0
OK
I (134251) SIM7600: 
********Set the SSL context

Sending command: -- AT+CMQTTWILLTOPIC=0,31

AT+CMQTTWILLTOPIC=0,31
>

Sending command: -- aws/things/simcom7600_device01/
aws/things/simcom7600_device01/
OK
I (136991) SIM7600: 
********topic sent !!!!********

Sending command: -- AT+CMQTTWILLMSG=0,17,1

AT+CMQTTWILLMSG=0,17,1
>

Sending command: -- SIMCom Connected!
SIMCom Connected!
OK
I (140231) SIM7600: 
********input sent !!!!********

Sending command: -- AT+CMQTTCONNECT=0,"tcp://a23fja3lj6qx28-ats.iot.us-west-1.amazonaws.com:8883",60,1
AT+CMQTTCONNECT=0,"tcp://a23fja3lj6qx28-ats.iot.us-west-1.amazonaws.com:8883",60,1
OK
I (141831) SIM7600: 
********Connect to MQTT server

Sending command: -- AT+CMQTTTOPIC=0,31

AT+CMQTTTOPIC=0,31
+CMQTTTOPIC: 0,11

ERROR

+CMQTTCONNECT: 0,34
E (151891) SIM7600: 
max_ATTEMPTS 20
Oswaldott commented 1 year ago

I am currently working on mac My version of firmware is the same that @droidblastnz-> LE20B03SIM7600M22, please can you help me with this

droidblastnz commented 1 year ago

@lewisxhe please confirm the process for uploading the cert to the SIM/Modem and what location does the cert go to?

@Oswaldott Is firmware update via ota how are you doing this? See the B04 firmware

Oswaldott commented 1 year ago

@droidblastnz I followed the firmware update steps but i got this https://github.com/botletics/SIM7000-LTE-Shield/issues/41#issue-372693777 so i did this https://github.com/botletics/SIM7000-LTE-Shield/issues/41#issuecomment-642713893, but now i got this:

Captura de Pantalla 2023-06-03 a la(s) 3 54 38 p m

Any suggestions?

droidblastnz commented 1 year ago

@droidblastnz I followed the firmware update steps but i got this botletics/SIM7000-LTE-Shield#41 (comment) so i did this botletics/SIM7000-LTE-Shield#41 (comment), but now i got this: Captura de Pantalla 2023-06-03 a la(s) 3 54 38 p m

Any suggestions?

Same issue? No SIM inserted rechecked When trying to reflash drops to COM14 diag

image

image

@lewisxhe what are we doing wrong?

-------------SIM7080_SIM7500_SIM7600_SIM7900_SIM8200 QDL V1.58 Only for Update(Build:Apr 21 2020 17:10:19)-----------
2023-06-05 11:09:05: Platform:9x07
2023-06-05 11:09:11: QLib verison: QLIB V6.1.144,QPHONEMS .
2023-06-05 11:09:11: SupportDiag: 1 SupportEFS: 1 SupportsSwDownload:0 UsingQPST:0
2023-06-05 11:09:11: Mobile Version report: PASS
2023-06-05 11:09:11: Compile Date: Aug 28 2020
2023-06-05 11:09:11: Compile Time: 16:31:24
2023-06-05 11:09:11: Release Date: Jul 17 2020
2023-06-05 11:09:11: Release Time: 11:00:00
2023-06-05 11:09:11: Version Dir: 9607.gen
2023-06-05 11:09:11: Station Class Mark: 42
2023-06-05 11:09:11: CAI Rev: 9
2023-06-05 11:09:11: Mobile Model: 255
2023-06-05 11:09:11: Firmware Rev: 100
2023-06-05 11:09:11: Slot Cycle Index: 2
2023-06-05 11:09:11: Vocoder major version: 0
2023-06-05 11:09:11: Vocoder minor version: 74
2023-06-05 11:09:11: Ext MSM HW Version: 0x4A0
2023-06-05 11:09:11: Ext Mobile Model#: 0x100C
2023-06-05 11:09:11: Ext Mobile Mobile SW Rev: MPSS.JO.2.0.2.c1.7-00052-9607_GENNS_PACK-1
2023-06-05 11:09:11: Ext Model ID: 
2023-06-05 11:09:11: Phone Operating Mode: ONLINE
2023-06-05 11:09:11: Phone Call State: CM_CALL_STATE_IDLE
2023-06-05 11:09:11: Phone System Mode State: SYS_SYS_MODE_NO_SRV
2023-06-05 11:09:11: FTM Mode: OFF
2023-06-05 11:09:14: Waiting switch To Download Mode...
2023-06-05 11:09:18: Connecting Sahara Server COM14 1 times....
2023-06-05 11:09:23: saharaHandle=0x0720, Version:0
2023-06-05 11:09:25: Connecting Sahara Server COM14 2 times....
2023-06-05 11:09:30: saharaHandle=0x0720, Version:0
2023-06-05 11:09:33: Connecting Sahara Server COM14 3 times....
2023-06-05 11:09:38: saharaHandle=0x0554, Version:0
2023-06-05 11:09:40: Connecting Sahara Server COM14 4 times....
2023-06-05 11:09:45: saharaHandle=0x047c, Version:0
2023-06-05 11:09:48: Connecting Sahara Server COM14 5 times....
2023-06-05 11:09:53: saharaHandle=0x06d0, Version:0
2023-06-05 11:09:55: Version: 0, MSMId: 0,SN: 0.
2023-06-05 11:09:55: Waiting Sahara_FlashProgrammer...
2023-06-05 11:09:55: Unable to download Flash Programmer using Sahara Protocol, Please repower No1 DUT.

re ran

Unable to download Flash Programmer using Sahara Protocol------Please re-power No1
DUT.If re-power modular still display this message, you can try re-install the VC run timer
library in tools directory
lewisxhe commented 1 year ago

During the upgrade process, keep the computer Device Manager open, check the missing drivers in time, and install them in time.

lewisxhe commented 1 year ago

The upgrade tool version I shared should be 1.6.7. Please use the upgrade tool in the update guide https://github.com/Xinyuan-LilyGO/T-SIM7600X/blob/master/docs/UpdateGuide/UpdateGuide.md

droidblastnz commented 1 year ago

The upgrade tool version I shared should be 1.6.7. Please use the upgrade tool in the update guide https://github.com/Xinyuan-LilyGO/T-SIM7600X/blob/master/docs/UpdateGuide/UpdateGuide.md

Followed the guide and still cannot upgrade. Rebooted tried again no new devices appears, refreshed device manager. Tried a different Win 10 laptop same issue

Unable to download Flash Programmer using Sahara Protocol, Please repower No1 DUT

image

Start the tool image

No other device appears during the upgrade apart from the QHSUSB_BULK which has the driver installed.

lewisxhe commented 1 year ago

Here is the video I recorded writing https://youtu.be/7cJzjfcrFWY

lewisxhe commented 1 year ago

@droidblastnz This is the feedback you got from using AT+SICOMATI? If so, then this version of firmware is not suitable for you, please check the firmware name, they are M22 and G22 respectively, please confirm the current hardware version you need to update the firmware

image

droidblastnz commented 1 year ago

AT+SICOMATI

Thanks wrote the ATdebug.ino and then ran AT+SIMCOMATI with this response

20:55:46.773 -> 
20:55:46.773 -> +CPIN: READY
20:55:46.773 -> 
20:55:46.773 -> SMS DONE
20:55:46.773 -> 
20:55:46.773 -> PB DONE
20:55:49.991 -> 
20:55:49.991 -> OK
20:56:03.281 -> 
20:56:03.281 -> Manufacturer: SIMCOM INCORPORATED
20:56:03.281 -> Model: SIMCOM_SIM7600G-H
20:56:03.281 -> Revision: LE20B03SIM7600M22
20:56:03.281 -> SIM7600M22_B03V02_200828
20:56:03.281 -> QCN: 
20:56:03.281 -> IMEI: 868822041632330
20:56:03.281 -> MEID: 
20:56:03.281 -> +GCAP: +CGSM
20:56:03.281 -> DeviceInfo: 173,170
20:56:03.281 -> 
20:56:03.281 -> OK

LE20B03SIM7600M22

Watched the video and started from scratch again. All drivers are installed

Run the sim7080_sim7500_sim7600_sim7900_sim8200 qdl v1.67 only for update.exe and select the correct SIM7500&7600&7800Series then browse to the correct firmware location.

2023-06-07 14:13:52: -------------SIM7080_SIM7500_SIM7600_SIM7900_SIM8200 QDL V1.67 Only for Update(Build:Oct 14 2021 16:17:32)-----------
2023-06-07 14:13:52: Mobile Version report: PASS
2023-06-07 14:13:52: Compile Date: Aug 28 2020
2023-06-07 14:13:53: Compile Time: 16:31:24
2023-06-07 14:13:53: Release Date: Jul 17 2020
2023-06-07 14:13:53: Release Time: 11:00:00
2023-06-07 14:13:53: Version Dir: 9607.gen
2023-06-07 14:13:53: Station Class Mark: 42
2023-06-07 14:13:53: CAI Rev: 9
2023-06-07 14:13:53: Mobile Model: 255
2023-06-07 14:13:53: Firmware Rev: 100
2023-06-07 14:13:53: Slot Cycle Index: 2
2023-06-07 14:13:53: Vocoder major version: 0
2023-06-07 14:13:53: Vocoder minor version: 74
2023-06-07 14:13:53: Ext MSM HW Version: 0x4A0
2023-06-07 14:13:53: Ext Mobile Model#: 0x100C
2023-06-07 14:13:53: Ext Mobile Mobile SW Rev: MPSS.JO.2.0.2.c1.7-00052-9607_GENNS_PACK-1
2023-06-07 14:13:53: Ext Model ID: 
2023-06-07 14:13:53: Phone Operating Mode: ONLINE
2023-06-07 14:13:53: Phone Call State: CM_CALL_STATE_IDLE
2023-06-07 14:13:53: Phone System Mode State: SYS_SYS_MODE_WCDMA
2023-06-07 14:13:53: FTM Mode: OFF
2023-06-07 14:13:55: Waiting switch To Download Mode...
2023-06-07 14:13:59: Connecting Sahara Server COM15 1 times....
2023-06-07 14:14:04: saharaHandle=0x07c4, Version:0
2023-06-07 14:14:07: Connecting Sahara Server COM15 2 times....
2023-06-07 14:14:12: saharaHandle=0x07f8, Version:0
2023-06-07 14:14:14: Connecting Sahara Server COM15 3 times....
2023-06-07 14:14:19: saharaHandle=0x07f8, Version:0
2023-06-07 14:14:22: Connecting Sahara Server COM15 4 times....
2023-06-07 14:14:27: saharaHandle=0x07d4, Version:0
2023-06-07 14:14:29: Connecting Sahara Server COM15 5 times....
2023-06-07 14:14:34: saharaHandle=0x0780, Version:0
2023-06-07 14:14:37: Version: 0, MSMId: 0,SN: 0.
2023-06-07 14:14:37: Waiting Sahara_FlashProgrammer...
2023-06-07 14:14:37: Unable to download Flash Programmer using Sahara Protocol, Please repower No1 DUT.

Waiting switch To Download Mode... both red LEDs go off then one comes back on but not as bright.... Driver

image

QHSUSB__BULK image

droidblastnz commented 1 year ago

@droidblastnz This is the feedback you got from using AT+SICOMATI? If so, then this version of firmware is not suitable for you, please check the firmware name, they are M22 and G22 respectively, please confirm the current hardware version you need to update the firmware

image

Mine is LE20B03SIM7600M22 and your video shows LE20B03SIM7600G22

P/N:S2-1097D-Z307J;SN:MP06211763960A0;IMEI:868822041632330;SW:LE20B03SIM7600M22

lewisxhe commented 1 year ago

ohh ? Then I was wrong, if you are M22, then B03 will be the latest version, I will consult SIMCOM to see if there is a version of B04

droidblastnz commented 1 year ago

ohh ? Then I was wrong, if you are M22, then B03 will be the latest version, I will consult SIMCOM to see if there is a version of B04

This was the firmware for LE20B04V03SIM7600M22 but again cannot get the SIM to upload as per your instructions.

lewisxhe commented 1 year ago

I have arrived at a SIM7600 with the M22 version, I have a similar problem on the same side, and I have found this problem only for SIMCOM.

droidblastnz commented 1 year ago

Thanks so do you mean you have uploaded the B04 Firmware and same MQTT 8883 issue? I cant even get the firmware to load? Can you explain better please?

lewisxhe commented 1 year ago

I also can't upgrade the firmware.

droidblastnz commented 1 year ago

Thats not good then. What is the next step? Cant upgrade the firmware, cannot connect to MQTT 8883 only 1883 which is a public MQTT instance and not secure?

When you say can 'I also can't upgrade the firmware' you mean it fails at the ....


2023-06-07 14:13:55: Waiting switch To Download Mode...
2023-06-07 14:13:59: Connecting Sahara Server COM15 1 times....
2023-06-07 14:14:04: saharaHandle=0x07c4, Version:0
2023-06-07 14:14:07: Connecting Sahara Server COM15 2 times....
2023-06-07 14:14:12: saharaHandle=0x07f8, Version:0
2023-06-07 14:14:14: Connecting Sahara Server COM15 3 times....
2023-06-07 14:14:19: saharaHandle=0x07f8, Version:0
2023-06-07 14:14:22: Connecting Sahara Server COM15 4 times....
2023-06-07 14:14:27: saharaHandle=0x07d4, Version:0
2023-06-07 14:14:29: Connecting Sahara Server COM15 5 times....
2023-06-07 14:14:34: saharaHandle=0x0780, Version:0
lewisxhe commented 1 year ago

There is no way to upgrade, and SIMCOM didn't reply me how to deal with it, I have no choice, I try to use B03 to connect to MQTTS port 8883, it is normal.

AT+CMQTTSTART

+CGREG: 0,1

OK

SMS DONE

OK

+CMQTTSTART: 0
AT+CCERTDOWN="ca_cert.pem",1338

>-----BEGIN CERTIFICATE-----
MIIDrzCCApegAwIBAgIQCDvgVpBCRrGhdWrJWZHHSjANBgkqhkiG9w0BAQUFADBh
MQswCQYDVQQGEwJVUzEVMBMGA1UEChMMRGlnaUNlcnQgSW5jMRkwFwYDVQQLExB3
d3cuZGlnaWNlcnQuY29tMSAwHgYDVQQDExdEaWdpQ2VydCBHbG9iYWwgUm9vdCBD
QTAeFw0wNjExMTAwMDAwMDBaFw0zMTExMTAwMDAwMDBaMGExCzAJBgNVBAYTAlVT
MRUwEwYDVQQKEwxEaWdpQ2VydCBJbmMxGTAXBgNVBAsTEHd3dy5kaWdpY2VydC5j
b20xIDAeBgNVBAMTF0RpZ2lDZXJ0IEdsb2JhbCBSb290IENBMIIBIjANBgkqhkiG
9w0BAQEFAAOCAQ8AMIIBCgKCAQEA4jvhEXLeqKTTo1eqUKKPC3eQyaKl7hLOllsB
CSDMAZOnTjC3U/dDxGkAV53ijSLdhwZAAIEJzs4bg7/fzTtxRuLWZscFs3YnFo97
nh6Vfe63SKMI2tavegw5BmV/Sl0fvBf4q77uKNd0f3p4mVmFaG5cIzJLv07A6Fpt
43C/dxC//AH2hdmoRBBYMql1GNXRor5H4idq9Joz+EkIYIvUX7Q6hL+hqkpMfT7P
T19sdl6gSzeRntwi5m3OFBqOasv+zbMUZBfHWymeMr/y7vrTC0LUq7dBMtoM1O/4
gdW7jVg/tRvoSSiicNoxBN33shbyTApOB6jtSj1etX+jkMOvJwIDAQABo2MwYTAO
BgNVHQ8BAf8EBAMCAYYwDwYDVR0TAQH/BAUwAwEB/zAdBgNVHQ4EFgQUA95QNVbR
TLtm8KPiGxvDl7I90VUwHwYDVR0jBBgwFoAUA95QNVbRTLtm8KPiGxvDl7I90VUw
DQYJKoZIhvcNAQEFBQADggEBAMucN6pIExIK+t1EnE9SsPTfrgT1eXkIoyQY/Esr
hMAtudXH/vTBH1jLuG2cenTnmCmrEbXjcKChzUyImZOMkXDiqw8cvpOp/2PV5Adg
06O/nVsJ8dWO41P0jmP6P6fbtGbfYmbW0W5BjfIttep3Sp+dWOIrWcBAI+0tKIJF
PnlUkiaY4IBIqDfv8NZ5YBberOgOzW6sRBc4L0na4UU+Krk2U886UAb3LujEV0ls
YSEY1QSteDwsOoBrp+uvFRTp2InBuThs4pFsiv9kuXclVzDAGySj4dzp30d8tbQk
CAUw7C29C79Fv1C5qfPrmAESrciIxpg0X40KPMbp1ZWVbd4=
-----END CERTIFICATE-----

OK
AT+CSSLCFG="sslversion",0,4

OK
AT+CSSLCFG="authmode",0,1

OK
AT+CSSLCFG="cacert",0,"ca_cert.pem"

OK
AT+CSSLCFG="clientcert",0,"cert.pem"

ERROR
AT+CSSLCFG="clientkey",0,"key_cert.pem"

ERROR
AT+CMQTTSSLCFG=0,0

OK
AT+CMQTTREL=0

OK
AT+CMQTTACCQ=0,"Sim7600_fa7d2288",1

OK
AT+CMQTTCONNECT=0,"tcp://broker.emqx.io:8883",60,1

OK

+CMQTTCONNECT: 0,0

PB DONE

Manufacturer: SIMCOM INCORPORATED
Model: SIMCOM_SIM7600G-H
Revision: LE20B03SIM7600M22
SIM7600M22_B03V03_210525
QCN: 
SVN: 01
IMEI: 86882204249xxxxx
MEID: 
+GCAP: +CGSM
DeviceInfo: 173,170

OK
droidblastnz commented 1 year ago

Ok please can you try a private MQTT 8883 to HiveMQ not public but the free private connection and confirm?

HiveMQTT and emqx.io have a different certificate.