Comments (11)
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')
})
from serialport-gsm.
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] } ] }
from serialport-gsm.
@slachtar What version are you using?
I already updated the package to 1.4.7.
from serialport-gsm.
@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,....
from serialport-gsm.
@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.
from serialport-gsm.
@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
from serialport-gsm.
@slachtar sure! I'd like to check it directly. you can reach me at [email protected]
from serialport-gsm.
@slachtar https://github.com/emilsedgh/modem last commit was Apr 13, 2017 😢
from serialport-gsm.
from serialport-gsm.
How to solve this ? I'm having this problem too.
from serialport-gsm.
These event is not working. How to solve this?
from serialport-gsm.
Related Issues (20)
- Error on modem.close(): Cannot read property 'close' of undefined HOT 4
- ReferenceError: message is not defined HOT 7
- Can we use web serial port on browser instead running nodejs HOT 7
- Receive SMS error HOT 3
- enableConcatenation not working as expected HOT 2
- How to check if modem is open or not HOT 1
- Handle multiple ports HOT 5
- Incoming USSD and message errors HOT 3
- sendSMS stuck in 1st callback when no load? HOT 14
- Failure to retrieve phone number. HOT 4
- No results found on list command HOT 9
- USB modem shows up several times when listing HOT 2
- Not receiving messages in inbox HOT 7
- USSD response HOT 4
- Compatible / Recommended USB modems HOT 1
- Wrong phone number when using sendSMS function HOT 4
- Error [ERR_HTTP_HEADERS_SENT]: Cannot set headers after they are sent to the client HOT 7
- Port closes when sending ussd commands HOT 1
- code : "ENOENT" errno : -2 path : "udevadm" spawnargs : (2) ['info', '-e'] syscall : "spawn udevadm" [[Prototype]] : Object
- Missing Characters in a message (PDU) when sending over 160 characters HOT 9
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from serialport-gsm.