Send and recieve SMS with GSM-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').
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).
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").
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. |
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 |
- your name (default is
ownNumber
), maximum length is 16 chars. - your phone Number.
- SMS operating Mode (
PDU
orSMS
,PDU
is default and recommended).
All inputs have to be made with ack=false!
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.
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).
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'});).
! 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.
This adapter is based on the SerialPort-GSM plugin for communicating with GSM modems, primarily for SMS.
This adapter would not have been possible without the great work of @forelleblau (https://github.com/forelleblau), who developed former releases of this adapter.
- (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
- (forelleblau) jsonConfig.json, notifications-manager
- (forelleblau) bug fixed (adapter set "undefined" into state values)
- (Apollon77) Optimizations, brush up to comply with ioBroker.repositories requirements
- (forelleblau) dependencies updated, bugs fixed
- (forelleblau) first published version
- (forelleblau) initial release
MIT License
Copyright (c) 2023-2024 ioBroker Community Developers [email protected]
Copyright (c) 2022-2023 forelleblau mailto:[email protected]
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.