Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/stasel/nodegsm
Modem GSM API for NodeJS
https://github.com/stasel/nodegsm
gsm nodejs sms
Last synced: 2 months ago
JSON representation
Modem GSM API for NodeJS
- Host: GitHub
- URL: https://github.com/stasel/nodegsm
- Owner: stasel
- License: mit
- Created: 2019-07-08T23:00:38.000Z (over 5 years ago)
- Default Branch: master
- Last Pushed: 2024-08-19T12:08:45.000Z (5 months ago)
- Last Synced: 2024-10-30T05:31:53.607Z (2 months ago)
- Topics: gsm, nodejs, sms
- Language: JavaScript
- Size: 1.7 MB
- Stars: 17
- Watchers: 2
- Forks: 6
- Open Issues: 4
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# NodeJS GSM API
[![npm](https://img.shields.io/npm/v/nodegsm)](https://www.npmjs.com/package/nodegsm)
A simple and easy to use NodeJS API to communicate with serial GSM Modems.
## Features
* Read device information: serial, manufacturer, model.
* Read network information: Carrier, signal strength, subscriber id.
* Read and send SMS Messages.
* Add, Read and modify SIM card contacts.
* Make calls (without audio).## Requirements
* Connected USB GSM Modem
* Working SIM Card
* NodeJS 11 and later## Installation
`npm install nodegsm`## Usage
```JavaScript
const GSM = require("nodegsm")
const gsm = new GSM("/dev/gsmmodem")
await gsm.connect()const manufacturer = await gsm.getManufacturerInformation())
console.log(manufacturer) // QUALCOMM INCORPORATEDconst unreadMessages = await gsm.readSMS(GSM.MessageStorage.sim, GSM.MessageFilter.unread)
console.log(unreadMessages) // List of unread SMS messagesawait gsm.sendSMS("+31111222333","Hello from NodeJS")
```## Dependencies
* [serialport](https://www.npmjs.com/package/serialport)## Resources
* [
Send and Receive SMS Messages Using Raspberry Pi and Python
](https://hristoborisov.com/index.php/projects/turning-the-raspberry-pi-into-a-sms-center-using-python/)
* [AT Commands Reference Guide ](https://www.sparkfun.com/datasheets/Cellular%20Modules/AT_Commands_Reference_Guide_r0.pdf) ([Local Copy](docs/AT_Commands_Reference_Guide_r0.pdf))
* [
Introduction to AT commands and its uses
](https://www.codeproject.com/Articles/85636/Introduction-to-AT-commands-and-its-uses)## Testing the modem
### Method 1: Using regular bash
Terminal window 1 will read
```bash
$ cat /dev/gsmmodemOK
Manufacturer: QUALCOMM INCORPORATED
Model: +CGMM:HSPA MODEM
Revision: +CGMR:V1.2
IMEI: 869478036086138
+GCAP: +CGSM,+DS,+ESOK
```Terminal window 2 will write
```bash
$ echo "AT" > /dev/gsmmodem
$ echo "ATI" > /dev/gsmmodem
```### Method 2: Using cu
```bash
$ apt install cu
$ cu -l /dev/gsmmodemAT
OK
ATI
Manufacturer: QUALCOMM INCORPORATED
Model: +CGMM:HSPA MODEM
Revision: +CGMR:V1.2
IMEI: 869478036086138
+GCAP: +CGSM,+DS,+ESOK
```