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. Send data to other sensor

Send data to other sensor

Scheduled Pinned Locked Moved Development
8 Posts 4 Posters 3.4k Views 1 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.
  • ch3b7C Offline
    ch3b7C Offline
    ch3b7
    wrote on last edited by
    #1

    Can I send data to other sensors directly from the arduino serial window?

    H 1 Reply Last reply
    0
    • ch3b7C ch3b7

      Can I send data to other sensors directly from the arduino serial window?

      H Offline
      H Offline
      hek
      Admin
      wrote on last edited by
      #2

      @ch3b7

      The gateway is the only place where you can send out data via serial window. The Sensor-class does not listen to serial input.

      But it is a two-liner to send a value (1.4 example below).

      MyMessage msg = new MyMessage(<chidldSensorId>,<dataType>).setDestination(<destinationNode>).set(<value>);
      gw.send(msg);
      
      Y 1 Reply Last reply
      0
      • ch3b7C Offline
        ch3b7C Offline
        ch3b7
        wrote on last edited by
        #3

        This example work in 1.4b1 (18848a2) ?

        1 Reply Last reply
        0
        • H hek

          @ch3b7

          The gateway is the only place where you can send out data via serial window. The Sensor-class does not listen to serial input.

          But it is a two-liner to send a value (1.4 example below).

          MyMessage msg = new MyMessage(<chidldSensorId>,<dataType>).setDestination(<destinationNode>).set(<value>);
          gw.send(msg);
          
          Y Offline
          Y Offline
          Yveaux
          Mod
          wrote on last edited by
          #4

          @hek said:

          MyMessage msg = new MyMessage(<chidldSensorId>,<dataType>).setDestination(<destinationNode>).set(<value>);
          gw.send(msg);
          

          This will not compile, as the new()-operator returns a pointer to a MyMessage object.
          Better to compress the whole to:

          gw.send( MyMessage(<chidldSensorId>,<dataType>).setDestination(<destinationNode>).set(<value>) );
          

          http://yveaux.blogspot.nl

          J 1 Reply Last reply
          0
          • ch3b7C Offline
            ch3b7C Offline
            ch3b7
            wrote on last edited by
            #5

            can i put values like this "gw.send( MyMessage("1","3").setDestination("2").set("1") );" ?

            1 Reply Last reply
            0
            • Y Yveaux

              @hek said:

              MyMessage msg = new MyMessage(<chidldSensorId>,<dataType>).setDestination(<destinationNode>).set(<value>);
              gw.send(msg);
              

              This will not compile, as the new()-operator returns a pointer to a MyMessage object.
              Better to compress the whole to:

              gw.send( MyMessage(<chidldSensorId>,<dataType>).setDestination(<destinationNode>).set(<value>) );
              
              J Offline
              J Offline
              jendrush
              wrote on last edited by
              #6

              @Yveaux Could you write sample messages to send from node, and receive value on another?

              Y 1 Reply Last reply
              0
              • J jendrush

                @Yveaux Could you write sample messages to send from node, and receive value on another?

                Y Offline
                Y Offline
                Yveaux
                Mod
                wrote on last edited by
                #7

                @jendrush do you want some example code? I don't understand...

                http://yveaux.blogspot.nl

                J 1 Reply Last reply
                0
                • Y Yveaux

                  @jendrush do you want some example code? I don't understand...

                  J Offline
                  J Offline
                  jendrush
                  wrote on last edited by
                  #8

                  @Yveaux Yes, example messages. Something like that - i have temperature from dht22 on one node, and i want to send this value to example node with radio id 2. Second thing, how to pick this value on radio node with id 2?

                  1 Reply Last reply
                  0

                  Hello! It looks like you're interested in this conversation, but you don't have an account yet.

                  Getting fed up of having to scroll through the same posts each visit? When you register for an account, you'll always come back to exactly where you were before, and choose to be notified of new replies (either via email, or push notification). You'll also be able to save bookmarks and upvote posts to show your appreciation to other community members.

                  With your input, this post could be even better 💗

                  Register Login
                  Reply
                  • Reply as topic
                  Log in to reply
                  • Oldest to Newest
                  • Newest to Oldest
                  • Most Votes


                  14

                  Online

                  12.0k

                  Users

                  11.2k

                  Topics

                  113.4k

                  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