OmerTu / GoogleHomeKodi

Control kodi via Google Home / Assistant
524 stars 163 forks source link

Error 401 #205

Closed Brunathaur closed 5 years ago

Brunathaur commented 5 years ago

Hello, sorry for my english; i'm a french guy. I have no issue with ifttt but with the/koditestconnection with my server https://omertu-googlehomekodibj.glitch.me/. when i click on execute, the message is :

Executing request: /koditestconnection 
Unauthorized
{
  "message": "Error in response, Unauthorized with status code: 401", 
  "name": "ResponseException", 
  "status": 401, 
  "statusText": "Unauthorized"
}

I don't know what i must write in .env at the line kodi ip, is it : 192.168.x.xx or external ip : 90.xxx.xx.xx for the moment, i use external ip 90;xxx.xx.xx and when i change it to 192.168.x.xx, i have the message : Executing request: /koditestconnection Gateway Timeout 504 Gateway Time-out and the log is :

Authentication succeeded

Command sent = {"jsonrpc":"2.0","id":1,"method":"GUI.ShowNotification","params":{"title":"Initiated by GoogleHomeKodi","message":"Test Successful!"}}

request failed
route:  /koditestconnection
query:  {}
error:  { FetchError: request to HTTP://192.168.1.28:8099/jsonrpc failed, reason: connect ETIMEDOUT 192.168.x.xx:8099
    at ClientRequest.<anonymous> (/rbd/pnpm-volume/57356092-e57e-4595-8778-7d7008aa5e0d/node_modules/.registry.npmjs.org/node-fetch/1.7.3/node_modules/node-fetch/index.js:133:11)
    at emitOne (events.js:96:13)
    at ClientRequest.emit (events.js:188:7)
    at Socket.socketErrorListener (_http_client.js:324:9)
    at emitOne (events.js:96:13)
    at Socket.emit (events.js:188:7)
    at emitErrorNT (net.js:1290:8)
    at _combinedTickCallback (internal/process/next_tick.js:80:11)
    at process._tickCallback (internal/process/next_tick.js:104:9)
  name: 'FetchError',
  message: 'request to HTTP://192.168.x.xx:8099/jsonrpc failed, reason: connect ETIMEDOUT 192.168.x.xx:8099',
  type: 'system',
  errno: 'ETIMEDOUT',
  code: 'ETIMEDOUT' }
body:  { token: '1234' }

another detail : i have opened on my router the port 8099 like in the kodi config and in the log .env, it is written : Your app is listening on port 3000

Can you help me please ? i am a desperate...

keydon commented 5 years ago
  1. In the glitch hosting scenario you need your external IP
  2. It looks like you got the ports mixed up. 8099 is usually only for the node app, but you according to you log your node app runs on port 3000. Are you sure your kodi listens on 8099? It usually 8080
Brunathaur commented 5 years ago

no, i'm not sure so i have changed 8099 to 8080 and i have changed .env to external ip 90.xxx.xx.xx and this is my new message:

Executing request: /koditestconnection
Internal Server Error "request to HTTP://90.xxx.xx.xx:8080/jsonrpc failed, 
reason: connect ECONNREFUSED 90.xxx.xx.xx:8080"
Brunathaur commented 5 years ago

sorry, i have changed in config kodi also 8099 to 8080 and when i click on execute, this is the new message:

Executing request: /koditestconnection
Unauthorized 
{
  "message": "Error in response, Unauthorized with status code: 401",
  "name": "ResponseException",
  "status": 401,
  "statusText": "Unauthorized"
}
keydon commented 5 years ago

401 means wrong login (user or password or token)

Brunathaur commented 5 years ago

test successful ! thanks a lot ! i had written KODI in .env instead of kodi... now, i am going to test

Brunathaur commented 5 years ago

it works ! just another question. i am a great fan of karaoke and i would like to know if kodi can play karaoke videos with google home (like movies) ?

Brunathaur commented 5 years ago

I've found how to do it. I have tagged all my karaoké videos as music videos and i have tagged all in favourites. and i use "kodi open $" i don't say "from my favourite" so in french, i say "kodi ouvre "titre de la video" and it works. the only issue i have is to play album from an artist...

keydon commented 5 years ago

closed, since the original issue is resolved.