node-tcrouter
  • Welcome
  • Getting Started
  • Javascript Docs
    • TCRouter
  • Guides
    • Status Information
    • Sending Text Messages
    • Receive Text Messages
    • Device Connection Status
    • Control IO
    • Sending Emails
    • Control VPN
  • Hardware
    • Overview
  • Setup
    • Setup Overview
    • Socket Server
    • Enable SMS
    • Enable Email
    • Setup VPN
Powered by GitBook
On this page

Was this helpful?

  1. Guides

Receive Text Messages

Check for an incoming text message

To monitor incoming text messages, the node module pings the TC Router. If the device has received a new message, checkForSmsRX() will retrieve this message. Upon receipt of the message, an acknowledgement must be sent to clear the message from the TC Router memory.

const tcr = require("@phoenixcontactusa/node-tcrouter");

var TCRouter = new tcr("192.168.1.1", 1432, 3000);

TCRouter.checkForSmsRx()
  .then(res => {
    if (res.success === true) {
      console.log(res);
      TCRouter.ackSmsRx()
        .then(res => {
          console.log("message deleted");
        })
        .catch(e => {
          console.log(e);
        });
    } else {
      console.log("No new messages");
    }
  })
  .catch(e => {
    console.log(e);
  });
PreviousSending Text MessagesNextDevice Connection Status

Last updated 5 years ago

Was this helpful?