简体   繁体   中英

Two-way communication between Meteor and Node

I am building a Node app that talks to an Xbee over serial and reads/controls several sensors/relays that are also Xbee equipped. I would like to use Meteor for the user interface and data storage with the Node app simply sending sensor updates and controlling the relays when triggered by the Meteor app. What would be the proper way to communicate between the Node and Meteor app? I know I can use a Node DDP client to insert sensor readings to the Meteor app. The part I am having problems with is sending commands from Meteor to the Node app to control the relays. I simply need to send a command that will execute certain code on the Node app to switch the relays. Maybe this is a simple question, but I'm not sure of the best way to accomplish this. Thanks in advance for any input.

You could just use Mongo as your point of integration. Each XBee device could just be a mongo document.

{
   address: 'xbeeaddress',
   relay1:  'on'
}

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM