Closed kolban-google closed 5 years ago
It turns out that a Linux environment that wants to connect with GCP must have the environment variable GOOGLE_CLOUD_PROJECT set to the project Id in order to work. In our tests, we then tested with:
export GOOGLE_CLOUD_PROJECT=<MyProjectId>
node-red
and all worked. Now we need to validate that we can set it in /etc/environment and it will work.
The story did NOT work by editing /etc/environment and this is because Node-RED on PI is commonly started with:
node-red-start
This is governed by systemctl command which forces its own environment variables. If we use this technique, then we must edit /lib/systemd/system/nodered.service
and add a line that reads:
Environment="GOOGLE_CLOUD_PROJECT=[YOUR_PROJECT]"
within the [Service]
section.
Documentation updated and pushed to branch dev
. Will close once published.
When we install the latest Node-RED on a Raspberry Pi and attempt to use the nodes, we get an error: