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. Controllers
  3. MyController.org
  4. Where to send messages about battery charge and signal strength?

Where to send messages about battery charge and signal strength?

Scheduled Pinned Locked Moved MyController.org
12 Posts 3 Posters 174 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.
  • mfalkviddM Online
    mfalkviddM Online
    mfalkvidd
    Mod
    wrote on last edited by
    #3

    I don't recognize any of that code. Where did you find it? I don't think I've ever seen a MySensors sketch with a c++ template in it.

    Sending battery level is done like this:

    sendBatteryLevel(60);
    

    (for a battery level of 60%). Documentation: https://www.mysensors.org/download/sensor_api_20#sending-data

    Sending other values can be done in multiple ways. For an example sending wifi rssi and rssi of incoming MySensors message, see https://github.com/mfalkvidd/Arduino-MySensors-ESP8266-RFM69-Gateway/blob/master/Arduino-MySensors-ESP8266-RFM69-Gateway.ino#L106

    1 Reply Last reply
    0
    • C Offline
      C Offline
      Clone Tv
      wrote on last edited by
      #4

      C ++ templates work great, the main thing is not to use class->virtual and RTTI. I write C ++ fluently, it's easier for me.
      Thanks for your reply and sorry for my "bad" english.

      1 Reply Last reply
      1
      • C Offline
        C Offline
        Clone Tv
        wrote on last edited by
        #5

        Do I understand correctly that if (message.sender == 1) is a broadcast message? and it is sent to all nodes at once?

        https://github.com/mfalkvidd/Arduino-MySensors-ESP8266-RFM69-Gateway/blob/030be620d45f2fd6cf02bc3633879e8bf35f7ef0/Arduino-MySensors-ESP8266-RFM69-Gateway.ino#L122

        mfalkviddM 1 Reply Last reply
        0
        • C Clone Tv

          Do I understand correctly that if (message.sender == 1) is a broadcast message? and it is sent to all nodes at once?

          https://github.com/mfalkvidd/Arduino-MySensors-ESP8266-RFM69-Gateway/blob/030be620d45f2fd6cf02bc3633879e8bf35f7ef0/Arduino-MySensors-ESP8266-RFM69-Gateway.ino#L122

          mfalkviddM Online
          mfalkviddM Online
          mfalkvidd
          Mod
          wrote on last edited by mfalkvidd
          #6

          @Clone-Tv no. Sorry for the confusion. message.sender is the node ID of the sender. For my gateway, I have chosen to only report received rssi for the node with node id 1. Rssi for all other nodes is ignored.

          1 Reply Last reply
          1
          • C Offline
            C Offline
            Clone Tv
            wrote on last edited by
            #7

            @Clone-Tv said in Where to send messages about battery charge and signal strength?:

            message.sender

            Thanks for the clarification about message.sender, but then it is not entirely clear why this is used to receive messages? In essence, this should create a regeneration loop of messages ...

            Unfortunately, it was not possible to deliver the RSSI level as applied to the MyController interface. The data itself is of course sent and received, but there is no display in the corresponding column. I used the S_SOUND and V_LEVEL identifiers.

            Here's a screenshot of where it should be, but it's not there :)

            myc-rssi.png

            mfalkviddM skywatchS 2 Replies Last reply
            0
            • C Clone Tv

              @Clone-Tv said in Where to send messages about battery charge and signal strength?:

              message.sender

              Thanks for the clarification about message.sender, but then it is not entirely clear why this is used to receive messages? In essence, this should create a regeneration loop of messages ...

              Unfortunately, it was not possible to deliver the RSSI level as applied to the MyController interface. The data itself is of course sent and received, but there is no display in the corresponding column. I used the S_SOUND and V_LEVEL identifiers.

              Here's a screenshot of where it should be, but it's not there :)

              myc-rssi.png

              mfalkviddM Online
              mfalkviddM Online
              mfalkvidd
              Mod
              wrote on last edited by mfalkvidd
              #8

              @Clone-Tv rssi is only defined/meaningful when receiving a message, so it must be measured when receiving. To avoid regeneration loop, do not send from within receive(). Only store the value, then send from within loop() like my sketch does.

              I have no experience with mycontroller. This is what it looks like in Domoticz:
              56581AD2-EF35-4AE2-9234-5E53F8AD5A29.png

              Note that the rssi value is recorded as a value of the gateway. It is not recorded as a value of the node.

              1 Reply Last reply
              0
              • C Clone Tv

                @Clone-Tv said in Where to send messages about battery charge and signal strength?:

                message.sender

                Thanks for the clarification about message.sender, but then it is not entirely clear why this is used to receive messages? In essence, this should create a regeneration loop of messages ...

                Unfortunately, it was not possible to deliver the RSSI level as applied to the MyController interface. The data itself is of course sent and received, but there is no display in the corresponding column. I used the S_SOUND and V_LEVEL identifiers.

                Here's a screenshot of where it should be, but it's not there :)

                myc-rssi.png

                skywatchS Offline
                skywatchS Offline
                skywatch
                wrote on last edited by skywatch
                #9

                @Clone-Tv If you go to Resources > Nodes and click the view button (far right) you get to the node details.

                In the Details window click Edit and see if there is anything in the rssi section. You may have to add here manually..... But I never use this as nrf24 don't send rssi data so it's just my best guess at a way to help you out here!

                1 Reply Last reply
                1
                • C Offline
                  C Offline
                  Clone Tv
                  wrote on last edited by
                  #10

                  Many thanks to all who answered, regarding MyController I think I will have to look at the source code, in which topic and with what identifier it expects a message about the RSSI evel.

                  skywatchS 1 Reply Last reply
                  0
                  • C Clone Tv

                    Many thanks to all who answered, regarding MyController I think I will have to look at the source code, in which topic and with what identifier it expects a message about the RSSI evel.

                    skywatchS Offline
                    skywatchS Offline
                    skywatch
                    wrote on last edited by
                    #11

                    @Clone-Tv If you need more hlep then this is the place to ask....

                    https://forum.mycontroller.org/

                    1 Reply Last reply
                    0
                    • C Offline
                      C Offline
                      Clone Tv
                      wrote on last edited by Clone Tv
                      #12

                      Yes, I found :)
                      It may be useful for those who might come across this issue later:

                      Git MYCONTROLLER repo

                      Code for sending RSSI from loop function.
                      It is not necessary to announce (present) the RSSI sensor.

                                          MY_CRITICAL_SECTION {
                                              char *buff = new char[18]{};
                                              (void) snprintf(buff, 17, "rssi:%d", rssi);
                                              reportMsg(getId(), V_VAR5, buff);
                                              delete [] buff;
                                          }
                      
                      
                      1 Reply Last reply
                      1
                      Reply
                      • Reply as topic
                      Log in to reply
                      • Oldest to Newest
                      • Newest to Oldest
                      • Most Votes


                      28

                      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