Reading data from Pictory

Topics about the Software of Revolution Pi
Post Reply
melissamariab
Posts: 11
Joined: 07 Apr 2020, 16:34
Answers: 0

Reading data from Pictory

Post 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?
User avatar
dirk
KUNBUS
Posts: 1946
Joined: 15 Dec 2016, 13:19
Answers: 4

Re: Reading data from Pictory

Post by dirk »

melissamariab
Posts: 11
Joined: 07 Apr 2020, 16:34
Answers: 0

Re: Reading data from Pictory

Post 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?
Amar
KUNBUS
Posts: 158
Joined: 15 Jul 2019, 12:58
Answers: 4

Re: Reading data from Pictory

Post 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
2020-10-20 14_22_35-Window.png (36.38 KiB) Viewed 3889 times
Regards,
Amar
KUNBUS
melissamariab
Posts: 11
Joined: 07 Apr 2020, 16:34
Answers: 0

Re: Reading data from Pictory

Post 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 ' '
User avatar
dirk
KUNBUS
Posts: 1946
Joined: 15 Dec 2016, 13:19
Answers: 4

Re: Reading data from Pictory

Post 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.
Post Reply