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. interperating messages from controller

interperating messages from controller

Scheduled Pinned Locked Moved Development
6 Posts 3 Posters 1.3k 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.
  • M Offline
    M Offline
    mango
    wrote on last edited by
    #1

    Hi all,

    I was hoping somebody could help me out here or call me out on not looking properly. I'm currently trying to check messages coming from the controller to the sensor in hope of extracting the Node ID, Child ID in order to toggle the state of the target relay.

    I'm currently confused on the proper way to do it, and have only managed to determine what state the controller is wanting to set on which ever relay it's meant to be targeting.

    I should also note I'm using MySensor Library v2

    Thanks
    Mango

    mfalkviddM Boots33B 2 Replies Last reply
    0
    • M mango

      Hi all,

      I was hoping somebody could help me out here or call me out on not looking properly. I'm currently trying to check messages coming from the controller to the sensor in hope of extracting the Node ID, Child ID in order to toggle the state of the target relay.

      I'm currently confused on the proper way to do it, and have only managed to determine what state the controller is wanting to set on which ever relay it's meant to be targeting.

      I should also note I'm using MySensor Library v2

      Thanks
      Mango

      mfalkviddM Offline
      mfalkviddM Offline
      mfalkvidd
      Mod
      wrote on last edited by
      #2

      Welcome to the MySensors community @mango !
      Could https://www.mysensors.org/download/serial_api_20 be what you are looking for?

      1 Reply Last reply
      0
      • M Offline
        M Offline
        mango
        wrote on last edited by
        #3

        Thanks very much for the welcome as well as the quick response! That does somewhat, but what I'm not so sure about is how one actually extracts it, for example:

        int incoming_command = atoi(message.data);
        

        would allows me to see the state the controller is trying to set my relay to, should I be extracting the node and child ID's in the same way?

        mfalkviddM 1 Reply Last reply
        0
        • M mango

          Thanks very much for the welcome as well as the quick response! That does somewhat, but what I'm not so sure about is how one actually extracts it, for example:

          int incoming_command = atoi(message.data);
          

          would allows me to see the state the controller is trying to set my relay to, should I be extracting the node and child ID's in the same way?

          mfalkviddM Offline
          mfalkviddM Offline
          mfalkvidd
          Mod
          wrote on last edited by mfalkvidd
          #4

          @mango the receive function in the dimmer example shows one way to access the contents of the message.

          https://www.mysensors.org/download/sensor_api_20#message-manipulation shows which set and get functions are available on the message object.

          The sensor can get its own node ID by calling getNodeID(). Info here: https://www.mysensors.org/download/sensor_api_20#received-node-id

          The child id is available through message.sensor Note: sensor is not a function, so no () after. The relay example shows how to use message.sensor.

          1 Reply Last reply
          0
          • M mango

            Hi all,

            I was hoping somebody could help me out here or call me out on not looking properly. I'm currently trying to check messages coming from the controller to the sensor in hope of extracting the Node ID, Child ID in order to toggle the state of the target relay.

            I'm currently confused on the proper way to do it, and have only managed to determine what state the controller is wanting to set on which ever relay it's meant to be targeting.

            I should also note I'm using MySensor Library v2

            Thanks
            Mango

            Boots33B Offline
            Boots33B Offline
            Boots33
            Hero Member
            wrote on last edited by Boots33
            #5

            @mango I also do that in this project. Probably look at my last post for the best example

            1 Reply Last reply
            0
            • M Offline
              M Offline
              mango
              wrote on last edited by
              #6

              I would just like to say a huge thank you to the both of you! Absolute legends! I am now sorted.

              Thanks again lads.

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


              8

              Online

              11.7k

              Users

              11.2k

              Topics

              113.0k

              Posts


              Copyright 2019 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