Remote management of a GSM SIM card using a Raspberry Pi B+ and a Huawei E173 USB 3G modem. The RBox chat-bot connects to an XMPP/Jabber server and lets you send/receive SMS, make voice calls, and dial USSD codes — all from your phone's chat app, anywhere in the world.
Why remote SIM management?
- Your SIM card has no roaming and you're travelling internationally
- You're outside GSM coverage but have internet access and need SMS functionality
- You manage multiple SIM cards and want centralized access
- You need a self-hosted SMS gateway for sending/receiving over the internet
- You have remote sensors that report data via SMS and want a central collection point
Ensure your SIM card is deployed at a safe and secure location to avoid possible misuse.
Items needed
- Raspberry Pi B+
- Micro or full-size SD card
- Huawei E173 USB 3G stick
- SIM card (PIN lock must be disabled)
- 5 V / 2 A power supply
- Two Google or Jabber accounts (one for you, one for the Raspberry Pi)
- RBox SD card image
Setup
Setup diagram — Huawei E173 plugged into the Raspberry Pi, which connects to the internet through a home router.
- Flash the RBox SD card image (see the RBox setup guide for details)
- Insert the PIN-unlocked SIM card into the Huawei E173 and plug it into the Raspberry Pi
- Connect the Raspberry Pi to your home router via Ethernet and power on with a 2 A supply
- On your phone's XMPP client (Xabber, Conversations, etc.), check that the Raspberry Pi account is online
- Send
Help— the bot replies with the list of supported commands
Both XMPP accounts must be authorized as contacts before the Raspberry Pi is powered on — do this from a PC first.
When RBox boots without the USB 3G stick connected, SMS/SIM-related commands will not appear in the help list.
Reading SMS
- Send
Smsupdate— immediate reply:InProgress : taskID=1 - Wait 3–5 seconds for the modem to read the SIM
- Reply
Success : taskID=1confirms messages are cached - Send
Smstotal— reply shows the count (e.g.Success : 2) - Send
Smsget 0to read the first message,Smsget 1for the second, etc.
Deleting SMS
- Send
Smsdeleteall— immediate reply:InProgress : taskID=2 - Wait 3–5 seconds
- Reply
Success : taskID=2confirms deletion - Verify with
Smsupdatefollowed bySmstotal— if messages remain, repeat the delete
Sending SMS
- Send
Smssend 009198xxxxxxxx hello this is a test message - Immediate reply:
InProgress : taskID=3 - Wait 3–5 seconds — reply
Success : taskID=3confirms the SMS was sent - If sending fails, try omitting the international/country code prefix (
0091)
Voice dialling
- Send
Dialvoice 009198xxxxxxxx - Immediate reply:
InProgress : taskID=4 - The modem dials and rings for 20–25 seconds, then disconnects automatically
- Reply
Success : taskID=4confirms the call completed
Voice dialling currently places a silent call (no audio playback). Future RBox releases may support playing a recorded message for automation use cases.
USSD codes
USSD codes like *101# are useful for checking prepaid balance and other carrier queries.
- Send
Dialussd *101#(the code varies by carrier) - Immediate reply:
InProgress : taskID=5 - Wait 3–5 seconds — reply
Success : taskID=5confirms the USSD response was received - Send
Readussdto read the carrier's response text
SOURCE CODE
github.com/hackboxguy/brbox — RBox sources and build instructions
4 comments:
sir this is a great project. i want to ask you a question. how to send a message to multiple numbers using this setup. or how to create a list. concept of bulk sms.
Very informative article, for those who wants to stay connected with everyone even when they are traveling or not have cell phone/Sim card with them, can get beneficial from RBox.
Hello Albert,
Thanks for this article. I got to this page from your post on Quora "How do you start your own SMS gateway?" I am in the US and developing some applications that will target users from Cameroon(Africa) and I will like to setup my own gateway to send sms to people in Cameroon if possible. Will your solution work or is limited to the US. How can I make it work for sending sms to Cameroon or through whatsapp?
I've created an open source soulution built using PHP and mysql you can find it at https://selfhostedsms.com It has integration with more than 150 gateways or even your own device, you should have a look
Post a Comment