![PyPI Now Supports iOS and Android Wheels for Mobile Python Development](https://cdn.sanity.io/images/cgdhsj6q/production/96416c872705517a6a65ad9646ce3e7caef623a0-1024x1024.webp?w=400&fit=max&auto=format)
Security News
PyPI Now Supports iOS and Android Wheels for Mobile Python Development
PyPI now supports iOS and Android wheels, making it easier for Python developers to distribute mobile packages.
modem-commands
Advanced tools
Allows you to use your GSM modems on node. It offers a very simple API
modem-commands allows you to use your GSM modems on node. It supports the following
$ npm install --save modem-comannds
Accepts the following options:
let modemOptions = {
baudRate: 115200,
dataBits: 8,
parity: 'none',
stopBits: 1,
flowControl: false,
xon: false,
rtscts: false,
xoff: false,
xany: false,
buffersize: 0,
onNewMessage: true,
onNewMessageIndicator: true
}
let modem = require('modem-commands').Modem()
modem.listOpenPorts((err, result)=>{
console.log(result)
})
Output:
[ { comName: '/dev/tty.usbserial10',
manufacturer: undefined,
serialNumber: undefined,
pnpId: undefined,
locationId: undefined,
vendorId: undefined,
productId: undefined },
{ comName: '/dev/tty.usbserial',
manufacturer: undefined,
serialNumber: undefined,
pnpId: undefined,
locationId: undefined,
vendorId: undefined,
productId: undefined } ]
let device = '/dev/tty.usbserial'
modem.open(device,modemOptions, (err,result) => {
console.log(result)
})
Output:
{ status: 'success',
request: 'connectModem',
data: {
modem: '/dev/tty.usbserial',
status: 'Online'
}
}
///Initialize Modem by Sending an AT Command ///
modem.initializeModem((response) => {
console.log(response)
})
output:
{ status: 'success',
request: 'modemInitialized',
data: 'Modem Successfully Initialized' }
modem.modemMode((response) => {
console.log(response)
}, "PDU")
output:
{ status: 'success',
request: 'modemMode',
data: 'PDU_Mode' }
modem.modemMode((response) => {
console.log(response)
}, "SMS")
output:
{ stgit checkout masteratus: 'success',
request: 'modemMode',
data: 'SMS_Mode' }
modem.getModemSerial((response) => {
console.log(response)
})
output:
{ status: 'success',
request: 'getModemSerial',
data: { modemSerial: '356995005282463' } }
modem.getNetworkSignal((response) => {
console.log(response)
})
output:
{ status: 'success',
request: 'getNetworkSignal',
data: { signalQuality: '24' } }
Value RSSI dBm Condition
2 -109 Marginal
3 -107 Marginal
4 -105 Marginal
5 -103 Marginal
6 -101 Marginal
7 -99 Marginal
8 -97 Marginal
9 -95 Marginal
10 -93 OK
11 -91 OK
12 -89 OK
13 -87 OK
14 -85 OK
15 -83 Good
16 -81 Good
17 -79 Good
18 -77 Good
19 -75 Good
20 -73 Excellent
21 -71 Excellent
22 -69 Excellent
23 -67 Excellent
24 -65 Excellent
25 -63 Excellent
26 -61 Excellent
27 -59 Excellent
28 -57 Excellent
29 -55 Excellent
30 -53 Excellent
modem.sendSMS("09473625384", `Test Message, function(response){
console.log('message status',response)
}, true)
(number, message, callback, priority)
modem.on('open', (data) => {
console.log(data)
});
modem.on('onSendingMessage', (data) => {
console.log(data)
})
modem.on('onMessageSent', (data) => {
console.log(data)
})
modem.on('onMessageSendingFailed', (data) => {
console.log(data)
})
modem.on('onNewMessage', (data) => {
console.log(data)
})
modem.on('onNewMessageIndicator', (data) => {
console.log(data)
})
modem.on('onModemActivityStream', (data) => {
console.log(data)
})
FAQs
Allows you to use your GSM modems on node. It offers a very simple API
We found that modem-commands demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 2 open source maintainers collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
PyPI now supports iOS and Android wheels, making it easier for Python developers to distribute mobile packages.
Security News
Create React App is officially deprecated due to React 19 issues and lack of maintenance—developers should switch to Vite or other modern alternatives.
Security News
Oracle seeks to dismiss fraud claims in the JavaScript trademark dispute, delaying the case and avoiding questions about its right to the name.