GoogleCloudPlatform/node-red-contrib-google-cloud

Add Support For Iot Core Config/Command Receive

nated0g opened this issue · 5 comments

Hello!

Thanks for the wonderful collection of nodes.

Maybe there is already a way of accomplishing this that I'm not aware of, but presently it seems there is not a way to receive "Config" or "Command" messages from IOT Core. I attempted to do this with the default MQTT nodes in NodeRED, but as there is no way to configure the credentials dynamically, I can't send the necessary JWT to authenticate the connection (as you obviously know.)

My desired implementation is to have a Pi running Node-Red act as a gateway for local devices. The Pi Node-RED instance will subscribe to configuration objects/device commands from IOT Core on their behalf, translating the configuration and relaying them along over their respective protocols.

Thanks in advance for any insight.

Howdy my friend. I think I'm stuck for a solution too. We want to avoid re-building an MQTT client input node when Node-RED has one already. I think we are likely going to want to petition the MQTT node owners of Node-RED to provide some form of algorithmic mechanism to configure the password that Node-RED supplies when it connects so that it can receive incoming messages. Another thought ... can we "poll" IoT Core to periodically ask it for config/command messages that are awaiting delivery?

I submitted a PR with an added iot core config-in node. I may have messed up the PR, I forked and then developed on Master and submitted PR for dev branch. What is the best practice here? I'm fairly new to contributing to public projects. I suppose I should have developed on the dev branch in my own fork.

I think that's better

If you like the direction of this I'd be happy to do some more refactoring to allow a shared MQTT Bridge connection between IoT Core nodes, as mentioned in #101. I'll also add a "Command Receive" node, which will be trivial

Changes merged ... welcome to the club!!!