Page 1 of 1

PiCtory configuration not loading

Posted: 23 May 2018, 20:54
by bftrock
This post is to document a problem I ran into as well as the solution I found. I'm running a setup with these devices:

Code: Select all

(wepi) pi@RevPi6892:~ $ piTest -d
Found 3 devices:

Address: 0 module type: 95 (0x5f) RevPi Core V1.2
Module is present
     input offset: 0 length: 6
    output offset: 6 length: 5

Address: 32 module type: 103 (0x67) RevPi AIO V1.2
Module is present
     input offset: 11 length: 20
    output offset: 31 length: 4

Address: 33 module type: 96 (0x60) RevPi DIO V1.3
Module is present
     input offset: 100 length: 70
    output offset: 170 length: 18
First, I found that the web GUI did not work well with Chrome running on Windows7. The Config and Services tabs were not displaying correctly (some rows were missing, and the wrong CPU speed was displayed). Switching to Firefox seemed to fix that problem. I found the online tutorial to be out of date with the version I'm seeing, which led to a little confusion, then trial-and-error. While using PiCtory, I was able to create a configuration and save it, but I could not make the configuration active even after hitting Tools > Reset Driver. Executing `piTest -d` showed that the modules were NOT CONFIGURED! Also, clicking File > Save as Start.Config did not get my project to load on reboot. When I returned to PiCtory after rebooting, I saw the default configuration (1 module, RevPi Core).

I found a solution by copying my project file from /var/www/pictory/projects to my development machine, renamed the file as _config.rsc, then copied it back. After a reboot, the RevPi started up with my configuration. I could see this in PiCtory as well as with `piTest -d`.

Hope this helps somebody.

Re: PiCtory configuration not loading

Posted: 24 May 2018, 09:01
by Mathias
Hi,
could you do the following things to find out what happens:
1. please clear the cache of your browser. open pictory, add a module, press 'File/Save as Start-Config.', press 'File/Exit', open pictroy again. Is the new module there?
2. which version of pictory do you use?
3. if you use firefox press F12 to open the debugger, select the tab 'Console' and open pictory and press 'Save as Start-Config.' Are there any lines in the console output without an OK an the end of the line? Please send the errors if there are any.
kind regards
Mathias

Re: PiCtory configuration not loading

Posted: 08 Jun 2018, 10:56
by domotica
I had the same issue.

permissions were wrong.

sudo chown www-data:www-data /var/www/pictory/projects/_config.rsc
should fix it if I recall correctly.

Bryan

Re: PiCtory configuration not loading

Posted: 16 Jun 2018, 06:24
by volz
my revpi was new out the box so i tryed to set up some IO but encounter a issue with piTory not saving the configuration even after pressing save. When i returned to piTory all my setting had gone.
when i run "piTest -d" i could see that the IO modules as recognised but not configured.

After running following domotica solution it worked just fine

thanks again

Re: PiCtory configuration not loading

Posted: 16 Jun 2018, 10:10
by volker
Thanks for adding your experience. I fear other users will only have profit of this if you could specify a little more precise what exactly happened happened on your device when saying "I've had the same...". Are you referring to what the author of the thread describes? I do not think so. I guess you are referring to the title of the thread, i.e. your PiCtory configuration was not loading, right?
The way you got it loading again does show that the cause of the problem was a very specific one:
When you handle the file _config.rsc without using PiCtory you get a chance to do this work from command line being logged in as root or any other user. This means you might write an _config.rsc into the destination directory with other rights and other ownership than it should have (i.e. www-data) to be used by the web server.
This can never happen when you use PiCtory (via browser) to save the configuration under different names and re-load it again to save it under "Start-Config." used by the run time (i.e. as "_config.rsc". So I guess you have somehow written this file manually to its destination, right?
If we could clarify this it might help other users to differentiate their problem in the right way. Thanks!

Re: PiCtory configuration not loading

Posted: 21 Jun 2018, 11:36
by domotica
Hi Volker,

I'm sorry for my short reply. Not mucht of a writer.
It is not loading what is the problem but saving.

I can confirm that an out of the box (just tried it again) revPi can not change the /var/www/pictory/projects/_config.rsc file due to permission rights when using piCtory
The file /var/www/pictory/projects/_config.rsc has as owner/group pi:pi

When modifing in pictory (simple adding a DIO modules and saving) you get following error in /var/log/apache/error.log
"""
PHP Warning: unlink(../export/): Is a directory in /var/www/pictory/php/deleteFile.php on line 4, referer: http://192.168.100.66/pictory/index.html?hn=HH87GSMY3D
[Thu Jun 21 11:26:25.549155 2018] [:error] [pid 1311] [client 192.168.100.102:49790] PHP Warning: file_put_contents(_config.rsc): failed to open stream: Permission denied in /var/www/pictory/php/saveProject.php on line 7, referer: http://192.168.100.66/pictory/index.html?hn=HH87GSMY3D
[Thu Jun 21 11:26:25.616892 2018] [:error] [pid 1311] [client 192.168.100.102:49790] PHP Warning: unlink(../export/): Is a directory in /var/www/pictory/php/deleteFile.php on line 4, referer: http://192.168.100.66/pictory/index.html?hn=HH87GSMY3D
"""

Hope this clarifies some things.

Kind regards

Bryan