We’ve figured that out.
First you need to have enabled the pairing command in firmware. It may work but you will never be able to pair that node again. So uncomment the line and keep the name same as I have:
bc_radio_pairing_request("bcf-qr-code", VERSION);
Second thing which I did not realized is that the string needs to be in quotaition marks "
, so this is how you inject the string.
Here’s the flow of that two nodes
[{"id":"c49c9358.c5d8f","type":"inject","z":"2c41a2bd.aa36ae","name":"","topic":"node/bcf-qr-code:0/qr/-/chng/code","payload":"\"hello\"","payloadType":"str","repeat":"","crontab":"","once":false,"onceDelay":0.1,"x":330,"y":200,"wires":[["9eb8c94d.85d638"]]},{"id":"9eb8c94d.85d638","type":"mqtt out","z":"2c41a2bd.aa36ae","name":"","topic":"","qos":"","retain":"","broker":"29fba84a.b2af58","x":520,"y":200,"wires":[]},{"id":"29fba84a.b2af58","type":"mqtt-broker","z":"","broker":"127.0.0.1","port":"1883","clientid":"","usetls":false,"compatmode":true,"keepalive":"60","cleansession":true,"birthTopic":"","birthQos":"0","birthPayload":"","willTopic":"","willQos":"0","willPayload":""}]
If you use function node to build string, then in JavaScript you need to use escape sequence
text = "hello";
msg.payload = "\"" + text + "\"";
You can see that in this project in node-red flow if you import it.
Please note that the topic node/bcf-qr-code:0/qr/-/chng/code
contains the same name like in teh firmware bc_radio_pairing_request("bcf-qr-code", VERSION);
and also check that you have the same alias in Devices (screen below). I suggest that after you flash the firmware to remove the node from Devices and pair it again.
Then the text hello its displayed