GithubHelp home page GithubHelp logo

Comments (11)

zabsalahid avatar zabsalahid commented on August 23, 2024

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.

slachtar avatar slachtar commented on August 23, 2024

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.

zabsalahid avatar zabsalahid commented on August 23, 2024

@slachtar What version are you using?
I already updated the package to 1.4.7.

from serialport-gsm.

slachtar avatar slachtar commented on August 23, 2024

@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.

zabsalahid avatar zabsalahid commented on August 23, 2024

@slachtar is onNewMessage never fired at any message received? or only on messages received with 'unsupported sender typeornull` sender? I'm having trouble figuring out why the event is never fired on your end.

from serialport-gsm.

slachtar avatar slachtar commented on August 23, 2024

@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.

zabsalahid avatar zabsalahid commented on August 23, 2024

@slachtar sure! I'd like to check it directly. you can reach me at [email protected]

from serialport-gsm.

zabsalahid avatar zabsalahid commented on August 23, 2024

@slachtar https://github.com/emilsedgh/modem last commit was Apr 13, 2017 😢

from serialport-gsm.

slachtar avatar slachtar commented on August 23, 2024

from serialport-gsm.

iamqinglong avatar iamqinglong commented on August 23, 2024

How to solve this ? I'm having this problem too.

from serialport-gsm.

cuongdev avatar cuongdev commented on August 23, 2024

These event is not working. How to solve this?

from serialport-gsm.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.