Closed geniusjam closed 4 years ago
@NCem, hi! Thank you for your request. But now i don't own this model of TV and cannot reproduce this issue:(
@NCem, clould you set
tvApi.setDebugMode(true)
and try again?
Okay it started to get a lot more weird. I can't replicate it anymore. I'm sure that the credentials are right Here is my code and the output:
const TvApi = require("node-lgtv-api");
const tvApi = new TvApi("192.168.1.104", "8080", "806905");
tvApi.setDebugMode(true);
tvApi.authenticate().then(() => {
console.log("Connected!");
//tvApi.queryData(tvApi.TV_INFO_CHANNEL_LIST).then(arr=>console.log("channel count:", arr.length), console.error);
//tvApi.processCommand(tvApi.TV_CMD_CHANGE_CHANNEL, [89]).then(console.log, console.error)
}, console.error);
PS D:\Projects\webos> node .\lgtvapi.js
REQ:undefined
RESP:<?xml version="1.0" encoding="utf-8"?><envelope><ROAPError>400</ROAPError><ROAPErrorDetail>Bad Request</ROAPErrorDetail></envelope>
Error: Response code:400
at getErrorMessage (D:\Projects\webos\node_modules\node-lgtv-api\app.js:8:18)
at Request._callback (D:\Projects\webos\node_modules\node-lgtv-api\app.js:106:50)
at Request.self.callback (D:\Projects\webos\node_modules\request\request.js:185:22)
at Request.emit (events.js:210:5)
at Request.<anonymous> (D:\Projects\webos\node_modules\request\request.js:1154:10)
at Request.emit (events.js:210:5)
at IncomingMessage.<anonymous> (D:\Projects\webos\node_modules\request\request.js:1076:12)
at Object.onceWrapper (events.js:299:28)
at IncomingMessage.emit (events.js:215:7)
at endReadableNT (_stream_readable.js:1184:12)
It seems, invalid otp is. Could you request new one?
new TvApi("192.168.1.104", "8080");
tvApi.setDebugMode(true);
tvApi.authenticate().catch(err => console.log(err));
If all will be right, you ll see new code on your TV.
I face this error when i do
tvApi.processCommand(tvApi.TV_CMD_CHANGE_CHANNEL, [89]).then(console.log, console.error)
(and for many other commands) Querying data is fine.