Hello all...
I am attempting to communicate with a SIM7600 from Waveshare (doc: https://www.waveshare.com/wiki/SIM7600E-H_4G_HAT) (schematic: https://www.waveshare.com/w/upload/c/c8/SIM7600E-H-4G-HAT-Schematic.pdf) via my ESP32 using Serial2. I have tested the SIM7600 with PuTTy (via USB to UART connection) and can confirm baud of 115200 and I was able to verify a few different commands that way. However, whenever I attempt to talk to it over the ESP32 serial pins, I don't get any responses when I send data (will put code and terminal info down below). What's interesting is if I power cycle the SIM7600, I see its boot up checks just fine (also below). I know this also is not a SIM7600 power supply issue as others have mentioned on the forums - I have a 5V 2.4A supply so that should be plenty.
Here are my connections:
ESP32 PIN 16 (RX) -> SIM7600 Control Interface PIN 3 (TXD)
ESP32 PIN 17 (TX) -> SIM7600 Control Interface PIN 4 (RXD)
SIM7600 UART Jumper: Position B (have tried the others as well)
Additional note if anyone needs to know...I am using VS Code PlatformIO.
Here is my code:
#include <Arduino.h>
#include "stdio.h"
#include "string.h"
#define DEBUG true
String sendData(String command, const int timeout, boolean debug)
{
String response = "";
Serial2.println(command);
long int time = millis();
while ( (time + timeout) > millis())
{
while (Serial2.available())
{
char c = Serial2.read();
response += c;
}
}
if (debug)
{
Serial.println("debug...");
Serial.print(response);
}
return response;
}
bool moduleStateCheck()
{
int i = 0;
bool moduleState = false;
for (i = 0; i < 5; i++)
{
String msg = String("");
msg = sendData("AT", 1000, DEBUG);
if (msg.indexOf("OK") >= 0)
{
Serial.println("SIM7600 Module had turned on.");
moduleState = true;
return moduleState;
}
delay(1000);
}
return moduleState;
}
void setup()
{
Serial.begin(9600);
//Serial2.begin(115200);
Serial2.begin(115200, SERIAL_8N1, 16, 17);
delay(3000);
Serial.println("4G HTTP Test Begin!");
delay(1000);
}
void loop()
{
Serial.println("Lets test the SIM7600");
delay(1000);
Serial.println("Sending...");
sendData("AT",2000,DEBUG);
delay(5000);
}
Here is what the terminal is showing while running the code...
Lets test the SIM7600
Sending...
debug...
AT
Lets test the SIM7600
Sending...
debug...
AT
Lets test the SIM7600
Sending...
debug...
AT
Here is what I see after power cycling the SIM7600:
RDY
+CPIN: READY
SMS DONE
PB DONE
Any advice would be greatly appreciated!!
Thanks in advance!