Your Universal Remote Control Center
RemoteCentral.com
Philips Pronto Professional Forum - View Post
Previous section Next section Up level
Up level
The following page was printed from RemoteCentral.com:

Login:
Pass:
 
 

Topic:
KODI Script
This thread has 4 replies. Displaying all posts.
Post 1 made on November 7, 2025 at 03:08
M
mpg7321
Long Time Member
Joined:
Posts:
RC XP:
June 2020
159
63⭐︎
Been working on KODI again, this script works but only if I reload the page, meaning jump to another page then jump back as long as KODI is running on my shield, I don't know why, any ideas?

System.setDebugMask(9);
var url = CF.widget("Kodi_aURL","Kodi_PARAMETERS").label;
var buffer = "";
var CR = "\x0d";
var rdata, socket;
function onSocketConnect() {
};
function onSocketData() {
var temp,first;
buffer+=socket.read();
first = buffer.indexOf(CR);
while (first >= 0) {
temp = buffer.substring(0, first);
buffer = buffer.substring(first + 1);
notifyMessageReceived(temp);
first = buffer.indexOf(CR);
};
};
function onSocketIOError(e) {
System.print("sock IO Error error:" + e);
};
function notifyMessageReceived(message) {
System.print("Received:");
System.print(message);
};
function closeSocket() {
if (socket) {
if (socket.connected) socket.close;
socket = null;
};
};
function resetSocket() {
closeSocket();
socket = new TCPSocket(false);
buffer = "";
socket.onConnect = onSocketConnect;
socket.onData = onSocketData;
socket.onIOError = onSocketIOError;
};
function kodi(command) {
if (socket) socket.write("jsonrpc?" + command + CR);
};
resetSocket();
socket.connect(url,9090, 500);

Post 2 made on November 9, 2025 at 01:37
L
MOD
Lyndel McGee
RC Moderator
Joined:
Posts:
RC XP:
August 2001
13,125
389⭐︎
I suggest to debug it.

Use System.print and try/catch to better understand the behavior.

I'd also consider adding a callback for socket.onClose as I bet that the server is closing the socket remotely. If that is the case, then you will need to call resetSocket() and connectSocket() after some time when this occurs.

Last edited by Lyndel McGee on November 11, 2025 17:06.
Lyndel McGee
Philips Pronto Addict/Beta Tester
Post 3 made on November 9, 2025 at 14:02
L
MOD
Lyndel McGee
RC Moderator
Joined:
Posts:
RC XP:
August 2001
13,125
389⭐︎
Please also consider offering some tips here.

[Link: remotecentral.com]

Lyndel McGee
Philips Pronto Addict/Beta Tester
Post 4 made on November 17, 2025 at 16:12
L
MOD
Lyndel McGee
RC Moderator
Joined:
Posts:
RC XP:
August 2001
13,125
389⭐︎
@OP - Did you solve your issues?
Lyndel McGee
Philips Pronto Addict/Beta Tester
OP | Post 5 made on December 9, 2025 at 17:38
M
mpg7321
Long Time Member
Joined:
Posts:
RC XP:
June 2020
159
63⭐︎
Sorry, been busy with other things. I have not gotten to it yet.....

I'm close to throwing in the towel with these, now that I can program Control4 and URL, I got my hands on an old Control4 NEO remote, that's been my go-to remote for now.

Last edited by mpg7321 on December 9, 2025 17:46.

Jump to


Protected Feature Before you can reply to a message...
You must first register for a Remote Central user account - it's fast and free! Or, if you already have an account, please login now.

Please read the following: Unsolicited commercial advertisements are absolutely not permitted on this forum. Other private buy & sell messages should be posted to our Marketplace. For information on how to advertise your service or product click here. Remote Central reserves the right to remove or modify any post that is deemed inappropriate.