zabsalahid / serialport-gsm

SerialPort-GSM is a simplified plugin for communicating with gsm modems. (Primarily for sms) (Focused in PDU mode)
MIT License
92 stars 48 forks source link

can't sendUSSD #42

Closed bellib closed 5 years ago

bellib commented 5 years ago

Thank you for your help ,, Please i get this error

{"_events":{},"_eventsCount":1,"command":"AT+CUSD=1,\"*100#\",15","add_time":"2019-08-06T11:13:05.970Z","id":14,"timeout":1000,"inProgress":true,"execute_time":"2019-08-06T11:13:06.375Z"}
    at EventEmitter.item.on (F:\sp\node_modules\serialport-gsm\lib\functions\modem.js:864:27)
    at EventEmitter.emit (events.js:198:13)
    at Timeout.timeouts.(anonymous function).setTimeout [as _onTimeout] (F:\sp\node_modules\serialport-gsm\lib\functions\modem.js:944:14)
    at ontimeout (timers.js:436:11)
    at tryOnTimeout (timers.js:300:5)
    at listOnTimeout (timers.js:263:5)
    at Timer.processTimers (timers.js:223:10)

WHen i run

          // execute a custom command - one line response normally is handled automatically
          gsmModem.sendUSSD('*100#' ).then(
               (success)=>{console.log( 'ssd dd ',uccess)},

          ).catch(  (fail)=>{console.log( 'ssd fail',fail)});
zabsalahid commented 5 years ago

@bellib do you only get the error on ussd?

bellib commented 5 years ago

@zabsalahid yes

bellib commented 5 years ago

this is when i run your expemple Modem Sucessfully Opened Modem Write: ATZ Modem Received: ATZ Activate Message Processing for: ATZ Modem Received: Modem Received: OK Call callback for: ATZ Modem Write: ATE1 Modem Received: ATE1 Activate Message Processing for: ATE1 Modem Received: Modem Received: OK Call callback for: ATE1 Modem Write: AT+CPIN? Modem Received: AT+CPIN? Activate Message Processing for: AT+CPIN? Modem Received: Modem Received: +CPIN: READY Call callback for: AT+CPIN? Modem Received: Modem Received: OK InitModemResponse: {"status":"success","request":"modemInitialized","data":"Modem Successfully Initialized"} Configuring Modem for Mode: PDU Modem Write: AT+CMEE=1;+CREG=2 Modem Received: AT+CMEE=1;+CREG=2 Activate Message Processing for: AT+CMEE=1;+CREG=2 Modem Received: Modem Received: OK Call callback for: AT+CMEE=1;+CREG=2 Modem Write: AT^CURC=0 Modem Received: AT^CURC=0 Activate Message Processing for: AT^CURC=0 Modem Received: Modem Received: OK Call callback for: AT^CURC=0 Modem Write: AT+CLIP=1 Modem Received: AT+CLIP=1 Activate Message Processing for: AT+CLIP=1 Modem Received: Modem Received: OK Call callback for: AT+CLIP=1 Modem Write: AT+CMGF=0 Modem Received: AT+CMGF=0 Activate Message Processing for: AT+CMGF=0 Modem Received: Modem Received: OK Call callback for: AT+CMGF=0 Modem Write: AT+CPMS="SM" Set Mode: {"status":"success","request":"modemMode","data":"PDU_Mode"} Modem Received: AT+CPMS="SM" Activate Message Processing for: AT+CPMS="SM" Modem Received: Modem Received: +CPMS: 0,20,0,20,0,20 Call callback for: AT+CPMS="SM" Modem Write: AT+CNMI=2,1,0,2,0 Modem Received: Ignore Data: Modem Received: OK Ignore Data: OK Sim Memory Result: {"status":"success","request":"checkSimMemory","data":{"used":0,"total":20}} Modem Received: AT+CNMI=2,1,0,2,0 Activate Message Processing for: AT+CNMI=2,1,0,2,0 Modem Received: Modem Received: OK Call callback for: AT+CNMI=2,1,0,2,0 Modem Write: AT+CSQ Modem Received: AT+CSQ Activate Message Processing for: AT+CSQ Modem Received: Modem Received: +CSQ: 19,99 Call callback for: AT+CSQ Modem Write: AT+CGSN Modem Received: Ignore Data: Modem Received: OK Ignore Data: OK Signal Strength: {"status":"success","request":"modemMode","data":"PDU_Mode"} Modem Received: AT+CGSN Activate Message Processing for: AT+CGSN Modem Received: Modem Received: 867010026070376 Call callback for: AT+CGSN Modem Write: AT+CNUM Modem Received: Ignore Data: Modem Received: OK Ignore Data: OK Modem Serial: {"status":"success","request":"getModemSerial","data":{"modemSerial":"867010026070376"}} Modem Received: AT+CNUM Activate Message Processing for: AT+CNUM Modem Received: Modem Received: +CME ERROR: 14 Call callback for: AT+CNUM Modem Write: AT+CUSD=1,"*200#",15 Own number: {"status":"ERROR","request":"getOwnNumber","data":"Cannot Get Sim Number +CME ERROR: 14"} Modem Received: AT+CUSD=1,"*200#",15 Activate Message Processing for: AT+CUSD=1,"*200#",15 Modem Received: Modem Received: +CME ERROR: 100 from ussd undefined Modem Write: AT+CMGL=4 Modem Received: AT+CMGL=4 Activate Message Processing for: AT+CMGL=4 Modem Received: Modem Received: OK Call callback for: AT+CMGL=4 Sim Inbox Result: {"status":"success","request":"getSimInbox","data":[]} Modem Received: Modem Received: +CGREG: 1,"AE25","0ADDD6F3" Modem Received: Modem Received: +CREG: 1,"AE25","0ADDD6F3" Modem Received: Modem Received: +CGREG: 1,"AE25","0ADDD6ED" Modem Received: Modem Received: +CREG: 1,"AE25","0ADDD6ED" Event Close: {"modem":"COM7","status":"Offline"}

zabsalahid commented 5 years ago

@bellib sorry was busy. Did you manage to get your program working?

bellib commented 5 years ago

yes I changed charset : AT+CSCS="IRA" AT+CUSD=1,"A3986C3602",15 thank you .