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

Login:
Pass:
 
 

Original thread:
Post 23 made on Sunday July 11, 2010 at 18:26
Lyndel McGee
RC Moderator
Joined:
Posts:
August 2001
12,997
Your config file looks OK except that you did not put a Jump (that I could find) to either the Player Page or the Guide Page in the Built-in module. I sent you a few questions via email with regard to escient and subnet.

If you are having that kind of interference, you should try different channels and getting that weather module to work.

Put this code into a button, press the button and then review diagnostic log to see what you find.

System.setDebugMask(9);
function EscientPowerControl(ipAddress)
{
this.ipAddress = ipAddress;
this.socket = null;
}

EscientPowerControl.prototype.powerOff = function powerOff()
{
var command = '1009';
this.synchronousConnectAndSendSingleCommand(command);
};

EscientPowerControl.prototype.getEscientVersion = function getEscientVersion()
{
var command = '5007';
this.synchronousConnectAndSendSingleCommandResponse(command);
};

EscientPowerControl.prototype.writeCommand = function writeCommand(command)
{
if (this.socket && this.socket.connected)
{
try
{
var message = 'ESCX' + command + '\r';
this.socket.write(message);
}
catch (e)
{
Diagnostics.log('EscientPowerControl socket write failed. error:' + e);
}
}
};

EscientPowerControl.prototype.writeCommand = function writeCommand(command)
{
if (this.socket && this.socket.connected)
{
try
{
var message = 'ESCX' + command + '\r';
this.socket.write(message);
}
catch (e)
{
Diagnostics.log('EscientPowerControl socket write failed. error:' + e);
}
}
};

EscientPowerControl.prototype.closeSocket = function closeSocket()
{
try
{
this.socket.close();
}
catch (e)
{
Diagnostics.log('EscientPowerControl close failed. error:' + e);
}
};

EscientPowerControl.prototype.synchronousConnectAndSendSingleCommand = function synchronousConnectAndSendSingleCommand(command)
{
try
{
// create blocking socket
if (this.socket)
{
if (this.socket.connected)
this.closeSocket();
this.socket = null;
}

this.socket = new TCPSocket(true);
if (!this.socket)
{
Diagnostics.log('EscientPowerControl socket create failed.');
return;
}

// wait up to 5 seconds for connect.
this.socket.connect(this.ipAddress, 251, 5000);
// if connect is successful, we attempt to write the command.
this.writeCommand(command);
}
catch (e)
{
Diagnostics.log('EscientPowerControl failed. error:' + e);
}
finally
{
if (this.socket)
{
if (this.socket.connected)
this.closeSocket();
this.socket = null;
}
}
};

EscientPowerControl.prototype.synchronousConnectAndSendSingleCommandResponse = function synchronousConnectAndSendSingleCommandResponse(command)
{
try
{
// create blocking socket
if (this.socket)
{
if (this.socket.connected)
this.closeSocket();
this.socket = null;
}

this.socket = new TCPSocket(true);
if (!this.socket)
{
Diagnostics.log('EscientPowerControl socket create failed.');
return;
}

// wait up to 5 seconds for connect.
this.socket.connect(this.ipAddress, 251, 5000);
// if connect is successful, we attempt to write the command.
this.writeCommand(command);
// read a response up to 8KB and wait for 5 seconds.
System.print('Beginning read.');
var response = this.socket.read(8192,5000);
var wResponse = GUI.widget('RESPONSE');
if (wResponse)
wResponse.label = response;

Diagnostics.log('RX:'+response);
}
catch (e)
{
Diagnostics.log('EscientPowerControl failed. error:' + e);
}
finally
{
if (this.socket)
{
if (this.socket.connected)
this.closeSocket();
this.socket = null;
}
}
};

System.print('Starting...');
var ipAddress = '192.168.1.116';
var pc = new EscientPowerControl(ipAddress);
pc.getEscientVersion();


After running this, use Backlight-Menu-Firm2 to ascertain which of the above messages is in the diagnostic log.

If you cannot get this far, you should try different router/different channel or figure out what is up with your network.
Lyndel McGee
Philips Pronto Addict/Beta Tester


Hosting Services by ipHouse