Closed slachtar closed 5 years ago
Hello @slachtar !
Thanks for trying out serialport-gsm
!
I tried your code and I got an error as a result in calling getSimInbox()
. Previously I removed setModemMode
as I defaulted it to PDU
mode on open. It seems it works/does not work on some gsm.
Can you please try this code and check if it works?
modem.on('open', data => {
console.log("Port opened.");
modem.initializeModem(res => {
console.log("Modem initialized.\n");
})
modem.setModemMode(res => {
console.log(res)
modem.getSimInbox(function(res) {
console.log("inbox:", res);
});
}, 'PDU')
})
Hello, thanks for the feedback, here's the output I've got: notice: still the onNewMessage not fired.
Port to be used: COM30
Port opened.
Modem initialized.
{ status: 'success', request: 'modemMode', data: 'PDU_Mode' }
unsupported sender type.
unsupported sender type.
unsupported sender type.
unsupported sender type.
unsupported sender type.
inbox: { status: 'success',
request: 'getSimInbox',
data:
[ { sender: null,
message: null,
index: 0,
dateTimeSent: 0019-11-30T00:00:00.473Z,
dateTimeReceived: 2019-02-05T10:55:03.474Z,
header: [Object] },
{ sender: null,
message: null,
index: 1,
dateTimeSent: 0019-11-30T00:00:00.475Z,
dateTimeReceived: 2019-02-05T10:55:03.476Z,
header: [Object] },
{ sender: null,
message: null,
index: 2,
dateTimeSent: 0019-11-30T00:00:00.476Z,
dateTimeReceived: 2019-02-05T10:55:03.476Z,
header: [Object] },
{ sender: null,
message: null,
index: 3,
dateTimeSent: 0019-11-30T00:00:00.477Z,
dateTimeReceived: 2019-02-05T10:55:03.477Z,
header: [Object] },
{ sender: 'xxxxxxxx',
message: 'Ok',
index: 4,
dateTimeSent: 2019-02-04T15:22:44.477Z,
dateTimeReceived: 2019-02-05T10:55:03.478Z,
header: [Object] },
{ sender: null,
message: null,
index: 5,
dateTimeSent: 0019-11-30T00:00:00.478Z,
dateTimeReceived: 2019-02-05T10:55:03.479Z,
header: [Object] },
{ sender: 'xxxxxxxx',
message: 'Ok',
index: 6,
dateTimeSent: 2019-02-04T15:27:32.479Z,
dateTimeReceived: 2019-02-05T10:55:03.480Z,
header: [Object] },
{ sender: '21698221575',
message: 'hihihh',
index: 7,
dateTimeSent: 2019-02-04T15:29:32.480Z,
dateTimeReceived: 2019-02-05T10:55:03.480Z,
header: [Object] },
{ sender: 'xxxxxxxx',
message: 'hih',
index: 8,
dateTimeSent: 2019-02-04T15:30:26.481Z,
dateTimeReceived: 2019-02-05T10:55:03.481Z,
header: [Object] },
{ sender: 'xxxxxxxx',
message: 'gigiggg',
index: 9,
dateTimeSent: 2019-02-05T10:54:06.481Z,
dateTimeReceived: 2019-02-05T10:55:03.481Z,
header: [Object] } ] }
@slachtar What version are you using? I already updated the package to 1.4.7.
@zabsalahid updated to the latest version, results are shown below:
Port to be used: COM30
Port opened.
Modem initialized.
{ status: 'success', request: 'modemMode', data: 'PDU_Mode' }
unsupported sender type.
unsupported sender type.
unsupported sender type.
unsupported sender type.
unsupported sender type.
unsupported sender type.
inbox: { status: 'success',
request: 'getSimInbox',
data:
[ { sender: null,
message: null,
index: 0,
dateTimeSent: 0019-11-30T00:00:00.008Z,
dateTimeReceived: 2019-02-06T09:49:51.008Z,
header: [Object] },
{ sender: null,
message: null,
index: 1,
dateTimeSent: 0019-11-30T00:00:00.009Z,
dateTimeReceived: 2019-02-06T09:49:51.009Z,
header: [Object] },
{ sender: null,....
@slachtar is onNewMessage
never fired at any message received? or only on messages received with 'unsupported sender typeor
null` sender? I'm having trouble figuring out why the event is never fired on your end.
@zabsalahid it's never fired even with messages with unsupported sender type or null sender. If you want I can give you a teamviewer access to check the problem directly.
BTW, same modem is working great with this module: https://github.com/emilsedgh/modem
Thank you
@slachtar sure! I'd like to check it directly. you can reach me at zabsalahid@gmail.com
@slachtar https://github.com/emilsedgh/modem last commit was Apr 13, 2017 😢
:) I think it's alive because it's based on serialPort which is very active and also AT commands didn't changed since decades.
On Sat, Feb 9, 2019 at 3:35 PM Zab Salahid notifications@github.com wrote:
@slachtar https://github.com/slachtar https://github.com/emilsedgh/modem last commit was Apr 13, 2017 😢
— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/zabsalahid/serialport-gsm/issues/1#issuecomment-462049518, or mute the thread https://github.com/notifications/unsubscribe-auth/ACaj6rfywU_pYi2PELhGwkba-qeLeJNiks5vLtywgaJpZM4ahdkL .
-- Slah Lachtar Tel. (+216) 98 221 575
How to solve this ? I'm having this problem too.
These event is not working. How to solve this?
Hello, first I'd like to thank your for this module. I'm testing it under windows with a Huawei gsm modem, I can send messages with sendSMS function, but I was enable to receive messages and the onNewMessage and onNewMessageIndicator are never fired.
Notice: getSimInbox() function shows the list of messages including the one I sent. Any suggestion please?
Thank you,
Here's my code: