Python 3 classes for SIM 900 GSM module
Branch: master
Clone or download
Pull request Compare This branch is 3 commits ahead of JFF-Bohdan:master.
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
lib
smspdu
.flake8
.gitignore
LICENSE
README.md
mqttsms.ini
mqttsms.py
mqttsms.sh
mqttsms_shared.py
test_basic_class.py
test_http.py
test_imei_retrieving.py
test_shared.py
test_sms.py
test_sms_for_pi.py
test_ussd.py

README.md

MQTT - SMS bridge

Lot of the codes come from https://github.com/JFF-Bohdan/sim-module

Features

  • INI file with all settings (see comments inside)
  • MQTT parameters for published data (QoS, Retain).
  • Processing of incoming messages
  • USSD commands in the text and PDU modes
  • Python 3 compatibility.
  • System daemon script.

How to install on Raspberry Pi or Banana Pi

$ cd ~/
$ sudo pip3 freeze --local | grep -v '^\-e' | cut -d = -f 1  | xargs -n1 pip3 install -U
$ sudo pip3 install ConfigParser
$ sudo pip3 install paho-mqtt
$ sudo chmod 0755 mqttsms.sh
$ sudo cp mqttsms.sh /etc/init.d
$ sudo update-rc.d mihome.sh defaults
$ sudo service mqttsms start

How to start/stop the daemon

$ sudo service mqttsms start

Examples

How to send SMS

Write your message to topic home/sim900/18002001100 (your mobile number)

How to request balance

Write *100# (your USSD command) to topic home/sim900/ussd/balance Read result from home/sim900/ussd/balance/value

My home page: http://ptvo.info