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. sendTxPowerLevel and sendSignalStrength

sendTxPowerLevel and sendSignalStrength

Scheduled Pinned Locked Moved Development
7 Posts 3 Posters 874 Views 5 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
    manutremo
    wrote on last edited by
    #1

    Hi, I'm interested on using the functions in the post title. I'm running Mysensors 2.2.0., and I have

    #define MY_SIGNAL_REPORT_ENABLED
    

    in my sketch.

    If I add something like

    sendSignalStrength (6);
    

    or

    sendTxPowerLevel (6);
    

    to my sketch, the Arduino compiler complains about undefined references.

    What do I need to do to get them working?

    Thanks.

    1 Reply Last reply
    1
    • berkseoB Offline
      berkseoB Offline
      berkseo
      wrote on last edited by
      #2

      With pleasure, too, I want comments from the founding fathers. How to use? Linker error.

      1 Reply Last reply
      1
      • scalzS Offline
        scalzS Offline
        scalz
        Hardware Contributor
        wrote on last edited by scalz
        #3

        Hi,

        • when you enable MY_SIGNAL_REPORT_ENABLED, it should automatically send signal quality to the controller. Ideally controller could handle this message type. It is an internal message type I_
        • I think these two functions doesn't work because they aren't implemented yet, maybe simply an oversight or an artefact :)

        To directly get the signal value, you can use transportGetSignalReport() .

        • https://www.mysensors.org/apidocs/group__MyTransportgrp.html#ga45f0081116ad5985b8fc60c66689b871
        • https://github.com/mysensors/MySensors/blob/master/hal/transport/MyTransportHAL.h#L48

        If report is not available for a particular mcu, or a radio module (because of not provided by the hardware itself or not implemented yet), then it should return INVALID_RSSI, INVALID_SNR, INVALID_PERCENT, or INVALID_LEVEL

        1 Reply Last reply
        1
        • berkseoB Offline
          berkseoB Offline
          berkseo
          wrote on last edited by
          #4

          @scalz said in sendTxPowerLevel and sendSignalStrength:

          they aren't implemented yet

          this is the most important..

          1 Reply Last reply
          0
          • berkseoB Offline
            berkseoB Offline
            berkseo
            wrote on last edited by berkseo
            #5
            int16_t RSSIQuality;
            typedef enum {
              I_SIGNAL_REPORT_QUALITY  = 35, //!< Device signal quality
            } custom_mysensors_internal_t;
            
            #define MY_RADIO_NRF5_ESB
            #define MY_NODE_ID 200
            #define MY_PARENT_NODE_ID 0
            #define MY_PARENT_NODE_IS_STATIC
            #define MY_TRANSPORT_UPLINK_CHECK_DISABLED
            
            #include <MySensors.h>
            #define CHILD_ID 0
            MyMessage msg(CHILD_ID, V_TEMP);
            
            void setup() {
            }
            
            void loop() {
              send(msg.set(25.0 + random(0, 30) / 10.0, 2),1);
              RSSIQuality = calculationRssiRxQuality();
              sendSignalStrength(RSSIQuality, 1);
              wait(3000, C_INTERNAL, I_SIGNAL_REPORT_QUALITY);
              CORE_DEBUG(PSTR("MyS: TEST WAIT\n"));
              wait(5000);
            }
            
            //****************************** very experimental *******************************
            
            bool sendSignalStrength(const int16_t level, const bool ack)
            {
              return _sendRoute(build(_msgTmp, GATEWAY_ADDRESS, NODE_SENSOR_ID, C_INTERNAL, I_SIGNAL_REPORT_QUALITY,
                                      ack).set(level));
            }
            int16_t calculationRssiRxQuality() {
              int16_t nRFRSSI_temp = transportGetReceivingRSSI();
              int16_t nRFRSSI = map(nRFRSSI_temp, -85, -40, 0, 100);
              if (nRFRSSI < 0) {
                nRFRSSI = 0;
              }
              if (nRFRSSI > 100) {
                nRFRSSI = 100;
              }
              return nRFRSSI;
            }
            
            1 Reply Last reply
            0
            • berkseoB Offline
              berkseoB Offline
              berkseo
              wrote on last edited by berkseo
              #6
              71539 TSF:MSG:SEND,200-200-0-0,s=255,c=3,t=35,pt=2,l=2,sg=0,ft=0,st=OK:42
              71546 TSF:MSG:READ,0-0-200,s=255,c=3,t=35,pt=2,l=2,sg=0:42
              
              1 Reply Last reply
              0
              • scalzS Offline
                scalzS Offline
                scalz
                Hardware Contributor
                wrote on last edited by scalz
                #7

                @berkseo
                yes, until now it has been implemented for rfm radios only, as nrf24 doesn't provide true rssi value. As usual, features appears along interests.
                So if you want it for nrf5, maybe post/PR your snippet on github ;)
                On my side no time for testing this, my mysensors HA isn't 2.4ghz based as I need longer range, and keep 2.4ghz bandwidth in case for others protocol (wifi, ble, zigbee) for limiting issues.

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


                25

                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