Created
July 15, 2024 03:14
-
-
Save leighghunt/016f615ba5af4816482cd7d264b68411 to your computer and use it in GitHub Desktop.
Support/examples for accessing cellular/LTE on ESP32-S3-SIM7670G-4G
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <Arduino.h> | |
static const int RXPin = 17, TXPin = 18; | |
static const uint32_t GPSBaud = 115200; | |
String rev; | |
void SentSerial(const char *p_char) { | |
for (int i = 0; i < strlen(p_char); i++) { | |
Serial1.write(p_char[i]); | |
delay(10); | |
} | |
Serial1.write('\r'); | |
delay(10); | |
Serial1.write('\n'); | |
delay(10); | |
} | |
bool SentMessage(const char *p_char, unsigned long timeout = 2000) { | |
SentSerial(p_char); | |
unsigned long start = millis(); | |
while (millis() - start < timeout) { | |
if (Serial1.available()) { | |
rev = Serial1.readString(); | |
if (rev.indexOf("OK") != -1) { | |
Serial.println("Got OK!"); | |
return true; | |
} | |
} | |
} | |
Serial.println("Timeout!"); | |
return false; | |
} | |
void setup() { | |
Serial.begin(115200); | |
Serial1.begin(GPSBaud, SERIAL_8N1, RXPin, TXPin); | |
while (!SentMessage("AT", 2000)) { | |
delay(1000); | |
} | |
SentMessage("ATD10086;", 2000); | |
SentSerial("ATE1;"); | |
SentSerial("AT+COPS?"); | |
SentSerial("AT+CGDCONT?"); | |
SentSerial("AT+SIMCOMATI"); | |
} | |
void loop() { | |
if (Serial1.available()) { | |
rev = Serial1.readString(); | |
Serial.println(rev); | |
} | |
} |
Thanks boss for the advice and guidance. I appreciate it a lot! but
didnt work at those libraries need to reverse engineer those codes to make
it functional , its really pain to work with AT commands my first time to
deal with.
…On Tue, Mar 11, 2025 at 10:03 AM Leigh Hunt ***@***.***> wrote:
***@***.**** commented on this gist.
------------------------------
But have you successfully execute sms in your waveshare module?
From memory this was for sending messages (i.e. AT Commands) over serial
to the AT chip (whilst I was trying to establish network access) - not
sending text messages over SMS. The example function names can be slightly
misleading.
Some examples out there that might help:
Using TinyGSM library to send SMS (don't think it supports receiving SMS):
https://github.com/search?q=repo%3Avshymanskyy%2FTinyGSM+sendsms&type=issues
This might also be helpful:
https://github.com/vshymanskyy/TinyGSM/blob/master/examples/AllFunctions/AllFunctions.ino
If instead of using a library, you want to use AT commands directly, the
AT Command Manual (e.g.
https://files.waveshare.com/wiki/ESP32-S3-SIM7670G-4G/SIM767XX_Series_AT_Command_Manual_V1.01.pdf)
might be helpful.
I *think* the command you're after is AT+CMGS, but they're a pain to work
with.
—
Reply to this email directly, view it on GitHub
<https://gist.github.com/leighghunt/016f615ba5af4816482cd7d264b68411#gistcomment-5483747>
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/BQKUN4EXWYQXN7SCOA4WJGL2TY77HBFKMF2HI4TJMJ2XIZLTSKBKK5TBNR2WLJDUOJ2WLJDOMFWWLO3UNBZGKYLEL5YGC4TUNFRWS4DBNZ2F6YLDORUXM2LUPGBKK5TBNR2WLJDHNFZXJJDOMFWWLK3UNBZGKYLEL52HS4DFVRZXKYTKMVRXIX3UPFYGLK2HNFZXIQ3PNVWWK3TUUZ2G64DJMNZZDAVEOR4XAZNEM5UXG5FFOZQWY5LFVEYTGMJTHA2TIOBRU52HE2LHM5SXFJTDOJSWC5DF>
.
You are receiving this email because you commented on the thread.
Triage notifications on the go with GitHub Mobile for iOS
<https://apps.apple.com/app/apple-store/id1477376905?ct=notification-email&mt=8&pt=524675>
or Android
<https://play.google.com/store/apps/details?id=com.github.android&referrer=utm_campaign%3Dnotification-email%26utm_medium%3Demail%26utm_source%3Dgithub>
.
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
From memory this was for sending messages (i.e. AT Commands) over serial to the AT chip (whilst I was trying to establish network access) - not sending text messages over SMS. The example function names can be slightly misleading.
Some examples out there that might help:
Using TinyGSM library to send SMS (don't think it supports receiving SMS): https://github.com/search?q=repo%3Avshymanskyy%2FTinyGSM+sendsms&type=issues
This might also be helpful: https://github.com/vshymanskyy/TinyGSM/blob/master/examples/AllFunctions/AllFunctions.ino
If instead of using a library, you want to use AT commands directly, the AT Command Manual (e.g. https://files.waveshare.com/wiki/ESP32-S3-SIM7670G-4G/SIM767XX_Series_AT_Command_Manual_V1.01.pdf) might be helpful.
I think the command you're after is
AT+CMGS
, but they're a pain to work with.