title: Sending text message using AT+command on node.js and serial.js
body: <p>I am trying to send SMS AT+commands using node.js and serial.js with below command but it looks like its skipping the senders number, is this a device problem or something is missing with my code? i am using HUAWEI gsm modem attached on my COM2 and my machine is windows 7.</p>
  
  <pre><code>var SerialPort = require('serialport');
  var port = new SerialPort('COM2', {
    baudrate: 9600,
    dataBits: 8,
    parity: 'none'
  });
  
  console.log('port is now open');
  
  port.on("open", function () {
  
      console.log('Serial communication open');
      port.write("AT");
      port.write('\r');
      port.on('data', function(data) {
          console.log("Received data: " + data);
      });
  
  
  
      gsm_message_sending(port, "test2", "89410238(example only)"); 
  });
  
  function gsm_message_sending(serial, phone_no, message) {
     serial.write("AT+CMGF=1");
      serial.write('\r');
      serial.write("AT+CMGS=\"" + phone_no + "\"");
      serial.write('\r');
      serial.write(message); 
      serial.write(Buffer([0x1A]));
      serial.write('^z');
  }
  </code></pre>
  
  <p>I tried to change the line using below code but still the same output.</p>
  
  <pre><code>serial.write("AT+CMGS=\"");
      serial.write(phone_no);
      serial.write('"')
  </code></pre>
  
  <p>My console returns below</p>
  
  <p><a href="https://i.stack.imgur.com/yM6Ch.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/yM6Ch.png" alt="enter image description here"></a></p>
  
  <p>Any advice would be great! thanks in advance!</p>