Node.js driver for Iridium SBD 9602/9603 transceiver modules.
const controller = new IridiumController({
serialPath: '/dev/serial0',
serialBaudRate: 19200
})
controller.on('log', (log) => console[log.level.toLowerCase()](log.message));
controller.on('ring-alert', () => controller.mailboxCheck())
controller.on('inbound-message', (buffer) => console.log(`Received new message: ${buffer.toString()}`))
try {
// open the serial port and init the iridium modem
controller.init()
.then(() =>
controller.sendMessage('Hello Iridium from Node.js', { signalQuality: 2, compressed: false, binary: false }
))
} catch (error) {
console.error(error.message)
process.exit(1)
}