Git Product home page Git Product logo

webmasterkai / gsm-modem-sms-parser-bash-openwrt Goto Github PK

View Code? Open in Web Editor NEW

This project forked from pratikfarkase94/gsm-modem-sms-parser-bash-openwrt

0.0 1.0 0.0 718 KB

After searching for lot of forums for parsing incoming SMS from GSM modems, i ran out of options as no forum mentions how to parse the incoming SMS from GSM modems, I finally had a chance and was successful at parsing the incoming messages in proper format. Anyone who has trouble parsing the messages will find this these scripts helpful. Adding on, i have developed some functions for GSM modem for sending SMS, reading and Parsing SMS, Deleting, getting signal info, and sim card status. All are written in Bash shell scripting on Openwrt and tested with 3 modems i got a chance to work with : QUECTEL: EC-25E, HUAWEI: ME909s-821 and SIMCOM: SIM7100E.

Shell 100.00%

gsm-modem-sms-parser-bash-openwrt's Introduction

GSM-modem-SMS-Parser-Bash-Openwrt

After searching for lot of forums for parsing incoming SMS from GSM modems, i ran out of options as no forum mentions how to parse the incoming SMS from GSM modems, I finally had a chance and was successful at parsing the incoming messages in proper format. Anyone who has trouble parsing the messages will find this tutorial helpful.

Adding on, i have developed some functions for GSM modem for sending SMS, reading and Parsing SMS, Deleting, getting signal info, and sim card status. All are written in Bash shell scripting on Openwrt and tested with 3 modems i got a chance to work with : QUECTEL: EC-25E, HUAWEI: ME909s-821 and SIMCOM: SIM7100E. These functions can run on any linux system like RaspberryPi or BeagleBone Black, provided you have installed proper drivers for the GSM modem and are able to send AT commands to the modems, have bash shell installed and have comgt utility installed.

To get them to work, make sure you have comgt utility installed on your linux. If not, you can install it by sudo apt-get install comgt. If you can communicate with your GSM modem via AT commands, that means you are ready to run these scripts.

  1. First Script function is the sendSMS.sh for sending SMS. Run the script as root@Openwrt:# bash sendSMS.sh, It will first check if the SIM Card has been inserted, if not then it will throw SIM error message and terminate. If it detects SIM, it will first change the SMS mode to text mode and then prompt you for destination number and then the message text. If it send SMS successfully, it will throw ####SMS SENT#### or if not then ###SMS Not Sent###. See the picture below for more clarity.

alt text

  1. Second Script function is the readSMS.sh for reading and parsing SMS. Run the script as root@Openwrt:# bash readSMS.sh, It will first check if the SIM Card has been inserted, if not then it will throw SIM error message and terminate. If it detects SIM, it will first change the SMS mode to text mode and then start parsing and reading messages one by one in the manner like:-

                                Total number of received messages = <number of messages>
                                Message : <MessageNumber>
                                Number  : <Sender's Number>
                                Status  : <READ/UNREAD>
                                Date    : <Message arrival date>
                                Time    : <Message arrival Time>
                                Message : <Message Text>
    

    See the Picture below for better clarity

alt text

  1. Third Script function is the deleteSMS.sh for Deleting SMS. Run the script as root@Openwrt:# bash deleteSMS.sh, It will first check if the SIM Card has been inserted, if not then it will throw SIM error message and terminate. If it detects SIM, it will ask you for the message number to be deleted and will delete the message with message number you entered. See the Picture below for better clarity

alt text

  1. Fourth Script function is the sigInfo.sh for Getting signal strength. Run the script as root@Openwrt:# bash sigInfo.sh. The function will return the signal strength as numerical value as well as alphabetical. See the Picture below for better clarity

alt text

  1. Fifth Script function is the simStatus.sh for Getting SIM card status. Run the script as root@Openwrt:# bash sigInfo.sh. The function will return the status of SIM card. If the SIM is inserted and if it detects, then it tells that SIM card is inserted, if not inserted then throws you error of SIM card not inserted. See the Picture below for better clarity

alt text

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.