Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Simple example for starting #13

Open
zapicoj opened this issue Sep 10, 2019 · 8 comments
Open

Simple example for starting #13

zapicoj opened this issue Sep 10, 2019 · 8 comments

Comments

@zapicoj
Copy link

zapicoj commented Sep 10, 2019

Hello,
I found the concept of your IFTTT node very interesting as an easy way to interface node-red with IFTT service. I installed the nodes in Node-Red (in RPi) and have been trying to test the two nodes (action & trigger) with Google assistant service but, unfortunately, I did not get the expected results. I don't know exactly where to get the Service key for setting up the IFTTT broker. I understand that this Service key must also be in the IFTTT URL when we define the applet (is that correct?).
Could you show me (or tell me a link) for a simple example with the main parameters for introducing in the applet and those for setting up the IFTTT broker node in node-red ?
Much appreciated.

Jose Zapico

@zapicoj
Copy link
Author

zapicoj commented Sep 11, 2019

Hello,
Just for your information.
Trying to use "action" node I got the error below. I needed to remove all flows to be able to restart the node-red. It was in a loop trying to restart.
I am running the node-red in RPi3. node-red v0.20.8

[{"id":"6a1a85d4.49da8c","type":"ifttt-action","z":"c9d33f34.7d14b","broker":"93bdb72b.da90c8","endpoint":"/cocina/tostadora","fields":[{"name":"value","required":true,"sampleDataValid":"__value_sampleData_valid__","sampleDataInvalid":"__value_sampleData_invalid__"}],"submit":"submit","cancel":"cancel","name":"","x":377.99999999999994,"y":399.9999999999999,"wires":[["f2b04a1e.232688"]]},{"id":"f2b04a1e.232688","type":"debug","z":"c9d33f34.7d14b","name":"","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"true","targetType":"full","x":595.9999999999999,"y":291.99999999999994,"wires":[]},{"id":"93bdb72b.da90c8","type":"ifttt-broker","z":"","host":"localhost","port":"443","apiVersion":"v1","name":""}]

This is the error:

[red] Uncaught Exception:

11 Sep 10:50:47 - Error: listen EACCES: permission denied 0.0.0.0:443
at Server.setupListenHandle [as _listen2] (net.js:1262:19)
at listenInCluster (net.js:1327:12)
at Server.listen (net.js:1414:7)
at Function.listen (/home/pi/.node-red/node_modules/express/lib/application.js:618:24)
at new IFTTTBrokerNode (/home/pi/.node-red/node_modules/node-red-contrib-ifttt-broker/ifttt-broker.js:42:29)
at Object.createNode (/usr/lib/node_modules/node-red/node_modules/@node-red/runtime/lib/nodes/flows/util.js:483:31)
at Flow.start (/usr/lib/node_modules/node-red/node_modules/@node-red/runtime/lib/nodes/flows/Flow.js:154:40)
at start (/usr/lib/node_modules/node-red/node_modules/@node-red/runtime/lib/nodes/flows/index.js:329:33)
at tryCatchReject (/usr/lib/node_modules/node-red/node_modules/when/lib/makePromise.js:845:30)
at runContinuation1 (/usr/lib/node_modules/node-red/node_modules/when/lib/makePromise.js:804:4)

Thank you for your time
JZ

@yoiang
Copy link
Member

yoiang commented Sep 11, 2019

Hey @zapicoj !
I just saw both of your messages, when I have a chance I'll probably sit down and see if I can reproduce or understand what's going on.

On its nose my first thought is that 443 is a port that requires administrative access. Are you running Node-RED as an administrator? What OS are you using?

@zapicoj
Copy link
Author

zapicoj commented Sep 11, 2019

After your comment via email about the use of port 443 (probably requiring administrative access), I changed it back to 1880 and the error did disappear. thx.
I realized that if the port, used in ifttt broker, is already taken by another server inside node-red (i.e. http node configured with same port) the error is not caught and the node-red enter in a restarting loop.
kind regards,
JZ

@zapicoj
Copy link
Author

zapicoj commented Sep 11, 2019

Sorry I forgot to mention the OS:
Raspbian GNU/Linux 9 (stretch).
:)

@yoiang
Copy link
Member

yoiang commented Sep 13, 2019

Ahh I see, I'll have to consider if there is a way to surface that error better.

Does that mean you're up and running now?

@zapicoj
Copy link
Author

zapicoj commented Sep 14, 2019

Not exactly, :)
I cannot reach my server from an action on IFTTT. The action (at IFTTT side) receives a 404 error from my server. I see the packet arriving in my router, then it's forwarded to the RPi. I am using the same path in the action URL (at IFTTT) and in the IFTTT node (end point).

I did the same exercise using the standard "http in node" (even using https) and it works, I can receive the action from IFTTT. But using the "IFTTT node" I cannot do it. :(
I must be doing something wrong, but I have no reference to get some comparison.
Anyway, I will double-check all my process.

kind regards,
JZ

@yoiang
Copy link
Member

yoiang commented Sep 16, 2019

Since it's harder to have a straight example due to needing to set up the IFTTT side I should really elaborate on the instructions with photos. It especially helps with how confusingly IFTTT names some of these features. 

One thing I remember helping a lot is using the built in debuggers:

  • Endpoint Tests: https://platform.ifttt.com/services/<YOUR SERVICE NAME>/api/endpoint_tests
  • Service Checklist: https://platform.ifttt.com/services/<YOUR SERVICE NAME>/checklist

@elpatron68
Copy link

Hi,

a tutorial or example on how to set up a IFTTT trigger node (on both sides) would be a great help. I just started to think about how to accomplish my plans, let´s see how far I can get without help...

Kind regards
Markus

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants