diff --git a/lib/modem.js b/lib/modem.js index 057fdb4..f9b6018 100644 --- a/lib/modem.js +++ b/lib/modem.js @@ -295,7 +295,9 @@ async function sendSMS(destination, msg) { logger.verbose('Waiting for lock before writing message'); await mutex.setLockWaitForSubCommand(); port.pipe(parser); - await writeToPort(`AT+CMGS="${correctedDestination}"\r${msg}${Buffer.from([0x1A])}`); + await writeToPort(`AT+CMGS="${correctedDestination}"\r`); + await writeToPort(msg); + await writeToPort(Buffer.from([0x1A])); await mutex.setLockWaitForSubCommand(); mutex.releaseLockWaitForSubCommand();