Skip to content

September999999999/esp32-sms-gateway

Repository files navigation

USB CDC 4G Module (SMS Gateway)

Firmware for ESP32-S2 / ESP32-S3 that uses a USB CDC 4G modem only for receiving SMS, then forwards incoming messages over Wi-Fi (e.g. Bark push notifications).

Features

  • USB CDC host communication
  • Receive SMS (AT URC notification)
  • Forward SMS over Wi-Fi (optional Bark push)
  • Periodic keepalive SMS (optional, to keep SIM active)
  • One-shot test SMS on boot (optional)
  • Status LED indicator

Hardware requirement

Supported ESP SoC:

  • ESP32-S2
  • ESP32-S3

Quick start

  1. Install ESP-IDF (project requires >= 4.4.1, see main/idf_component.yml).

  2. Export ESP-IDF environment.

  3. Set build target:

    idf.py set-target esp32s2
    # or: idf.py set-target esp32s3
  4. Configure in menuconfig:

    • Wi-Fi STA credentials used by the firmware: CONFIG_MODEM_WIFI_SSID / CONFIG_MODEM_WIFI_PASSWORD
    • SMS forwarding to Bark (optional): EXAMPLE_BARK_ENABLE / EXAMPLE_BARK_KEY / EXAMPLE_BARK_GROUP
    • Keepalive SMS (optional): EXAMPLE_KEEPALIVE_ENABLE / EXAMPLE_KEEPALIVE_TARGET / EXAMPLE_KEEPALIVE_DAYS
    • One-shot test SMS (optional): EXAMPLE_TEST_SMS_ON_BOOT
  5. Build/flash/monitor:

    idf.py build flash monitor

Safety notes

  • Do not publish personal credentials in sdkconfig. This repo uses sdkconfig.defaults as a safe baseline.
  • SMS sending (keepalive / one-shot test SMS) may incur charges. They are disabled by default.

Keepalive SMS mechanism

When EXAMPLE_KEEPALIVE_ENABLE is enabled, the firmware will:

  • Sync time via NTP (CONFIG_NTP_SERVER, default ntp.aliyun.com)
  • Store last keepalive timestamp in NVS
  • Check every hour (KEEPALIVE_CHECK_INTERVAL_MS) and send an SMS to EXAMPLE_KEEPALIVE_TARGET once the interval (EXAMPLE_KEEPALIVE_DAYS) is due

License

Apache-2.0. See LICENSE, NOTICE, and THIRD_PARTY_NOTICES.md.

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors