Skip to content
  • MySensors
  • OpenHardware.io
  • Categories
  • Recent
  • Tags
  • Popular
Skins
  • Light
  • Brite
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Brand Logo
  1. Home
  2. Development
  3. Request data from another sensor?

Request data from another sensor?

Scheduled Pinned Locked Moved Development
8 Posts 6 Posters 4.1k Views 3 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • DaLiD Offline
    DaLiD Offline
    DaLi
    wrote on last edited by
    #1

    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).

    1 Reply Last reply
    0
    • R Offline
      R Offline
      robosensor
      wrote on last edited by
      #2

      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.

      BulldogLowellB 1 Reply Last reply
      0
      • R robosensor

        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.

        BulldogLowellB Offline
        BulldogLowellB Offline
        BulldogLowell
        Contest Winner
        wrote on last edited by
        #3

        @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.

        1 Reply Last reply
        0
        • J Offline
          J Offline
          joshmosh
          wrote on last edited by
          #4

          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

          1 Reply Last reply
          0
          • AWIA Offline
            AWIA Offline
            AWI
            Hero Member
            wrote on last edited by
            #5

            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.
            
            1 Reply Last reply
            0
            • J Offline
              J Offline
              joshmosh
              wrote on last edited by
              #6

              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

              1 Reply Last reply
              0
              • ChaoticC Offline
                ChaoticC Offline
                Chaotic
                wrote on last edited by
                #7

                This came up before.
                http://forum.mysensors.org/topic/1085/node-to-node-communication

                Basically 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.

                1 Reply Last reply
                0
                • DaLiD Offline
                  DaLiD Offline
                  DaLi
                  wrote on last edited by
                  #8

                  That totally makes sense.
                  I have come to the conclusion that I will probably let my Vera push the info to the LCD node.

                  1 Reply Last reply
                  0
                  Reply
                  • Reply as topic
                  Log in to reply
                  • Oldest to Newest
                  • Newest to Oldest
                  • Most Votes


                  14

                  Online

                  11.7k

                  Users

                  11.2k

                  Topics

                  113.1k

                  Posts


                  Copyright 2025 TBD   |   Forum Guidelines   |   Privacy Policy   |   Terms of Service
                  • Login

                  • Don't have an account? Register

                  • Login or register to search.
                  • First post
                    Last post
                  0
                  • MySensors
                  • OpenHardware.io
                  • Categories
                  • Recent
                  • Tags
                  • Popular