Two-way communication between Meteor and Node
Asked Answered
G

1

0

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.

Gift answered 1/5, 2014 at 1:0 Comment(0)
F
0

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

{
   address: 'xbeeaddress',
   relay1:  'on'
}
Fluoridate answered 1/5, 2014 at 2:25 Comment(1)
I suppose this could work. I could have a Node DDP client connect to the Meteor server and subscribe to a collection that has address and current states for all devices. I am really looking for a way to send events between Meteor clients so that I can trigger devices to turn on/off. The only thing I have found is Meteor Streams. I am going to look into that more.Gift

© 2022 - 2024 — McMap. All rights reserved.