melissamariab
Topic Author
Posts: 11
Joined: 07 Apr 2020, 16:34

Reading data from Pictory

15 Oct 2020, 09:41

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: 1305
Joined: 15 Dec 2016, 13:19

Re: Reading data from Pictory

15 Oct 2020, 10:19

 
melissamariab
Topic Author
Posts: 11
Joined: 07 Apr 2020, 16:34

Re: Reading data from Pictory

20 Oct 2020, 10:11

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: 81
Joined: 15 Jul 2019, 12:58

Re: Reading data from Pictory

20 Oct 2020, 14:36

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 1026 times
Regards,
Amar
KUNBUS
 
melissamariab
Topic Author
Posts: 11
Joined: 07 Apr 2020, 16:34

Re: Reading data from Pictory

26 Oct 2020, 09:28

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: 1305
Joined: 15 Dec 2016, 13:19

Re: Reading data from Pictory

28 Oct 2020, 14:26

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.

Who is online

Users browsing this forum: No registered users and 3 guests