Open sts-ryan-holton opened 1 year ago
I think you need to select the corect SIM storage to read ... maybe https://www.developershome.com/sms/cpmsCommand.asp hlps? Maybe try "ME" as storage?
I tried modifying this block of code:
// get info about stored Messages on SIM card
gsmModem.checkSimMemory((result, err) => {
if(err) {
console.log(`Failed to get SimMemory ${err}`);
} else {
console.log('== SET STORAGE NOW ==')
gsmModem.executeCommand(`AT+CPMS=\"ME\",\"ME\",\"ME\"`, ((data, err) => {
if (err) {
console.log('Exec Error: ', err)
} else {
console.log("Result from execute command: ", data)
gsmModem.getSimInbox((result, err) => {
if (err) {
console.log(`Failed to get SimInbox ${err}`);
}
// Finally send an SMS
console.log(`INBOX IS: ${JSON.stringify(result)}`)
console.log('SEND SMS NOW')
});
}
}))
}
});
I get
Execute Command returned Error: +CMS ERROR: 302
Changing the execute command to AT+CPMS=\"SM\",\"SM\",\"SM\"
gives me a success with the following result:
0,0,0,0,0,0
When sending an SMS now, I still don't see it in the inbox?
WHy you escape quotes when you do not use quotes around it? the command is wrong.
gsmModem.executeCommand(
AT+CPMS="ME","ME","ME"
, ((data, err) => {
UPDATE 18:36 Changing the execute command to AT+CPMS=\"SM\",\"SM\",\"SM\" gives me a success with the following result:
0,0,0,0,0,0
When sending an SMS now, I still don't see it in the inbox?
It was set to SM before, so why you choose SM? Try ME ...
AT+CPMS="ME","ME","ME"
gives me:
Execute Command returned Error: +CMS ERROR: 302
Honestly this is all very specific to your device ... in general have a read in e.g. https://www.manualsdir.com/manuals/281328/rainbow-electronics-fargo-maestro-100-with-tcp_ip.html?page=421 or google for CPMS and your device type
I'm using the provided example JS file for my USB modem with mostly default config, I've got all of the console logs in my JS file, but when I send a text message to my sim card that is on the USB modem, I never see the event pop up, here's my JS file and the output when I run
node index.js
, it says the inbox is emptyAnd the output of this is:
Am I missing something?