GitXplorerGitXplorer
m

MqttSMSBridge

public
4 stars
0 forks
0 issues

Commits

List of commits on branch master.
Unverified
3c57c1bfe05927d6d8d0f53f7d451f3590776e8d

doc: fix typos

mmhdawson committed 7 years ago
Unverified
fee739e896bcdbf82278e8ac7f7e71b5e981b1e7

doc: finish off README.md

mmhdawson committed 7 years ago
Unverified
24f45633fde4c0e5c97af909273f8a806ff89c9e

doc: add picture for GUI

mmhdawson committed 7 years ago
Unverified
4d94da74af9628e938ec3bc282744d2fc8e4cc21

doc: continue to fill in README.md

mmhdawson committed 7 years ago
Unverified
42eb31e86c7dd1611865fa22f2f762c7151a0c60

doc: start to fill in README.md

mmhdawson committed 7 years ago
Unverified
d46f7b48c2b1f167a1e84ab988e31d3745dc554c

src: add in simple UI

mmhdawson committed 7 years ago

README

The README file for this repository.

MqttSMSBridge

Micro-app server that accepts requests through mqtt and then sends out notifications through SMS. It is currently intended to provide personal notifications you configured a predefined set of numbers to which notifications will be sent when a request is received.

It also provides a simple UI that shows the SMS requests that have been serviced:

sms UI

To make requests you simply publish the SMS message that you want to be sent to the topic on which the bridge is listening.

The bridge does not currenly do any authentication. I currently limit access by controlling access to the mqtt server by securing it will ssl and requiring certificate based authentication.

Configuration

Configuration for the bridge is through the config.json file in the lib directory. The bridge currently supports 2 SMS providers:

  • voipms
  • twilio

The options for each of the provider elements are:

  • voipms
    • enabled - set to true if you want notifications to be sent using this provider.
    • user - voip.ms API userid.
    • password - voip.ms API password.
    • did - voip.ms did(number) from which the SMS will be sent.
    • dst - number to which the SMS will be sent.
  • twilio
    • enabled - set to true if you want notifications to be sent using this provider.
    • accountSID - twilio account ID.
    • accountAuthToken - twilio auth token.
    • toNumber - number to which the SMS will be sent.
    • fromNumber - number from which the SMS will be sent.

The mqtt server through which requests are accepted is configured through the mqtt element. This is an array or one more objects with the following elements:

  • serverlUrl - url for the mqtt server. If it is of type mqtts, then certificates must be provided through the certs element.
  • requestTopic - topic on which the bridge listens for requests.
  • certs - directory which must contain a ca.cert, client.cert and client.key file that will be used to connect to the mqtts server.

In addition, the bridge supports the following configuration elements, as well as those supported by the micro-app-framework.

  • title - title for the window for the application.
  • windowSize - size of the window for the application.
  • serverPort - port on which to connect to get the GUI for the. application.
  • eventLogPrefix - path to the directory into which the log file will be written.

For example, this is my configuration file with some key elements masked out:

{
  "title": "SMS Bridge",
  "windowSize": { "x": 300, "y": 300 },
  "serverPort": 14000,
  "eventLogPrefix": "/home/user1/repo/MqttSMSBridge",
  "mqtt": [ { "serverUrl": "mqtt:10.1.1.186:1883",
              "requestTopic": "house/sms" }
          ],
  "voipms": { "enabled": true,
              "user": "XXXXXXXXXX",
              "password": "XXXXXX",
              "did": "XXXXXXXXXX",
              "dst": "XXXXXXXXXX" },
  "twilio": { "enabled": false,
              "accountSID": "XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX",
              "accountAuthToken": "XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX",
              "toNumber": "XXXXXXXXXXX" ,
              "fromNumber": "XXXXXXXXXX" }
}

Installation

The easiest way to install is to run:

npm install https://github.com/mhdawson/MqttSMSBridge.git

and then configure the default config.json file in the lib directory as described in the configuration section above.

Running

Simply cd to the directory where the npm was installed and type:

npm start