Daily Production Total not saving

Talks about solar stuff
Post Reply
jatz76
Posts: 24
Joined: Tue Feb 24, 2015 3:50 am

Daily Production Total not saving

Post by jatz76 » Fri May 15, 2015 12:40 am

Hi all,
I have noticed that my Production Over Last 20 Days is not showing on the Index page. I have checked the energy2015.csv and it is not getting populated. Why would this be?
This was happening on the previous version to the current one. I have upgraded to the latest 123solar (I renamed the old folder first) so it is a clean install and just copied the data files across.
- I'm wondering if the file is corrupt (it does have a few entries then stops.
- Has the format changed?

Thanks for your help,

Jacek

jatz76
Posts: 24
Joined: Tue Feb 24, 2015 3:50 am

Re: Daily Production Total not saving

Post by jatz76 » Fri May 15, 2015 12:52 am

I just saw the same issue addressed in another thread suggesting to change the permissions. I will try that.

The thing I don't get is that the daily CSV files and the Production CSV files have the same permissions:
" -rw-r--r-- " so why are they getting written to and not the other file?

Cheers,
Jacek

jeanmarc
Posts: 2022
Joined: Thu Aug 29, 2013 7:16 am

Re: Daily Production Total not saving

Post by jeanmarc » Fri May 15, 2015 7:36 am

Hi,
:idea: CSV should be writable by your www user, you may chown or chmod 666.

jatz76
Posts: 24
Joined: Tue Feb 24, 2015 3:50 am

Re: Daily Production Total not saving

Post by jatz76 » Mon May 18, 2015 12:44 pm

jeanmarc wrote:Hi,
:idea: CSV should be writable by your www user, you may chown or chmod 666.
Hi Jean. I'm still having issues with permissions. I'm not too familiar with Linux so its a bit hard going :?
When you say 'writable by your www user' who is the www user? I have worked out how to change to 'root' user or my default user of 'pi' but not sure what 'www' user is.

Currently all my folders and files within the following folder structure "var/www/123solar/data/invt1/production/" are set to owner=pi group=pi
The production folder has the permissions: drwxrwxrwx
The energy2015.csv file has the permissions: -rw-rw-rw- and owner=pi group=pi

Any ideas?

jeanmarc
Posts: 2022
Joined: Thu Aug 29, 2013 7:16 am

Re: Daily Production Total not saving

Post by jeanmarc » Mon May 18, 2015 12:50 pm

Hi,
Your www user depend on your webserver and OS. The -rw-rw-rw- permission mean that it's writable by everyone, it should do the trick. If not, the problem is elsewhere..

jatz76
Posts: 24
Joined: Tue Feb 24, 2015 3:50 am

Re: Daily Production Total not saving

Post by jatz76 » Mon May 18, 2015 10:08 pm

OK, I think I got it now. I deleted the energy2015.csv and let it create a new one overnight. It gave the file owner and group of www-data:www-data and saved a value to the file, hence its just a permissions issue.

Now my question is, what should all of the /123solar folder (and subdirectories and files) have as owner:group?
Currently its pi:pi . Should it be owner=pi and group=www-data? What do other people have?

I installed from fresh (after a corrupt SD card :( ) using this guide (Guida RPi datalogger http://walter62.altervista.org/joomla/r ... datalogger) and it has all ways worked. I don't understand why now I have these www-data permission issues. If anyone reading this can help explain it would be appreciated (out of curiosity).

jeanmarc
Posts: 2022
Joined: Thu Aug 29, 2013 7:16 am

Re: Daily Production Total not saving

Post by jeanmarc » Tue May 19, 2015 6:54 am

If you extract 123s correctly, you should not have permission issue (As stated in readme extract with tar -xzvf 123solar*.tar.gz)
You may chown -R www-data:www-data pathto/123solar/

TonyP62
Posts: 97
Joined: Fri May 01, 2015 11:07 pm

Re: Daily Production Total not saving

Post by TonyP62 » Thu May 21, 2015 12:26 am

I have a similar problem.
The energy2015.csv file was not created by the system and i don't understand why.
all permission and owners are rights.
Some days ago i create manually an energy2015.csv and i write into this file some values but i see that 123solar don't write into this file and i must write the current day value manually.
There is a way to force 123solar to create the energy2015.csv file ?

TonyP62
Posts: 97
Joined: Fri May 01, 2015 11:07 pm

Re: Daily Production Total not saving

Post by TonyP62 » Thu May 21, 2015 6:37 am

Today,when i wake up, i see the new file energy2015.csv created by the system.
Perhaps it was created at the sunrise when 123solar awake.
I'm very happy for this, but now i have fear to edit it with nano because i don't want create problems on this file.

jatz76
Posts: 24
Joined: Tue Feb 24, 2015 3:50 am

Re: Daily Production Total not saving

Post by jatz76 » Sun May 31, 2015 9:46 pm

Tony, the following is what I did to fix my issues. For some reason my permissions were totally stuffed. This has been working for a week.

Set Permissions

> Add the www-data group
sudo groupadd www-data

> Add the pi user to the www-data group
sudo gpasswd -a pi www-data (Or: sudo usermod -a -G www-data pi )

> Change the directory owner and group
sudo chown -R www-data:www-data /var/www

> Allow the group to write to the directory
sudo chmod 775 /var/www

> Allow any new files that are created in that directory retain the same owner and group permissions (www-data) so that you as the pi user can still edit them:
sudo chmod g+s /var/www

> Give group all permissions on all files.
sudo find /var/www -type d -exec chmod g+rwxs {} \;

> Give group all permissions and set the sticky bit on directories.
sudo find /var/www -type f -exec chmod g+rwx {} \;

Post Reply

Who is online

Users browsing this forum: No registered users and 5 guests