Best posts made by GothicMaestro
Latest posts made by GothicMaestro
RE: New sensor types for water parameters required
Well, that's the info: ORP
Used for water quality in sea aquariums. Measured in V/mV.
Strange behavior of radio message callback
I've stumbled upon a strange behavior of radio meassge callback firing. I have a node with a temperature sensor and a relay.
In setup() I have
if (lastTemperature != temperature && temperature != -127.00)
lastTemperature[sensorID] = temperature;
And my callback is:
void onMessageReceived(const MyMessage &message)
if (message.type == V_LIGHT)
bool value = message.getBool();
digitalWrite(message.sensor + FIRST_RELAY_PIN, value ? RELAY_ON : RELAY_OFF);
When I once send a switch command to a relay from my controller callback fires up and relay switches. But then it keeps firing with the same parameter value EVERY time when temperature value is sent to controller. That was unexpected to me. Investigation of code of MySensor::process() function shows that value of "len" variable
uint8_t len = RF24::getDynamicPayloadSize();
equals 8 in case when the "true" radio message for relay is received and equals 1 in the rest of cases when temperature value is sent. In other words, callback fires both when message is received (len = 8 ) and is sent by a node (len = 1).
Changing the end code of process() from
if (msgCallback != NULL)
if (msgCallback != NULL && len > 1)
solved the issue. But I think it's a temporary patch and not the right solution. Could the MySensors developers please take a look at this issue.
And thank you for a great project and all hard work done!