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

Unable to make a call to node-red on the same host #53

Closed
JamesValero opened this issue Aug 11, 2018 · 4 comments
Closed

Unable to make a call to node-red on the same host #53

JamesValero opened this issue Aug 11, 2018 · 4 comments

Comments

@JamesValero
Copy link

JamesValero commented Aug 11, 2018

I have Hassio with the dashio and node-red addons. Dashio is working fine with a physical Amazon Dash when sending a RESTful call to the hassio api URL.

Triggering the workflow via curl on the pi and/or hassio (using the community ssh addon) also works fine.

The trouble comes when trying to do the same to a node-red URL. Now when trying to trigger the node-red URL via the Dash button, dashio logs shows it's getting a 404. Again, a basic curl to the same node-red URL works fine.

Below is the dashio setup (node-red is on port 1880)

    {
      "buttons": [
        {
          "name": "Seventh Generation",
          "address": "18:74:2E:XX:XX:XX",
          "url": "https://XXXXX.duckdns.org:1880/bedroom_lights",
          "headers": "{}",
          "body": "{}"
        }
      ]
    }

Seems like the dashio docker is getting to the endpoint but for some reason it's getting back a 404

    2018-08-10 12:03:24,736 | INFO | Reading config file: /data/options.json
    2018-08-10 12:03:24,737 | INFO | Starting sniffing...
    2018-08-10 12:03:31,709 | INFO | Seventh Generation button pressed!
    2018-08-10 12:03:31,709 | INFO | Request: https://xxxxx.duckdns.org:1880/bedroom_lights
    2018-08-10 12:03:32,038 | INFO | Status Code: 404
    2018-08-10 12:03:32,038 | ERROR | Bad request
    2018-08-10 12:03:32,100 | INFO | Packet captured, waiting 20s ...

Showing how it works fine by doing a simple curl from the hass.io terminal to the same URL

$ curl -v https://xxxx.duckdns.org:1880/bedroom_lights
 *   Trying 47.152.XX.XX...
 * TCP_NODELAY set
 * Connected to xxxxx.duckdns.org (47.152.XX.XX) port 1880 (#0)
 * ALPN, offering http/1.1
 * Cipher selection: ALL:!EXPORT:!EXPORT40:!EXPORT56:!aNULL:!LOW:!RC4:@STRENGTH
 * successfully set certificate verify locations:
 *   CAfile: /Applications/Anaconda/anaconda2/ssl/cacert.pem
   CApath: none
 * TLSv1.2 (OUT), TLS header, Certificate Status (22):
 * TLSv1.2 (OUT), TLS handshake, Client hello (1):
 * TLSv1.2 (IN), TLS handshake, Server hello (2):
 * TLSv1.2 (IN), TLS handshake, Certificate (11):
 * TLSv1.2 (IN), TLS handshake, Server key exchange (12):
 * TLSv1.2 (IN), TLS handshake, Server finished (14):
 * TLSv1.2 (OUT), TLS handshake, Client key exchange (16):
 * TLSv1.2 (OUT), TLS change cipher, Client hello (1):
 * TLSv1.2 (OUT), TLS handshake, Finished (20):
 * TLSv1.2 (IN), TLS change cipher, Client hello (1):
 * TLSv1.2 (IN), TLS handshake, Finished (20):
 * SSL connection using TLSv1.2 / ECDHE-RSA-AES128-GCM-SHA256
 * ALPN, server accepted to use http/1.1
 * Server certificate:
 *  subject: CN=xxxxxx.duckdns.org
 *  start date: Jun 25 18:45:12 2018 GMT
 *  expire date: Sep 23 18:45:12 2018 GMT
 *  subjectAltName: host "xxxxx.duckdns.org" matched cert's "xxxxxx.duckdns.org"
 *  issuer: C=US; O=Let's Encrypt; CN=Let's Encrypt Authority X3
 *  SSL certificate verify ok.
 > GET /bedroom_lights HTTP/1.1
 > Host: xxxxx.duckdns.org:1880
 > User-Agent: curl/7.55.1
 > Accept: */*
 >
 < HTTP/1.1 200 OK
 < X-Powered-By: Express
 < X-Content-Type-Options: nosniff
 < Content-Type: application/json; charset=utf-8
 < Content-Length: 2
 < ETag: W/"2-vyGp6PvFo4RvsFtPoIWeCReyIC8"
 < Date: Fri, 10 Aug 2018 19:01:10 GMT
 < Connection: keep-alive
 <
 * Connection #0 to host xxxxx.duckdns.org left intact
 {}
@danimtb
Copy link
Owner

danimtb commented Sep 19, 2018

Dasshio performs an HTTP Post request to the url indicated with the body and hraders provided. I see in your curl command traces a GET request.

Could this be the issue? Thanks for commenting ans sorry for my delayed response.

@danimtb
Copy link
Owner

danimtb commented Oct 31, 2018

@JamesValero is this still an issue or can it be closed?

@JamesValero
Copy link
Author

JamesValero commented Oct 31, 2018 via email

@danimtb
Copy link
Owner

danimtb commented Apr 14, 2019

@danimtb danimtb closed this as completed Apr 14, 2019
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

2 participants