Request data from another sensor?
-
Hi all, first post from me.
As I have understood, it is possible for sensor A to fetch values from sensor B. Can someone provide an example of how that is done?
My goal is to create a sensor that has an LCD connected that will display the temperature from other sensors (preferably both MySensor and z-wave).
-
You can request values directly from another sensors for your LCD sensor node, but it's better to send LCD text data directly from controller to LCD node. Requesting data directly from another nodes is not very good choice, because of this nodes must not use deep sleep (so must not be battery powered).
My LCD node contains two 2004 LCD displays and receives text data for every display line from controller. But I'm using my own perl script as controller.
-
@robosensor said:
You can request values directly from another sensors for your LCD sensor node, but it's better to send LCD text data directly from controller to LCD node. Requesting data directly from another nodes is not very good choice, because of this nodes must not use deep sleep (so must not be battery powered).
If you wake-up and push the data from the sensor to the LCD node, it would be no more power-consuming than transmitting to gateway, all messages go through the gateway anyway.
-
Since my nodes are all mains powered, they are not sleeping. My question in particular is how a request from node A would show up in node B. Obviously as an incoming message, but in which way would it be coded ? I haven't seen any examples or a description here.
Any hints would be highly appreciated.
Thanks a lot in advance
Josh
-
You can check the message content for any attribute like:
void incomingMessage(const MyMessage &message) { // We only expect one type of message from controller. But we better check anyway. if (message.type==V_LIGHT) {} }
The attributes are defined in MyMessage.h, "sender" would be the node requesting.
uint8_t last; // 8 bit - Id of last node this message passed uint8_t sender; // 8 bit - Id of sender node (origin) uint8_t destination; // 8 bit - Id of destination node uint8_t version_length; // 3 bit - Protocol version // 5 bit - Length of payload uint8_t command_ack_payload; // 3 bit - Command type // 1 bit - Request an ack - Indicator that receiver should send an ack back. // 1 bit - Is ack messsage - Indicator that this is the actual ack message. // 3 bit - Payload data type uint8_t type; // 8 bit - Type varies depending on command uint8_t sensor; // 8 bit - Id of sensor that this message concerns.
-
Thank you very much for this very useful answer ! This is exactly what I was looking for but did not find.
I will try it in my system.
Thanks a lot again.
Cheers, Josh
-
This came up before.
http://forum.mysensors.org/topic/1085/node-to-node-communicationBasically when the sensor sends the data to the controller you can have it send the same data to the LCD. That would most likely provide a longer battery life than requesting the data from the sensors. Doing it this way only the LCD (and the controller) have to be on all the time.
-
That totally makes sense.
I have come to the conclusion that I will probably let my Vera push the info to the LCD node.
Suggested Topics
-
Arduino Celebrates 10 years (Malmö/Sweden)
Announcements • 29 Mar 2014, 17:08 • hek 29 Mar 2014, 17:08 -
Sending offset to node
Development • 31 Jan 2025, 00:59 • bsl88k 4 Feb 2025, 12:14 -
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 -
[mysensors] Not a valid message: invalid literal for int() with base 10: '\x00\x000'
Development • 18 Sept 2024, 20:34 • kiesel 20 Sept 2024, 08:28 -
Adding Listen only device to my system.
Development • 13 days ago • dpcons 13 days ago