Open Ciao121 opened 4 years ago
I read the source and there is no option for setting the timeout for send sms command.
maybe better add exec option as third parameter on send sms command.
Thank you for your comments.
@Ciao121, did the issue occur when the open()
method was called?
Do you want the timeout default value to be longer?
If so, changing the value might not solve the issue because any modem generally responds immediately for the ATE0.
BTW, did you run your script as root? If not, try to run it as root. Some Linux environment do not allow normal users to access serial ports.
Thank you.
Hi @futomi thank for your reply, I'm running the script as root. It's listening for incoming messages.
At startup I'm always getting:
[Error: Error: Input/output error setting custom baud rate of 115200]
and
Error: TIMEOUT: command=ATE0, terminator=0x0D
at Timeout._onTimeout (/var/apps/simfarm/node_modules/node-sms-transceiver/lib/sms-modem.js:270:16)
at listOnTimeout (internal/timers.js:554:17)
Ignoring those errors make the script run, but randomly I get timeouts (i.e. deleting a message). I saw linux OS sometimes writes: cdc_acm 1-12.11.2: failed to set dtr/rts (digits changes for other ports) Don't know if that's related.
Tried different cables and this didn't solve. Also a different PC (I'm on debian). This is the hardware I'm using: https://ae01.alicdn.com/kf/HTB1VK2wHYSYBuNjSspiq6xNzpXah/FIMT-1-8-16-32-64-ports-USB-sms-gateway-gprs-modem-price-16-port-modem.jpg_q50.jpg Thank you
@Ciao121, Can your device accept the baud rate 115200? I suspect that the baud rate is inappropriate for your device. Can you get the acceptable baud rates of your device?
Hello @futomi any update on this? I am facing the same issues with reject in setTimeout (Error: TIMEOUT: command=ATE0, terminator=0x0D #2) This kills the nodeJs process. I am using the app with EC25 from Quectel which is using 115200 Bauds by default for communicating trough ports Please assist
sms-modem.js // execCommand Function // Set a timer part
this._response_waiting = true;
let timer = setTimeout(() => {
timer = null;
this._response_waiting = false;
this._onresponse = null;
let terminator_hex = Buffer.from([terminator]).toString('hex').toUpperCase();
let msg = 'TIMEOUT: command=' + cmd + ', terminator=0x' + terminator_hex;
issue-> reject(new Error(msg)); }, timeout);
I'm getting TIMEOUT error as in the title. I saw timeout default is 10000ms in the module but I do not understand how I can set it to a different value from my script. Can somebody help me? Thank you!