Where to send messages about battery charge and signal strength?
-
If I send a message with a sensor ID of
NODE_SENSOR_ID, I get the following duplicate message errors:reportMsg(NODE_SENSOR_ID, I_SIGNAL_REPORT_RESPONSE, static_cast<uint16_t>(rssi));errors:
951492 !MCO:PRO:RC=1 951525 !MCO:PRO:RC=1 951558 !MCO:PRO:RC=1 .. more .. -
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
-
Do I understand correctly that
if (message.sender == 1)is a broadcast message? and it is sent to all nodes at once? -
Do I understand correctly that
if (message.sender == 1)is a broadcast message? and it is sent to all nodes at once? -
@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
RSSIlevel as applied to theMyControllerinterface. The data itself is of course sent and received, but there is no display in the corresponding column. I used theS_SOUNDandV_LEVELidentifiers.Here's a screenshot of where it should be, but it's not there :)

-
@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
RSSIlevel as applied to theMyControllerinterface. The data itself is of course sent and received, but there is no display in the corresponding column. I used theS_SOUNDandV_LEVELidentifiers.Here's a screenshot of where it should be, but it's not there :)

@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:

Note that the rssi value is recorded as a value of the gateway. It is not recorded as a value of the node.
-
@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
RSSIlevel as applied to theMyControllerinterface. The data itself is of course sent and received, but there is no display in the corresponding column. I used theS_SOUNDandV_LEVELidentifiers.Here's a screenshot of where it should be, but it's not there :)

@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!
-
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.
-
Yes, I found :)
It may be useful for those who might come across this issue later:Code for sending
RSSIfromloopfunction.
It is not necessary to announce (present) theRSSIsensor.MY_CRITICAL_SECTION { char *buff = new char[18]{}; (void) snprintf(buff, 17, "rssi:%d", rssi); reportMsg(getId(), V_VAR5, buff); delete [] buff; }