Hi here,
sorry for re-opening, but I went through this topic and I’m still not sure, how to deal with it.
At this moment, I can see following topics with values on my mqtt brooker:
node/kit-flood-detector:0/thermometer/0:1/temperature 9.00
node/kit-lcd-thermostat:0/thermometer/0:1/temperature 20.81
And I’m trying to subscribe it in my code (also, an example), but it does not work:
static const bc_radio_sub_t subscribes[] = {
{"kit-flood-detector:0/thermometer/0:1/temperature", BC_RADIO_SUB_PT_FLOAT, temperature_outdoor_roof_set, NULL},
{"kit-lcd-thermostat:0/thermometer/0:1/temperature", BC_RADIO_SUB_PT_FLOAT, temperature_outdoor_set, NULL},
};
bc_radio_init(BC_RADIO_MODE_NODE_LISTENING);
bc_radio_set_rx_timeout_for_sleeping_node(2000);
bc_radio_set_subs((bc_radio_sub_t *) subscribes, sizeof(subscribes) / sizeof(bc_radio_sub_t));
bc_radio_pairing_request(FIRMWARE, VERSION);
It looks like there are two problems:
- correct format of subscribes
- length of topic name to subscribes
Some of my messages are generated by nodes not so easily available to update, so I’m thinking about resending those messages by Node-RED. In this case, what will be the best name to publish and subscribe?
I’m thinking about following format to be sent by Node-RED:
meteo/-/temp/outdoor
meteo/-/temp/indoor
What will be be the right name to subscribe?
Thank you in advance for any advice.