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:
Pronto script to save on local txt files
This thread has 8 replies. Displaying all posts.
Post 1 made on Saturday April 4, 2020 at 07:20
Fbrighi
Long Time Member
Joined:
Posts:
September 2010
52
Hello,

I went in the needing to save a string generated through a pronto script into a txt file on my local network. At present time, the pronto script is running on my Windows 10 PC, using the "modified" simulator mode which permits to operate all extenders and network commands by the PC rather than the Remote Control.

I found that javascript language permits to save strings on local txt files, see here : [Link: c-point.com]

but in present pronto edit pro software there is no library supporting commands like fopen and getScriptPath. My question is, how to (if possible) add libraries which supports these two commands? And, of course, where to find these libraries?

Can anybody help me on this please?

Thanks!
FKB
FKB
Post 2 made on Sunday April 5, 2020 at 23:42
Lyndel McGee
RC Moderator
Joined:
Posts:
August 2001
12,996
I don't think is possible.
Lyndel McGee
Philips Pronto Addict/Beta Tester
OP | Post 3 made on Monday April 6, 2020 at 05:53
Fbrighi
Long Time Member
Joined:
Posts:
September 2010
52
Thanks for reply. I have to say i was expecting it's not possible but ... then i have a second option. Hopefully.

Is it existing any software (like server apache for example), that can stay active on PC win 10, waiting for string coming from given IP + port number, and able to save it on file? In this way, using pronto script would be easy to send on the network the needed string and then having it saved.

Thanks!

FKB
FKB
Post 4 made on Tuesday April 7, 2020 at 22:10
Lyndel McGee
RC Moderator
Joined:
Posts:
August 2001
12,996
Yes, you could do something like this very easily with say nodejs and a pc.

Don't need apache.

[Link: w3schools.com]

Send string as an encoded GET request parameter or POST content as body. Just need to know how to build the HTTP POST request from the Pronto.

Within the last 8 months, I've started using Raspberry Pi Zero W's throughout my house to do small things like this.
Lyndel McGee
Philips Pronto Addict/Beta Tester
OP | Post 5 made on Wednesday April 8, 2020 at 08:55
Fbrighi
Long Time Member
Joined:
Posts:
September 2010
52
Thanks! That's a decisive point for me :).

GET request would be easy, like something similar : Connessione.socket.write("GET /ZidooVideoPlay/getPlayStatus HTTP/1.0\r\n\r\n");

including the string instead of Zidoo's command. But then this nodejs: how it is working? Do i need to download it, make a program and then compile to be executable on the pc?
FKB
Post 6 made on Thursday April 9, 2020 at 20:06
Lyndel McGee
RC Moderator
Joined:
Posts:
August 2001
12,996
Yes, must download and compile a program.

The link I posted above should be enough to get you started.

NodeJS is nothing more than a Javascript Engine with WAY MORE capabilities than the standard language.
Lyndel McGee
Philips Pronto Addict/Beta Tester
Post 7 made on Friday April 10, 2020 at 18:53
Lyndel McGee
RC Moderator
Joined:
Posts:
August 2001
12,996
See this:

[Link: nodejs.org]

And then see this:

[Link: w3schools.com]


You can run the nodejs program on your PC which could parse request parameters and then write a file accordingly. The issue you may have is syncing between 2 processes as you will have 1 process reading a file and another writing a file. Not sure if you'd want to do something to "append" commands and then have a processor delete commands from the file that have been received and executed.
Lyndel McGee
Philips Pronto Addict/Beta Tester
OP | Post 8 made on Wednesday April 15, 2020 at 15:01
Fbrighi
Long Time Member
Joined:
Posts:
September 2010
52
Thanks! I made it very easily. Program is able to listen on a port, the pronto script send a string on that port and program saves it. Directly on network folder I needed. No syncing problem. I solved an issue I was struggling since years. Thank you very much 👍🏻👍🏻👍🏻👍🏻
FKB
Post 9 made on Wednesday April 15, 2020 at 18:00
Lyndel McGee
RC Moderator
Joined:
Posts:
August 2001
12,996
Glad to hear it.

The reason I recommended NodeJS beside the enormous problems it solves is the fact that it is JavaScript (much like ProntoScript which is JavaScript with Pronto Object Extensions) and has a built-in 'require' with tons of stuff out there to solve many problems with simply npm install modulename.
Lyndel McGee
Philips Pronto Addict/Beta Tester


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.

Hosting Services by ipHouse