Page 1 of 1

SMS Text from SIM7600E-H not working

Posted: Thu Apr 01, 2021 1:16 am
by Chief
Newbie here. I have loaded up the sim7600test sketch provided by the good folks at Freematics. Attempting to add SMS Text message to it. I'm using a Hologram SIM with SMS capability. The connection test to the HTTP server is reporting as OK, however when I send a SMS message I do not receive it on my phone. Anyone got this working?
The following is code from the sim7600test.ino file

Code: Select all

#include <lib/FreematicsPlus.h>

// testing URL: https://hub.freematics.com/test
#define SERVER_HOST "hub.freematics.com"
#define SERVER_PORT 443
#define SERVER_PATH "/test"
#define CELL_APN "hologram"
#define CONN_TIMEOUT 5000

FreematicsESP32 sys;
HTTPClientSIM7600 net;
int errors = 0;

bool init_net()
{
    Serial.print("Init cellular module...");
    if (net.begin(&sys)) {
      Serial.print(net.deviceName());
      Serial.println(" OK");
    } else {
      Serial.println("NO");
      return false;
    }
    Serial.print("IMEI:");
    Serial.println(net.IMEI);

    if (net.checkSIM()) {
      Serial.println("SIM Card OK");
    } else {
      Serial.println("No SIM Card");
    }
    Serial.print("Registering on network...");
    if (net.setup(CELL_APN)) {
      Serial.println("OK");
    } else {
      Serial.println("NO");
      return false;
    }
    String op = net.getOperatorName();
    if (op.length()) {
      Serial.print("Operator:");
      Serial.println(op);
    }
    Serial.print("Obtaining IP address...");
    String ip = net.getIP();
    if (ip) {
      Serial.println(ip);
    } else {
      Serial.println("N/A");
    }
    int signal = net.getSignal();
    if (signal) {
      Serial.print("RSSI:");
      Serial.print(signal);
      Serial.println("dBm");
    }
    Serial.print("Init HTTPS stack...");
    if (net.open()) {
      Serial.println("OK");
    } else {
      Serial.println("NO");
    }
    return true;
}
void setup()
{
  Serial.begin(115200);
  // use following for Freematics ONE+
  sys.begin();
  // use following for Freematics Esprit or other ESP32 dev board
  //sys.xbBegin(115200, 16, 17);

  // initialize cellular module
  while (!init_net());
}

void loop()
{
  if (errors > 10) {
    // re-initialize cellular module
    net.end();
    if (init_net()) {
      Serial.println("OK");
      errors = 0;
    } else {
      Serial.println("NO");
      delay(3000);
      return;
    }
  }
//Lets test SMS (my added code)
{
  Serial.write("AT+CMGF=1\r");
  delay(500);
  
  /*Number to send SMS to*/
  Serial.print("AT+CMGS=\"+886123456789\"\r");
  delay(500);
  Serial.print("\rHELLO World from SMS\r\n");
  delay(500);
  Serial.write(0x1A);
  Serial.print("Sent!!");
  delay(1000); 
  Serial.println("Waiting 1 Minute...");
  delay(60000);
    }
    
My code excerp from above thats inside the void loop

Code: Select all

 //Lets test SMS 
{
  Serial.write("AT+CMGF=1\r");
  delay(500);
  
  /*Number to send SMS to*/
  Serial.print("AT+CMGS=\"+886123456789\"\r");
  delay(500);
  Serial.print("\rHELLO World from SMS\r\n");
  delay(500);
  Serial.write(0x1A);
  Serial.print("Sent!!");
  delay(1000); 


  Serial.println("Waiting 1 Minute...");
  delay(60000);

    }
output is as follows

Code: Select all

Init cellular module...SIM7600E-H OK
IMEI:12345678
SIM Card OK
Registering on network...OK
Operator:TW Mobile Hologram
Obtaining IP address...10.81.167.111
RSSI:-67dBm
Init HTTPS stack...OK
HELLO World from SMS
␚Sent!!Waiting 1 Minute...
I'm guessing that I havent setup the modem correctly, but just not sure?
Any help would be appreciated.