As I discussed earlier in my previous post, one of the use cases of RBox is for management of remotely deployed GSM-sim card for sending/receiving sms. You might wonder why would someone deploy their Sim card in a remote location rather than inserting it in a phone and keeping it close to your body. Well, there are many reasons why remotely deployed sim card would make sense, so far I could think of following reasons(do let me know in comments section if there are other use cases).
- When on international travel, your sim-card may not have roaming feature enabled.
- You might be located outside gsm coverage area, but you are in need of sms send/receive functionality.
- You may have multiple sim cards, but want to access them from centralized location.
- You might want to setup your own sms-gateway for sending/receiving sms over internet.
- You might have remotely deployed sensors sending the data via sms, and you want to collect all sms data from a central gateway.
There might be many other reasons why someone would deploy their SIM card remotely, but whatever you decide to do with this kind of setup, ensure that your SIM card is deployed at a safe and secure location to avoid possible misuse.
In simple words, this solution allows you to keep your SIM card connected to the internet and you can access it from your xmpp-client(or google-hangout) using your handheld mobile device.
You need following items to prepare this setup:
- SDCard image(download it from here, RBox is an open source project hosted on github)
- Raspberry pi
B orB+ - Micro or full size SDCard
- Huawei E173 USB 3G stick
- Sim card(ensure that SIM is not locked with pin)
- 5V/2A power supply.
- Two google(or jabber) accounts(one for you, second for your raspi)
Solution shown above, uses Huawei e173 USB 3G Modem connected to your Raspberry pi B+ and further on Raspi is connected to internet via home router. Here you can find the details about preparing the SDCard. If everything goes well, you shall see raspi being online on your android xabber app(or on your google-hangout). Send "Help" chat message and the raspi will reply will list of supported commands.
You will notice that when RBox is booted without USB-3G-stick, sms/sim related commands from the "Help" list will be missing because of missing USB-3G-stick hardware.
Before switching on the setup, ensure that password-unlocked SIM card is inserted into USB-3G-stick and a 2Amp capable 5V power supply shall be used.
Note: Ensure that both the google(or jabber) accounts are known to each other by authorizing the contact, you have to do this separately on your PC before switching ON the raspi.
How to read SMS?
- Send "Smsupdate"
- Immediate reply "InProgress : taskID=1" will be received
- nothing happens for 3-to-5seconds(dont panic, just wait)
- If everything goes well, reply "Success : taskID=1" will be received, else "Fail : taskID=1".
- Send "Smstotal"
- reply will look like: "Success : 2" this means total 2 messages are read from sim to cache
- send "Smsget 0" to read first message, or "Smsget 1" to read second message.
How to delete all SMS?
- Send "Smsdeleteall"
- Immediate reply "InProgress : taskID=2" will be received
- nothing happens for 3-to-5seconds(dont panic, just wait)
- If everything goes well, reply "Success : taskID=2" will be received, else "Fail : taskID=2"
- To know if all messages are delete, follow the steps above in section "How to read SMS"
- If you notice there are still undeleted messages, Repeat the step 1 to 4(hopefully in future version of RBox this problem will be fixed).
How to send SMS?
- Send "Smssend 009198xxxxxxxx hello this is a test message"
- Immediate reply "InProgress : taskID=3" will be received
- nothing happens for 3-to-5seconds(dont panic, just wait)
- If everything goes well, reply "Success : taskID=3" will be received, else "Fail : taskID=3"
- If you notice sms was not sent, just skip "0091" international+country code and try again.
How to do voice dialling?
- Send "Dialvoice 009198xxxxxxxx"
- Immediate reply "InProgress : taskID=4" will be received
- nothing happens for 20 to 25seconds(dont panic, just wait, dialling might be in progress)
- Call ringing will happen for 20 to 25seconds, if caller picks the call, then he will hear nothing
- After 25seconds call will be disconnected automatically and reply "Success : taskID=4" will be received.
- As of now, there is no specific use of this blank call, but future RBox release would include auto playback of recorded message to notify certain events for automation use case.
How to Dial USSD codes like *101#(useful for knowing balance amount of prepaid SIM)?
- Send "Dialussd *101#" (this number may vary depending on the provider)
- Immediate reply "InProgress : taskID=5" will be received
- nothing happens for 3-to-5seconds(dont panic, just wait)
- If everything goes well, reply "Success : taskID=5" will be received, else "Fail : taskID=5"
- Send "Readussd" to know the return text of last ussd-dial.