Thinger.IO client setup for GSM Sim800 enabled ESP32 project

I’m unable to connect to Thinger.io using the code below. I would like to know how it’s possible to connect to Thinger.io using GSM Sim800 with ESP32. If possible, also provide the schematic of the hardware.

#define THINGER_SERIAL_DEBUG

// Select your modem:
#define TINY_GSM_MODEM_SIM800
//#define TINY_GSM_MODEM_SIM900
//#define TINY_GSM_MODEM_A6
//#define TINY_GSM_MODEM_A7
//#define TINY_GSM_MODEM_M590

// Can be installed from Library Manager or https://github.com/vshymanskyy/TinyGSM
#include <TinyGsmClient.h>
#include <ThingerTinyGSM.h>
#include "arduino_secrets.h"

// Emulate Serial1 on pins 10/11 if HW is not present (use interrupt pin in RX for better performance)
#ifndef HAVE_HWSERIAL1
//#include "SoftwareSerial.h"
//SoftwareSerial Serial1(10, 11); // RX, TX
#endif

ThingerTinyGSM thing(USERNAME, DEVICE_ID, DEVICE_CREDENTIAL, Serial1);

void setup() {
  // open serial for debugging
  Serial.begin(115200);

  // Serial for AT commands (can be higher with HW Serial, or even lower in SW Serial)
  Serial1.begin(57600);

  // set APN (you can remove user and password from call if your apn does not require them)
  thing.setAPN(APN_NAME, APN_USER, APN_PSWD);

  // set PIN (optional)
  // thing.setPIN(CARD_PIN);

  // resource input example (i.e, controlling a digitalPin);
  pinMode(LED_BUILTIN, OUTPUT);
  thing["led"] << digitalPin(LED_BUILTIN);

  // resource output example (i.e. reading a sensor value)
  thing["millis"] >> outputValue(millis());

  // more details at http://docs.thinger.io/arduino/
}

void loop() {
  thing.handle();
}

I’m receiving the error in the screenshot below. Kindly help.

Hi, I use this sketch

// Select your modem:
#define TINY_GSM_MODEM_SIM800

// uncomment line for debug
//#define _DEBUG_

// Can be installed from Library Manager or https://github.com/vshymanskyy/TinyGSM
#include <TinyGsmClient.h>
#include <ThingerTinyGSM.h>

HardwareSerial Serial4(2);

#define USERNAME "xxxx"
#define DEVICE_ID "yyyy"
#define DEVICE_CREDENTIAL "zzzz"

#define APN_NAME "kkkk"
#define APN_USER ""
#define APN_PSWD ""

// set your cad pin (optional)
#define CARD_PIN ""
#define LED_BUILTIN 13

ThingerTinyGSM thing(USERNAME, DEVICE_ID, DEVICE_CREDENTIAL, Serial4);
// ThingerESP32OTA ota(thing);

void setup() {
  // uncomment line for debug
  // Serial.begin(115200);

  Serial4.begin(115200);

  // set APN (you can remove user and password from call if your apn does not require them)
  thing.setAPN(APN_NAME, APN_USER, APN_PSWD);

  // set PIN (optional)
  // thing.setPIN(CARD_PIN);

  // resource input example (i.e, controlling a digitalPin);
  pinMode(LED_BUILTIN, OUTPUT);

  thing["led"] << digitalPin(LED_BUILTIN);

  // resource output example (i.e. reading a sensor value)
  thing["millis"] >> outputValue(millis());

  // more details at http://docs.thinger.io/arduino/
}

void loop() {
  thing.handle();
}

And connect the modem to pins 16 and 17, it is a hardware serial port, behaves better than the software serial emulated ports.

At esp the pins are:
RX2 16
TX2 17

Hope this helps.

1 Like

Thanks it works. :+1: :+1: Though the connection isn’t stable. I think it’s an issue to do with the power supply