Giter Club home page Giter Club logo

g4_sms_cat's Introduction

项目: Linux 4G短信猫

项目流程图

image

项目介绍

逻辑介绍

树莓派连接EC20 4G模块,编写程序实现PPP智能拨号上网控制和短信猫功能,该程序采用多线程编程模型 实现相应模块功能控制。其中这些模块包括: (1)PPP拨号上网模块,该模块实现实时监测以太网、WiFi网卡的联网情况,如果上述网络断线则自动切换到 4G拨号上网;一旦以太网、WiFi联网后就自动断开4G连接; (2)网络Socket模块,该模块采用libevent库监听socket相应端口,等待网络客户端的连接并进行登录认证。 身份认证成功后,客户端可以通过网络socket与服务器进行长连接通信实现短信的收发功能;其中网络 socket客户端与服务器之间的通信采用JSON格式,登录验证时,用户名与密码的报文采用MD5进行加密; (3)SMS模块,该模块分为两个子模块,分别是与串口进行通信的AT指令收发模块以及PDU编解码模块;两个 子模块在底层均进行了多层的封装调用,最终在上层实现短信的发送与获取以及4G模块使用情况的监测等 功能。

运行截图

SMS线程

客户端用户发送的短信(PDU):

image

image

手机接收短信:

image

手机发送短信:

image

模块接收短信(TEXT,PDU):

image

image

PPP拨号线程

未运行PPP拨号脚本,只有默认网卡

image

PPP拨号后,出现ppp0网卡

image

ping命令测试ppp0网卡,通过丢包率判断网卡可用性

image

网卡可用

image

PPP拨号脚本截图

image

g4_sms_cat's People

Contributors

luxiaoyang666 avatar

Watchers

James Cloos avatar

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.