Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
[arduino code examples for G1]-05 GSM test
#1
Code:
#include <HardwareSerial.h>

// Define serial port
HardwareSerial SimSerial(1); // Use hardware serial port 1 (GPIO9 and GPIO10)

void setup() {
  // Initialize USB serial port (default serial port 0)
  Serial.begin(115200);
  while (!Serial) {
    ; // Wait for USB serial port to connect
  }

  // Initialize SIM7600 serial port
  SimSerial.begin(115200, SERIAL_8N1, 9, 10); // RX=GPIO9, TX=GPIO10
  //Serial.println("ESP32-S3 begin work");
}

void loop() {
  // If data is received from the computer, forward it to the SIM7600 module
  if (Serial.available()) {
    while (Serial.available()) {
      char data = Serial.read();
      SimSerial.write(data);
    }
  }

  // If data is received from the SIM7600 module, forward it to the computer
  if (SimSerial.available()) {
    while (SimSerial.available()) {
      char data = SimSerial.read();
      Serial.write(data);
    }
  }
}
arduino ino file download: 

.zip   5-GSM-Test.zip (Size: 598 bytes / Downloads: 12)
BIN file (you can use esp32 download tool download to ESP32-S3 with address 0x0 then directly to use) download: 

.zip   5-GSM-Test.ino.merged.zip (Size: 184.08 KB / Downloads: 15)
Reply


Forum Jump:


Users browsing this thread:
1 Guest(s)