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.


  • Admin

    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


  • Admin

    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


Log in to reply
 

Suggested Topics

  • 1
  • 1
  • 2
  • 2
  • 1
  • 3

61
Online

11.4k
Users

11.1k
Topics

112.6k
Posts