Two-way communication between Meteor and Node

China☆狼群 提交于 2019-12-23 05:37:33

问题


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.


回答1:


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

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


来源:https://stackoverflow.com/questions/23400568/two-way-communication-between-meteor-and-node

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!