An open API service indexing awesome lists of open source software.

https://github.com/iobroker-community-adapters/iobroker.gsmsms

ioBroker Adapter to send and recieve SMS with GSM hardware
https://github.com/iobroker-community-adapters/iobroker.gsmsms

gsm sms

Last synced: 2 months ago
JSON representation

ioBroker Adapter to send and recieve SMS with GSM hardware

Awesome Lists containing this project

README

          

![Logo](admin/gsmsms.png)

# ioBroker.gsmsms

![Number of Installations](https://iobroker.live/badges/gsmsms-installed.svg)
![Current version in stable repository](https://iobroker.live/badges/gsmsms-stable.svg)
[![NPM version](https://img.shields.io/npm/v/iobroker.gsmsms.svg)](https://www.npmjs.com/package/iobroker.gsmsms)

![Test and Release](https://github.com/forelleblau/ioBroker.gsmsms/workflows/Test%20and%20Release/badge.svg)
[![Downloads](https://img.shields.io/npm/dm/iobroker.gsmsms.svg)](https://www.npmjs.com/package/iobroker.gsmsms)

## gsmsms adapter for ioBroker

Send and recieve SMS with GSM-hardware.

## Hardware

Any GSM-Hardware (shield, surfstick i.e) connected to a serial port of your ioBroker - device.
GSM-modules/sticks need a lot of power. Please ensure a sufficient power supply.

Some devices have to be set to the right mode for serial communication (see 'usb_modeswitch').

## Settings

### Port & connection setting

#### Path to Serial Port - required.

e.g. `/dev/ttyUSB0` or `/dev/serial/by-id/xxxxxxxxxxx` (by-id is more stable, ttyUSBx can change with a reboot)

Some devices expose multiple USB port, so it can be that you need to try it out. Most likely the "first" on will work, but will maybe not deliver "incoming message notifications", then you can try the other and send in a sms and see if some seconds later it is received (on a Huawai this is the third port as example).

#### Your SIM PIN

If your SIM card is protected by a PIN provide the PIN and it will be used to unlock the SIM card during initialization (empty, means "no PIN existing on the SIM card").

### GSM settings

Not to run out of SIM-Memory, all SMS are deleted from SIM after delivery/reading. Use e.g. the 'history' - adapter to store your messages or any other convenient solution.

| Name | Type | Default | Description |
| --------------------------- | ------- | ------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| Incoming SMS indication | boolean | true | Enables the modem to notify that a new SMS message has been received. |
| Enable concatenation | boolean | true | Receive concatenated messages as one. |
| Custom Iinit command | string | | If your device needs a custom initialization command it can be provided and will be used after PIN check. i.e. some devices need 'AT+CPMS="SM","SM","SM"' to get the right storage set. The command is expected to return `'OK'` (empty, means "no custom command for init"). pls refer your GSM-device specs. |
| CNMI when modem open/closed | string | '2,1,0,2,0' / '2,0,2,2,1' | Defines if messages are saved on SIM or delivered instantly. pls refer your GSM-device specs. |

### SerialPort settings

Please refer to your GMS-device specs (Google will help in most cases)

| Name | Type | Default | Description |
| -------- | ------- | ------- | ------------------------------------------------------- |
| baudRate | number | 19200 | The port's Baud rate. |
| dataBits | number | 8 | Must be one of: 8, 7, 6, or 5. |
| stopBits | number | 1 | Must be one of: 1 or 2. |
| parity | string | "none" | Must be one of: 'none', 'even', 'mark', 'odd', 'space'. |
| rtscts | boolean | false | flow control setting |
| xon | boolean | false | flow control setting |
| xoff | boolean | false | flow control setting |
| xany | boolean | false | flow control settings |

### Other settings and recommendations

#### To be specified as adapter - objects (`admin.x`)

- your name (default is `ownNumber`), maximum length is 16 chars.
- your phone Number.
- SMS operating Mode (`PDU` or `SMS`, `PDU` is default and recommended).

All inputs have to be made with ack=false!

#### Inbox/Outbox - History

By activating the History-adapter for the `inbox.messageRaw` - object and the `sendSMS.messageRaw` - object you get a complete In- and Outbox of your SMS traffic.

## Functionalities

### Receive SMS

Incoming SMS are written to the `inbox.*` - objects. `inbox.messageRaw` can be used as trigger for further operations (e.g. forward incoming sms by e-mail adapter).

### Send SMS

To send a sms fill in `sendSMS.recipient, sendSMS.message` and optionally `sendSMS.alert` and push the `sendSMS.send` - button. Or set the `sendSMS.messageRaw` - Object with a string in the following form and ack=false: `{"recipient": "Number", "message":"Yourtext", "alert":"false"}`.

This adapter also provides a comm-block for blockly and sendTo functionalities for other scripts (sendTo("gsmsms._InstanceNo_", "send", {text: '_yourText_',recipient: '_phonenumber_', alert: '_false/true_'});).

### Execute AT+ commands

! Pls be sure to know what you do when setting AT+ commands, it's your SIM-card / device.

AT+commands are sent be setting `admin.atCommandSLR` in the format `AT+XXXXy`.
Send any command you like, but be aware that you will see only the last line of the response.

## Serialport-gsm

This adapter is based on the [SerialPort-GSM plugin](https://github.com/zabsalahid/serialport-gsm) for communicating with GSM modems, primarily for SMS.

## Credits

This adapter would not have been possible without the great work of @forelleblau (https://github.com/forelleblau), who developed former releases of this adapter.

## Changelog

### 1.0.0 (2024-11-23)
- (mcm1957) Adapter requires node.js 20 now.
- (mcm1957) Adapter requires js-controller 5.0.19 and admin 6.17.14 now.
- (mcm1957) Adapter has been moved to iobroker-community-adapters organization
- (mcm1957) Some issues reported by adapter checker have been fixed.
- (mcm1957) Dependencies have been update

### 0.0.6
- (forelleblau) jsonConfig.json, notifications-manager

### 0.0.5
- (forelleblau) bug fixed (adapter set "undefined" into state values)

### 0.0.4
- (Apollon77) Optimizations, brush up to comply with ioBroker.repositories requirements

### 0.0.3
- (forelleblau) dependencies updated, bugs fixed

### 0.0.2
- (forelleblau) first published version

### 0.0.1
- (forelleblau) initial release

## License

MIT License

Copyright (c) 2023-2024 ioBroker Community Developers
Copyright (c) 2022-2023 forelleblau

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.