Page 1 of 1
Reading data from Pictory
Posted: 15 Oct 2020, 09:41
by melissamariab
Instead of using "piTest -r Input_1", I was wondering if there is a simple c code that can also get this value from my pictory?
Re: Reading data from Pictory
Posted: 15 Oct 2020, 10:19
by dirk
Re: Reading data from Pictory
Posted: 20 Oct 2020, 10:11
by melissamariab
Hi Dirk, thank you so much for your help as always.
In this case, I need a switch to work like this. Is there a code where I can just read the data from Pictory?
Re: Reading data from Pictory
Posted: 20 Oct 2020, 14:36
by Amar
Hi.The piCtory basically saves a RevPi device configuration as a config.rsc file which is actually a JSON file located at /var/www/pictory/projects/_config.rsc.
The name for inputs/outputs are all stored in this file.A JSON parser is needed to read this data. The kernel module piControl at startup parses this JSON file to load the configuration and variable names.
Sample tree view of config.rsc file:
- 2020-10-20 14_22_35-Window.png (36.38 KiB) Viewed 5897 times
Regards,
Amar
Re: Reading data from Pictory
Posted: 26 Oct 2020, 09:28
by melissamariab
Hello, thank you very much for the help.. I have tried some codes but I always have the same error. Does anyone know what is happening?
Error: piControlGetVariableInfo() returned 14 for variable ' '
Re: Reading data from Pictory
Posted: 28 Oct 2020, 14:26
by dirk
Hi melissamariab, The error means that the variable could not be found.
Have a look at the implementation of "piControl" in the
Git Hub repository.