Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

provide a mechanise for one device to *listen* to another devices publishes #80

Closed
sumnerboy12 opened this issue Apr 30, 2016 · 8 comments

Comments

@sumnerboy12
Copy link

Example - I have a Wemos D1 with the DHT22 shield, publishing temperature and humidity values to separate nodes. I would like to configure another Wemos with the OLED shield to display the values of these sensors. The idea being the sensor lives in some hard-to-reach place, and the display is in my living room for easy viewing.

I can't see a way to do this with Homie currently - unless I am missing something? I can obviously write a custom (non-Homie) sketch which subscribes to those MQTT topics and displays the values, but I thought this would be a good feature to add to homie.

Let me know your thoughts. I am guessing some sort of special subscribe handler which takes the device id, node id and property name, and a handler. Just a wrapper around an MQTT subscribtion which makes it easy to listen to other homie nodes.

@jpmens
Copy link

jpmens commented Apr 30, 2016

Depending on the number of subscriptions thusly set up, I'd fear a bit of instability on the subscribing device; my experiments with PubSubClient have shown that a few messages in a couple of seconds can cause the device to reset / reboot.

@sumnerboy12
Copy link
Author

Understood, but I still think it would be a useful feature - this remote display would be quite useful but currently can't be done within the Homie f/w. If someone subscribes to 45 different feeds, updating every 2s then be it upon their head!

@marvinroger
Copy link
Member

This would indeed be useful. However, as @jpmens said, there are issues when subscribing to more than 5 topics (knolleary/pubsubclient#98). This can be fixed by adding a loop() call in between subscribe call. But there is another issue with SSL enabled, we can't subscribe to more than 3 topics (knolleary/pubsubclient#141). Homie already subscribes to node properties, to $ota and to $reset, so I am afraid what you're asking won't be doable.

@jpmens
Copy link

jpmens commented May 2, 2016

I wonder whether the other pubsubclient would mitigate these issues ...

@sumnerboy12
Copy link
Author

Looks like I might have to use mqttwarn to pipe the messages from one node to the other. Not very elegant but it should work.

Is there any reason you don't just subscribe to basetopic/devicename/#? This would only require a single subscription leaving room for a couple of user-defined subscribes.

@jpmens
Copy link

jpmens commented May 3, 2016

@sumnerboy12 the publishes from the device would come right back and probably kill it. That, at least is what my tests with PubSubClient (outside of Homie) have shown, but I'm very confident @marvinroger has something more intelligent to say about this. :-)

@sumnerboy12
Copy link
Author

good point! will leave this to the experts then.

@marvinroger
Copy link
Member

This is is what we did first, but we had to revert this, because as @jpmens said, the device was killing itself.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants