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. Direct Node to Node communications with Signing

Direct Node to Node communications with Signing

Scheduled Pinned Locked Moved Development
17 Posts 3 Posters 3.4k 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.
  • AnticimexA Anticimex

    @BenCranston If you want signed messages in both directions, they both need to present themselves to each other. This is because you would otherwise get a loop where both sketches respond to a presentation with their own presentation.
    In general, a node that has any requirements with respect to security, has to present this to any other node it expect to follow these requirements. The only exception is node/gw relationships which is handled automatically by the node2gw presentation done by the library.
    It is safe to keep the node<->node signing presentation calls no matter what security requirements you enable. The function will always take care of presenting the current config. So you can still do a signerPresentation() even if you do not require any signatures/whitelisting and even if you don't support signing at all.

    M Offline
    M Offline
    Mr.Osaka
    wrote on last edited by
    #8

    @Anticimex I have a similar problem with my project of a thermostat. I use softsigned messages. I communicate from thermostat-node the aperture of valve to the valve-controller-node via gateway, but the message is not signed.
    here I wrote the sketch and logs.
    I also tried with MY_SECURE_NODE_WHITELISTING, but without results.

    Is possible use this scenario with the stable branch?

    Thanks for your help

    Stefano

    AnticimexA 1 Reply Last reply
    0
    • M Mr.Osaka

      @Anticimex I have a similar problem with my project of a thermostat. I use softsigned messages. I communicate from thermostat-node the aperture of valve to the valve-controller-node via gateway, but the message is not signed.
      here I wrote the sketch and logs.
      I also tried with MY_SECURE_NODE_WHITELISTING, but without results.

      Is possible use this scenario with the stable branch?

      Thanks for your help

      Stefano

      AnticimexA Offline
      AnticimexA Offline
      Anticimex
      Contest Winner
      wrote on last edited by
      #9

      @Mr.Osaka there won't be any feature development of signing on stable brach except for eat eventually will come from development. But technically you should be able to send a signing requirement message from one node to another yourself to inform the nodes about who require signing and who does not.

      Do you feel secure today? No? Start requiring some signatures and feel better tomorrow ;)

      M 1 Reply Last reply
      0
      • AnticimexA Anticimex

        @Mr.Osaka there won't be any feature development of signing on stable brach except for eat eventually will come from development. But technically you should be able to send a signing requirement message from one node to another yourself to inform the nodes about who require signing and who does not.

        M Offline
        M Offline
        Mr.Osaka
        wrote on last edited by
        #10

        @Anticimex thanks for the answer

        AnticimexA 1 Reply Last reply
        0
        • M Mr.Osaka

          @Anticimex thanks for the answer

          AnticimexA Offline
          AnticimexA Offline
          Anticimex
          Contest Winner
          wrote on last edited by
          #11

          @Mr.Osaka
          Not necessarily complicated (but untested).
          Try this:

          sendRoute(build(<message buffer>, <your nodeid>, <destination nodeid>, NODE_SENSOR_ID, C_INTERNAL, I_REQUEST_SIGNING, false).set(true));
          

          This should be sent from the node that expect signed messages to the node that should sign messages.

          Do you feel secure today? No? Start requiring some signatures and feel better tomorrow ;)

          M 1 Reply Last reply
          0
          • AnticimexA Anticimex

            @Mr.Osaka
            Not necessarily complicated (but untested).
            Try this:

            sendRoute(build(<message buffer>, <your nodeid>, <destination nodeid>, NODE_SENSOR_ID, C_INTERNAL, I_REQUEST_SIGNING, false).set(true));
            

            This should be sent from the node that expect signed messages to the node that should sign messages.

            M Offline
            M Offline
            Mr.Osaka
            wrote on last edited by
            #12

            @Anticimex said:

            @Mr.Osaka
            Not necessarily complicated (but untested).

            :relaxed: unfortunately my knowledge of C are very superficial

            I do not know if I found the right place to put code:

            #ifdef MY_SIGNING_FEATURE
            		// Notify gateway (and possibly controller) about the signing preferences of this node
            		//sendRoute(build(msg, nc.nodeId, GATEWAY_ADDRESS, NODE_SENSOR_ID, C_INTERNAL, I_REQUEST_SIGNING, false).set(signer.requestSignatures()));
            		// STEF INSERT
            		sendRoute(build(msg, 143, 200, NODE_SENSOR_ID, C_INTERNAL, I_REQUEST_SIGNING, false).set(true));
            

            unfortunately it was not successful

            To probe, I set the node that receives the signed message as a repeater and I forced the transmitting node to become a child of this node.

            to explain
            Before
            A ----> GW -----> B
            now
            A ----> B ----> GW
            it was not successful too.

            AnticimexA 1 Reply Last reply
            0
            • M Mr.Osaka

              @Anticimex said:

              @Mr.Osaka
              Not necessarily complicated (but untested).

              :relaxed: unfortunately my knowledge of C are very superficial

              I do not know if I found the right place to put code:

              #ifdef MY_SIGNING_FEATURE
              		// Notify gateway (and possibly controller) about the signing preferences of this node
              		//sendRoute(build(msg, nc.nodeId, GATEWAY_ADDRESS, NODE_SENSOR_ID, C_INTERNAL, I_REQUEST_SIGNING, false).set(signer.requestSignatures()));
              		// STEF INSERT
              		sendRoute(build(msg, 143, 200, NODE_SENSOR_ID, C_INTERNAL, I_REQUEST_SIGNING, false).set(true));
              

              unfortunately it was not successful

              To probe, I set the node that receives the signed message as a repeater and I forced the transmitting node to become a child of this node.

              to explain
              Before
              A ----> GW -----> B
              now
              A ----> B ----> GW
              it was not successful too.

              AnticimexA Offline
              AnticimexA Offline
              Anticimex
              Contest Winner
              wrote on last edited by
              #13

              @Mr.Osaka you do this once in your sketch during "boot up". Not inside the library.

              Do you feel secure today? No? Start requiring some signatures and feel better tomorrow ;)

              M 1 Reply Last reply
              0
              • AnticimexA Anticimex

                @Mr.Osaka you do this once in your sketch during "boot up". Not inside the library.

                M Offline
                M Offline
                Mr.Osaka
                wrote on last edited by Mr.Osaka
                #14

                @Anticimex
                I have put at end of setup(), but I have compile errors

                /home/stef/Dropbox/Progetti/Thermostat.MySensor-v0.04/Thermostat.MySensor-v0.04.ino: In function 'void setup()':
                Thermostat.MySensor-v0.04:192: error: 'build' was not declared in this scope
                   sendRoute(build(msgHeater, 143, 200, NODE_SENSOR_ID, C_INTERNAL, I_REQUEST_SIGNING, false).set(true));
                                                                                                            ^
                Thermostat.MySensor-v0.04:192: error: 'sendRoute' was not declared in this scope
                   sendRoute(build(msgHeater, 143, 200, NODE_SENSOR_ID, C_INTERNAL, I_REQUEST_SIGNING, false).set(true));
                

                And what do you mean by <message buffer>?

                MyMessage msgHeater(CHILD_ID_HVAC, V_STATUS);
                

                msgHeater is <message buffer>?

                ps: sorry for my essential english

                AnticimexA 1 Reply Last reply
                0
                • M Mr.Osaka

                  @Anticimex
                  I have put at end of setup(), but I have compile errors

                  /home/stef/Dropbox/Progetti/Thermostat.MySensor-v0.04/Thermostat.MySensor-v0.04.ino: In function 'void setup()':
                  Thermostat.MySensor-v0.04:192: error: 'build' was not declared in this scope
                     sendRoute(build(msgHeater, 143, 200, NODE_SENSOR_ID, C_INTERNAL, I_REQUEST_SIGNING, false).set(true));
                                                                                                              ^
                  Thermostat.MySensor-v0.04:192: error: 'sendRoute' was not declared in this scope
                     sendRoute(build(msgHeater, 143, 200, NODE_SENSOR_ID, C_INTERNAL, I_REQUEST_SIGNING, false).set(true));
                  

                  And what do you mean by <message buffer>?

                  MyMessage msgHeater(CHILD_ID_HVAC, V_STATUS);
                  

                  msgHeater is <message buffer>?

                  ps: sorry for my essential english

                  AnticimexA Offline
                  AnticimexA Offline
                  Anticimex
                  Contest Winner
                  wrote on last edited by
                  #15

                  @Mr.Osaka yes, well, you can either reuse that buffer or create a new one in the same way. Just make sure if you reuse the buffer that you need to make sure it contain the proper data before you use it the next time. The build function is used internally in the library to initiate a message buffer. It might not be available for use in a sketch. You can either use a constructor to initialize a new buffer with the proper settings, or manipulate ab existing buffer to get the data in the message using the api in MyMessage.h

                  Do you feel secure today? No? Start requiring some signatures and feel better tomorrow ;)

                  1 Reply Last reply
                  0
                  • M Offline
                    M Offline
                    Mr.Osaka
                    wrote on last edited by
                    #16

                    Tank's for help and your great work.
                    I will learn C.
                    At the moment is more important my entire project, i wait the next release of MySensors.

                    I will publish soon a "resilient" Thermostat.

                    By,
                    Stefano

                    AnticimexA 1 Reply Last reply
                    0
                    • M Mr.Osaka

                      Tank's for help and your great work.
                      I will learn C.
                      At the moment is more important my entire project, i wait the next release of MySensors.

                      I will publish soon a "resilient" Thermostat.

                      By,
                      Stefano

                      AnticimexA Offline
                      AnticimexA Offline
                      Anticimex
                      Contest Winner
                      wrote on last edited by
                      #17

                      @Mr.Osaka no worries. Thank you. Yes, the signing solution on development branch (which will be part of the next major release) is much easier to work with. Both with personalization, use and any maintenance required. It will also make node to node signing easier to initiate.

                      Do you feel secure today? No? Start requiring some signatures and feel better tomorrow ;)

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


                      21

                      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