OmerTu/GoogleHomeKodi

Node.js fails to start

nousername8219 opened this issue · 12 comments

Hey,

I've installed node.js and edited the configuration file, I can log into MY_NODE_IP:kodiport and use the built-in remote (I was already configured and am currently (stupidly) paying for Glitch) but I can't start my server.js file.

Node

nod2

Any ideas?

Also, in IFTT I'm assuming I replace my Glitch URL with my IP address? 1234/play for example?

Thanks in advance and thanks for creating this, I honestly don't know how I ever lived without it.

I am assuming you have chosen hosting scenario B2`?

but I can't start my server.js file.

where in the readme does it say it can be started by itself? and yet you seem to try doubleclicking it. why?
Step 9. says to run the command node server.js.
Try it this way instead.

And not sure what your config file censored with 1234 all over the place helps anything... other than you seem to have found the config file.

Also, in IFTT I'm assuming I replace my Glitch URL with my IP address? 1234/play for example?

No idea what 1234 is for you as it is the answer to everything for you. better read steps 10. to 13. again.

Alright, had a coffee.

Sorry for the lack of information.

nod3

I've started running node.js and the auth/listenerport is correct.

Edit: Looks like the problem is being unable to port forward Node.JS

For example, if I set Kodi to Port 1234 to match my port forward rule, canyouseeme.org connects fine. If I change Kodi to port 4321 and then have Node.js listen on Port 1234 it keeps failing on canyouseeme.org and times out in IFTTT.

Any suggestions where I'm going wrong? Kodi hosts file matches.

Edit 2: Kodi Port is port forwarded (for sanity sake) and accessible locally/remotely:

ex

Node.JS tests OK locally but is not accessible remotely:

testkodi

For further sanity sake, this is a previously working port forward rule, the only thing that has changed is using it for Node.JS instead of Kodi.

time

Sorry for the hassle/edits... been testing on and off while running on complete fumes. In desperate need of a holiday!

we are making progress, great :)

Not sure whats what now :D
please go through the troubleshooting https://github.com/OmerTu/GoogleHomeKodi#troubleshooting step by step
Then report back how far you get =)

Also, kodi does not need to be accessible from the internet as far as IFTTT&google-home-kodi is concerned.
IFTTT only talks to the node server to the node_port. In the node config you can use kodis internal IP and internal kodi port.

Hey keydon, thanks for getting back to me.

On step 1. I get the following error:

{ "message": "401 - Missing access token", "name": "ResponseException", "status": 401, "statusText": "401 - Missing access token" }

thats impossible^^ you are doing it wrong. read the instructions more carefully.

The response you are getting is generated from our node application.
but step 1 tells you to talk with kodi itself, not with our node application.

Sorry, misunderstood the instructions... Running on local_ip:kodiport I get the following:

{"id":1,"jsonrpc":"2.0","result":{"volume":100}}

Doesn't prompt for credentials.

snip

so what do we do if step 1 looks good? continue with the next steps...

I thought step 1. was supposed to prompt for credentials...

Try getting your current kodi volume by entering this in your browser:
http://YOUR_INTERNAL_KODI_IP:PORT/jsonrpc?request={"jsonrpc":"2.0","method":"Application.GetProperties","params":{"properties":["volume"]},"id":1}

If you get prompt to enter username and password choose the ones you set in Kodi (also known as YOUR_KODI_USER_NAME and YOUR_KODI_PASSWORD).
If that doesn't work, repeat/check all steps in section A!

(Skipped step 2)

Step 3. Works and tests okay (regardless of the port configured, see below)

Step 4. Fails.

If I change my Node.js port and Kodi port around it opens up to the world. So the problem seems to be port forwarding to Node.Js - not the specific port forwarding rule as that rule works for Kodi, just not Node.JS

So..

Edit the hosts file so node.JS listens on port 1234 and set Kodi to use 8099.

Kodi EXTERNAL_IP:8099 - working
Node.JS EXTERNAL_IP:1234 - not working

Configure Kodi to use port 1234 and change the kodi hosts file so the Node.JS listening port is set to 8099.

Kodi EXTERNAL IP:1234 - working
Node.JS EXTERNAL_IP:8099 - not working

image

Forgot to mention I really appreciate the help keydon! I've honestly got no idea what node.js problem is.

your console output look really weird. Like node is talking to itself o.O
up for a skype or discord session? might be easier that way.

is kodi and node running on the same host?
use your internal kodi ip for the node config.
your router should have one forwarning rule from 8099 to your internal_nodehost:8099

I'd appreciate a chat on Discord. I think we're in 2 completely different timezone's but I'll PM you after work (currently 7:30am here at the time of writing) and have one foot out the door.

Thanks keydon!

haha, indeed two completely different timezones. my discord keydon#9473

Hey, I've created a Discord:

tes5252627#7892

I'll do my best to keep an eye on the chat page. Thanks for offering to help out further!

Edit: Thanks for that, I mustn't have refreshed the page before replying.