Hello guys,
I am trying to use "Waveshare_SIM7600.h"
you can find the library here:
I am using the library, in order to write serial MQTT AT commands using the "sendATcommand()" function.
The problem is that there is no response from the module it is only printing the commands!. I think there is missing code which is software serial: include"Softwareserial" is not added in the library.
How could I fix this?
CODE:
#include "Waveshare_SIM7600.h"
int POWERKEY = 2;
char APN[] = "";
char aux_string[60];
char ServerIP[] = "";
char Port[] = "1883";
char Publish[] = "";
char Subscribe[] = "";
char Message[] = "Waveshare";
char CLIENT[] = "";
char User[] = "";
char Pass[] = "*";
int i = 0, j;
void setup() {
Serial.begin(115200);
sim7600.sendATcommand("AT&F", "OK", 2000);//redefine the module configurations
sim7600.sendATcommand("AT+CPIN?", "+CPIN: READY", 2000);
sim7600.sendATcommand("AT+CSQ", "+CSQ: 7,99", 2000);/check the signal
sim7600.sendATcommand("AT+CREG?", "+CREG: 0,1", 2000);
sim7600.sendATcommand("AT+CPSI?", "LTE", 2000);//check if connected to 4G
sim7600.sendATcommand("AT+CGREG?", "+CGREG: 0,1", 2000);
sprintf(aux_string, "AT+CGDCONT=1,"IP","%s"", APN);
sim7600.sendATcommand(aux_string, "OK", 2000); //APN setting
sim7600.sendATcommand("AT+CGPADDR", "+CGPADDR: 1,0.0.0.", 2000);//IP ADRESS
memset(aux_string, '\0', 30);
sim7600.sendATcommand2("AT+CMQTTSTART", "OK","+CMQTTSTART: 23", 5000); //Start MQTT
sprintf(aux_string, "AT+CMQTTACCQ=0,"%s"", CLIENT);
sim7600.sendATcommand2(aux_string, "OK","+CMQTTACCQ: 0,19", 2000); //ACCQUIRE CLIENT
delay(50);
memset(aux_string, '\0', 30);
sim7600.sendATcommand("AT+CMQTTWILLTOPIC=0,6", ">", 2000);//CONNECTION WILL TOPIC
sim7600.sendATcommand("/", "OK", 500);
sim7600.sendATcommand("AT+CMQTTWILLMSG=0,6,1", ">", 500);//CONNECTION WILL MSG
sim7600.sendATcommand("/", "OK", 500);
sim7600.sendATcommand("at+cmqttconnect=0,"tcp://:1883",6000,1,"",""", "+CMQTTCONNECT: 0,0", 5000);//CONNECT TO BROKER
memset(aux_string, '\0', 30);
sim7600.sendATcommand("AT+CMQTTSUB=0,6,1", ">", 2000); //SUBSCRIBE A TOPIC
sim7600.sendATcommand("/*", "OK", 2000);
}
void loop() {
}
Response:
AT&F
AT+CPIN?
AT+CSQ
.
.
.
.
etc