0

ON PC

  • I have set up node-red to run on an windows 10 PC.
  • I use the "Manage Palette" tab to install node-red-node-google gadgets.
  • I set up a Google API account to provide api credentials. I have only set up one project and asked for credentials for one api.
  • I draw a node-red flow to send calendar events to debug window.
  • I config the "google calendar out" node with the credentials supplied by google and add the callback recommended in node-red node to the google api list of "Authorised redirect URIs". The callback recommended by calendar out node is to localhost.
  • I set up a google calendar and test to find debug window receives details of calendar start and stop events as expected.

ON ODROBIAN (DEBIAN)

  • I then repeat process by installing node-red onto odroid-c1 running odrobian vanilla (a console based debian).
  • I go through the same process.
  • Google calendar configuration this time suggests a callback of node-red.example.com and recommends updating /etc/hosts with mapping of ip of odroid to node-red.example.com.
  • The node-red.example.com callback is added to api callback uri on api account. The odroid ip is mapped to node-red.example.com in /etc/hosts as recommended.
  • Odroid is rebooted, node-red fired up, attempt is made to "Authenticate with google" and the api Request Permission page is displayed.
  • "Allow" is selected but a "node-red.example.com’s server DNS address could not be found." is displayed.
  • Firewall settings were experimented with but nothing allows the Request Permission to complete.

So, following the same steps as for the PC sees the api permission fail at last step on the debian running on arm-v7 based odroid c1.

The callback uri is generated by the node-red-node-google configuration node so it is not immediately apparent that can be easily changed. Certainly, setting the callback to localhost, as in the PC version, appeared to be a preferred option but ifandonlyif it was actually easily configurable.

Short of breaking into the software to change the callback to localhost, are there any avenues to fix the DNS address missing problem?

  • Update the question to include the changes you made to /etc/hosts so we can see what you added – hardillb Dec 27 '16 at 09:06
  • I simply followed the instruction prompt on the google config gadget which provided the IP and domain name to use. The IP was the IP of my odroid, the domain name was node-red.example.com. Which is actually what I mentioned in one of the dot points above where I said "The odroid ip is mapped to node-red.example.com in /etc/hosts as recommended." –  Dec 27 '16 at 22:56
  • Still, add the /etc/hosts entry to the question so we can SEE the actual changes you made – hardillb Dec 27 '16 at 23:07
  • Also are you running the browser to access the Node-RED UI on the odroid or on your laptop? – hardillb Dec 27 '16 at 23:38
  • node-red.example.com –  Dec 27 '16 at 23:58
  • Browser is running on PC in all situations. –  Dec 28 '16 at 00:02

1 Answers1

0

Assuming you updated the /etc/hosts on the odroid and you are accessing the Node-RED UI from some other machine.

Adding an entry to the /etc/hosts file only changes how the odroid machine will resolve DNS addresses not how the machine you access the Node-RED UI resolves DNS addresses. This matters because the OAuth redirect will be handled by the machine accessing the UI not the odroid machine.

For this to work you need to edit the hosts file on your windows machine not the odroid.

hardillb
  • 54,545
  • 11
  • 67
  • 105
  • But this is not a suitable solution if I want to deploy so what is a better solution if I want to deploy? –  Dec 28 '16 at 00:16
  • That's a different question, you asked why it didn't work for this instance. But you can make sure your odroid machine has a proper DNS entry – hardillb Dec 28 '16 at 00:19
  • For example, PC version can be browsed to by android and iOS devices without have to change hosts. –  Dec 28 '16 at 00:21
  • Asked how to fix DNS addressing problem. –  Dec 28 '16 at 00:23
  • If it helps, I hacked google.html to change node-red.example.com to localhost. By your reasoning that would have built an uri that would reflect the host the browser was calling from. All I got was a failure to connect to localhost in that instance. –  Dec 28 '16 at 00:25
  • So sorry, you jumped in to provide answer too early it seems. –  Dec 28 '16 at 00:26
  • No, editing the HTML won't work, I said edit the hosts file on the windows machine, not the html. Pointing the browser at localhost won't work because node-red isn't running on that machine – hardillb Dec 28 '16 at 00:27
  • Yep, but it was only an experiment, and we are still talking about your non-deployable solution. Thank you for your attempts. I will investigate further sorting the odroid host and DNS. –  Dec 28 '16 at 00:41
  • I took your advice. I now have the domain mapped to the odroid ip in the PC hosts file. However, I get a site cannot be reached, connection timeout. I will play with firewall but again this is not looking like a good solution. –  Dec 28 '16 at 04:26
  • I setup a DDNS noip account and configured my isp router. I found then the uri request for the api did not work with the domain name but did with the raw IP of the odroid. –  Dec 28 '16 at 06:52
  • I have gone the whole hog and installed dnsmasq so I will rip out your suggested changed to hosts on PC, and back out of using no-IP, as I am assuming dnsmasq will pick up hosts for local dns from /etc/hosts on odroid. –  Dec 28 '16 at 09:14