SMS Forwarding with OpenWRT and Gemini
Building an SMS verification code forwarder using a Qualcomm 410 USB WiFi device running OpenWRT and Gemini AI.
AI-Assisted SMS Forwarding with OpenWRT: A Clever Hack Using a $10 USB Dongle
Category: Automation | Tags: OpenWRT, Gemini AI, SMS Forwarding, Qualcomm 410, IoT Automation
Introduction: The Problem with Secondary SIM Cards
If you manage multiple phone numbers — a common scenario for developers using regional SIM cards, testing services, or maintaining separation between personal and professional accounts — you've almost certainly experienced the friction of verification codes arriving on the wrong device. Switching between phones just to read a six-digit OTP, then switching back, is a small but persistent annoyance that compounds throughout the day.
A developer known as @Kubai087 on X/Twitter found an elegant solution using hardware sourced from a local electronics market: a budget Qualcomm 410-based USB WiFi dongle, a Hong Kong ClubSIM card, and an SMS forwarding script generated by Gemini AI — all running on OpenWRT. The result is an always-on SMS relay that pushes verification codes directly to a primary device, with zero manual intervention.
This post breaks down how the setup works, how Gemini was used to accelerate the scripting, and how you can replicate or adapt it for your own multi-SIM workflow.
The Hardware: A $10 Device That Does Surprisingly More
The foundation of this build is a Qualcomm Snapdragon 410 (MSM8916)-based USB WiFi dongle, the kind commonly found at electronics flea markets and secondhand component stalls across Asia. These dongles are typically sold as portable 4G/LTE WiFi hotspots and are far more capable than their price suggests.
What makes them interesting for this use case:
- Built-in cellular modem supporting SMS send/receive via AT commands
- ARM-based processor capable of running a full Linux environment
- OpenWRT compatibility — with community firmware available for several Qualcomm 410 devices
- USB form factor — plug it into any powered USB port and it runs indefinitely
The vendor in this case had already flashed OpenWRT onto the device before sale, which is increasingly common in the Chinese electronics resale market. OpenWRT transforms the dongle from a simple hotspot into a fully programmable Linux router with package management, cron jobs, shell scripting, and network routing capabilities.
The SIM card used was a HK ClubSIM, a prepaid Hong Kong card well-suited for receiving international verification codes, particularly from services that require a non-mainland-China number. The combination — an OpenWRT-powered cellular device with a regional SIM — creates a persistent, network-connected SMS inbox.
The Script: Where Gemini AI Handles the Heavy Lifting
Here's where the workflow becomes particularly relevant to AI engineers and automation developers: rather than spending time researching OpenWRT's SMS handling APIs or reading through smstools3 documentation, @Kubai087 used Gemini to "vibe code" the entire forwarding script — a term increasingly used to describe iterative, conversational code generation with AI assistance.
The resulting script handles three key tasks:
- Polling the modem for incoming SMS messages via AT commands or OpenWRT's
smsutilities - Extracting and forwarding verification codes to a primary device (typically via HTTP webhook, Telegram bot, or a messaging API)
- Pushing status notifications so the user knows the relay is alive and functioning
A representative implementation using OpenWRT's built-in tools might look like this:
#!/bin/sh
# SMS Forwarder for OpenWRT + Qualcomm 410 Modem
# Forward incoming SMS to primary device via Telegram Bot
TELEGRAM_TOKEN="your_bot_token_here"
CHAT_ID="your_chat_id_here"
MODEM_DEV="/dev/ttyUSB2"
send_telegram() {
MESSAGE="$1"
curl -s -X POST "https://api.telegram.org/bot${TELEGRAM_TOKEN}/sendMessage" \
-d "chat_id=${CHAT_ID}" \
-d "text=${MESSAGE}" > /dev/null
}
read_sms() {
echo -e 'AT+CMGL="ALL"\r' | microcom -t 3000 ${MODEM_DEV}
}
# Poll for new messages every 30 seconds
while true; do
SMS_RAW=$(read_sms)
if echo "$SMS_RAW" | grep -q "+CMGL:"; then
SENDER=$(echo "$SMS_RAW" | grep "+CMGL:" | head -1 | cut -d'"' -f6)
BODY=$(echo "$SMS_RAW" | grep -A1 "+CMGL:" | tail -1)
send_telegram "📩 SMS from ${SENDER}:
${BODY}"
# Delete read messages to avoid re-sending
echo -e 'AT+CMGD=1,4\r' | microcom -t 2000 ${MODEM_DEV}
fi
sleep 30
done
This is a simplified illustration — the actual Gemini-generated script would include error handling, message deduplication, and status heartbeat pushes. The point is that a developer with basic shell scripting familiarity can prompt Gemini with their exact hardware setup, desired output channel, and edge cases, and receive a working script in minutes rather than hours.
Practical delivery channels worth considering:
- Telegram Bot API — low latency, no additional app required if you already use Telegram
- Bark / Pushover — iOS/Android push notification services with simple HTTP APIs
- NTFY — open-source self-hosted push notification server
- Webhook to a home server — store SMS in a database, build a web dashboard
Use Cases Beyond OTP Forwarding
While verification code forwarding is the immediate use case, this OpenWRT + modem + script stack unlocks a broader set of automation scenarios:
- Multi-region account management — developers maintaining service accounts tied to specific country numbers can receive their 2FA codes without carrying multiple phones
- IoT alerting via SMS — reverse the flow: send SMS alerts from your infrastructure and relay them into your chat platform of choice
- SIM monitoring for businesses — forward client-facing SMS lines into a team inbox, Slack channel, or ticketing system
- Automated SMS parsing — extend the script to extract structured data from SMS (e.g., bank alerts, delivery notifications) and trigger downstream automations
- Network failover testing — the USB dongle itself can serve as a cellular backup link for a home lab or small office
The low cost of entry — used dongles in the $5–$15 range, an inexpensive prepaid SIM, and a free-tier AI model — makes this a compelling weekend project with genuine everyday utility.
Conclusion: Small Hardware, Serious Automation
What makes this build worth writing about is not any single component in isolation. It's the combination: commodity hardware running open-source firmware, a regionally useful SIM card, and an AI assistant that collapses the scripting effort to near zero. The whole system sits in a USB port and runs indefinitely.
For developers working across multiple services, regions, or devices, persistent SMS forwarding is a quality-of-life improvement that's hard to appreciate until you have it. And with tools like Gemini handling the boilerplate — AT command syntax, polling loops, API integration — the barrier to building it has never been lower.
If you replicate this setup, the two variables most worth tailoring are your delivery channel (Telegram is the fastest path to a working demo) and your polling interval (balance responsiveness against modem wear). Everything else follows from the hardware and OpenWRT's well-documented tooling.
The original build by @Kubai087 is a clean example of the kind of low-overhead, high-utility automation that characterizes the best developer side projects: minimal cost, genuine usefulness, and an AI assist that makes the whole thing achievable in an afternoon.
Want to see more OpenWRT automation projects or AI-assisted scripting workflows? Follow ClawList.io for weekly breakdowns of developer tools, automation techniques, and OpenClaw skill builds.
Tags
Related Articles
Vercel's React Best Practices as Reusable Skill
Vercel distilled 10 years of React expertise into a skill, demonstrating how organizations should package internal best practices as reusable AI agent skills.
Building Commercial Apps with Claude Opus
Experience sharing on rapid app development using Claude Opus as a CTO, product manager, and designer combined.
AI-Powered Product Marketing with Video and Social Media
Guide on using AI to create product advertisement videos, user testimonials, and product images for social media marketing campaigns.