ESP32 + sim800c

Hello all gurus, did anyone try interfacing SIM800C with ESP32? I tried run it using ThingerTinyGSM library but it does not work at all. Meanwhile, it running well on an arduino Uno board.

OK guys, just figured out to make this thing work. I post my wiring diagram and the code for anyone who wish to use it, as a reference. Just make sure the voltage of sim800c (or variant) output TTL is 3.3V, because ESP32 only works under 3.3V, 5V might be over-voltage and burn your chip! *careful! The sim800c module consume a lot current during establish connection to the network, hence, to be safe, supply at least 2A current 5V voltage to the module.

code:

#define TINY_GSM_MODEM_SIM800

#define DEBUG //enable debug mode

#include <TinyGsmClient.h>
#include <ThingerTinyGSM.h>

HardwareSerial Serial1(1); //using hardware serial

#define USERNAME “xxxxxxxx”
#define DEVICE_ID “xxxxxxxx”
#define DEVICE_CREDENTIAL “xxxxxxxxx”

// use your own APN config
#define APN_NAME “xxxxxx”
#define APN_USER “”
#define APN_PSWD “”

// set your cad pin (optional)
#define CARD_PIN “”

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

// define your board pin here
#define LED_PIN 27

void setup() {
pinMode(LED_PIN, OUTPUT);

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

// define hardware serial setting, make sure it is same with the sim800 module.
// usage : Serial1.begin(baudrate, SERIAL_8N1, rxPin, txPin)
Serial1.begin(9600, SERIAL_8N1, (int8_t) 17, (int8_t) 16);

// 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);

// digital pin control example (i.e. turning on/off a light, a relay, configuring a parameter, etc)
thing[“led”] << digitalPin(LED_PIN);

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

}

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

I compiled the code by using Arduino IDE. You can find the library here : GitHub - espressif/arduino-esp32: Arduino core for the ESP32

1 Like

I am getting error