Is this possible? MQTT & Node request...
-
Evening all,
I'm currently using the MQTT client on an ESP8266. I have a number of sensors deployed using a mixture of Nano's and Mini's.
I'd like to know if this is possible:
Node 1 - Rain Sensor (Digital input) / Soil Sensor (Digital Input) / Light Sensor
Node 2 (Sleeps and wakes every 10 minutes) - Relay
I'd like Node 2 to wake and check either the values of node 1, or alternatively check a source such as NodeRED for the values. Based on the values open / close the relay.
Currently I have the MQTT client connected to Mosquitto.
-
Yes, it is possible to send a request-message to any node (see api).
But your Node1 have to answer Node2's requests-messages manually in its incomingMessage-method. As The MySensors library doesn't keep any last state by itself.
-
Hello @hek
Thank you for the reply, and the amazing MySensors.
Do you think I could have Node2 request some kind of status from NodeRed for example, rather than the Node directly?
Cheers,
Mark
-
Sure, if NodeRed can keep the state and answer req-messages. I don't know the full capabilities of NodeRed.
-
@Mark-Swift check this for node-to-node communication http://forum.mysensors.org/topic/3467/basic-setup-network/2 as @hek said setup a database in nodered to save the values received from node-1 and you could request that from node-2
Suggested Topics
-
Arduino Celebrates 10 years (Malmö/Sweden)
Announcements • 29 Mar 2014, 17:08 • hek 29 Mar 2014, 17:08 -
Saving last known good state, but not in EEPROM
Development • 30 Jan 2024, 18:46 • OldSurferDude 15 Jan 2025, 08:51 -
Counting Incoming and Outgoing Messages from a Gateway
Development • 10 Dec 2024, 21:57 • Trand 14 Dec 2024, 20:23 -
MQTT-Help me understand about the MQTT Gateway.
Development • 2 Mar 2025, 01:44 • dpcons 28 days ago -
Radio waking up for no reason.
Development • 4 Jul 2020, 21:09 • Sasquatch 15 Jan 2025, 08:33 -
LAN8720A - will mysensors work with this module
Development • 13 Nov 2024, 17:06 • Marcin 15 Nov 2024, 10:59