Errors after update from pi to pi2

Ho there,

I have some errors on my emonpi. I has raspberry pi (1) with low write version of emonpi (SD + USB pendrive). I've updated in order to change to raspi2, and it worked well. Now, I have a lot of error messages from PHP related to the read-only file system. I attach the log file, but it is very long. This is an example:

[Tue Dec 29 13:30:29 2015] [error] [client 127.0.0.1] PHP Warning:  fopen(/var/lib/p   hpfina/26.dat): failed to open stream: Read-only file system in /var/www/emoncms/Mod   ules/feed/engine/PHPFina.php on line 118
[Tue Dec 29 13:30:29 2015] [error] [client 127.0.0.1] PHP Warning:  fopen(/var/lib/p   hptimeseries/feed_38.MYD): failed to open stream: Read-only file system in /var/www/   emoncms/Modules/feed/engine/PHPTimeSeries.php on line 123

Can anyone help me??

Thanks a lot!

Paul Reed's picture

Re: Errors after update from pi to pi2

How have you built your system, from an image file, or is it git installed?
I would have thought that the data folders would have been in the writable data partition.

Paul

hercules71035's picture

Re: Errors after update from pi to pi2

Hi Paul,

I've used the pre-built image (the low write version, where there is the tempfs), then I've updated it in order to use the same image and the same USB pendrive on the pi2.

glyn.hudson's picture

Re: Errors after update from pi to pi2

What version of the pre-built image are you using? There should be a file in /boot with emonSD-XXX and the date of your image build.  The 17th June 2015 image should work fine a a RasPi2. If you are using an older image then you will need to run the following steps to enable support for Raspi2:

rpi-rw
apt-get update && upgrade
apt-get dist-upgrade
rpi-update​
rpi-ro

If you need more storage space on your SD card then you can remove unused packages:

sudo apt-get purge -y wolfram-engine minecraft-pi sonic-pi scratch
sudo apt-get autoremove -y
sudo apt-get clean

hercules71035's picture

Re: Errors after update from pi to pi2

Hi,

the pre-built image was older than June 2015. However, I run your commands in order to update/upgrade the system. There is other things that I can try?

EDIT: now it does not work anymore, there is some problem in emonhub because data are correctly received. How can i resolve this problem??
There is this error: ERROR: file not found : '/var/www/emoncms/run/feedwriter.php'

pb66's picture

Re: Errors after update from pi to pi2

Where are you seeing this error? emonhub doesn't look for the feedwriter directly so the problem is unlikely to be emonhub.

Have you updated emoncms using git?

/var/www/emoncms/run/feedwriter.php is the old location, it has since been moved to emoncms/scripts/feedwriter.php.

Perhaps the emoncms folder has been updated but the feedwriter init script at /etc/init.d/feedwriter did not get updated, this can happen if the file was originally copied or moved into place, it can be better to use symlinks.

If /etc/init.d/feedwriter has a line in it pointing to /var/www/emoncms/run/feedwriter.php and the file is actually confirmed to be at /var/www/emoncms/scripts/feedwriter.php you can either just edit it there or replace it with a symlink.

sudo service feedwriter stop

sudo rm /etc/init.d/feedwriter

sudo ln -s /var/www/emoncms/scripts/feedwriter /etc/init.d/feedwriter 

sudo service feedwriter start

Paul

hercules71035's picture

Re: Errors after update from pi to pi2

The emoncms version is the 8.4. The command sudo service feedwriter start returns feedwriter: unrecognized service. How can I resolve that? I've lost three days of data :( .

EDIT: after a reboot, I typed  tail -f /var/log/emonhub/emonhub.log and the result is the following:
2015-12-30 17:59:10,433 WARNING Send failure: wanted 'ok' but got <br />
<b>Warning</b>:  fopen(/var/lib/phpfiwa/17_0.dat): failed to open stream: Read-only file system in <b>/var/www/emoncms/Modules/feed/engine/PHPFiwa.php</b> on line <b>154</b><br />
<br />
<b>Warning</b>:  fopen(emoncms.log): failed to open stream: Read-only file system in <b>/usr/share/php/log4php/appenders/LoggerAppenderFile.php</b> on line <b>99</b><br />
<br />
<b>Warning</b>:  log4php: [LoggerAppenderFile:myAppender]: Failed opening target file. Closing appender. in <b>/usr/share/php/log4php/LoggerAppender.php</b> on line <b>283</b><br />
<br />
<b>Warning</b>:  fopen(/var/lib/phpfina/26.dat): failed to open stream: Read-only file system in <b>/var/www/emoncms/Modules/feed/engine/PHPFina.php</b> on line <b>118</b><br />
<br />
<b>Warning</b>:  fopen(/var/lib/

If I enable the writable file system (sudo rpi-rw) and then I restart the emonhub service, it works correctly.

 

 

Paul Reed's picture

Re: Errors after update from pi to pi2

Was there a particular reason why you didn't use the current version image file.

Paul

hercules71035's picture

Re: Errors after update from pi to pi2

Because I won't lose my old data (about one year) :) . There is a way to don't lose data using a new image?
Thanks!

Paul Reed's picture

Re: Errors after update from pi to pi2

What format do your existing feeds use? (phpfina etc)

Paul

hercules71035's picture

Re: Errors after update from pi to pi2

Someone is PHPFIWA, one is PHPFINA and other are PHPTIMESERIES.

Paul Reed's picture

Re: Errors after update from pi to pi2

Those feed types are the same as what is used in the latest version.

Presumably, you've backed up your data folders and MYSQL database already, and which should restore OK into the current version.

I can't see much point in setting up your new Pi with the old emoncms version, it's not fully supported, and certainly not being developed further. Also many of the 8.4 bugs have been sorted in v9, and new & interesting features continue to be added.

Paul

hercules71035's picture

Re: Errors after update from pi to pi2

Thanks Paul,

How can I use the latest version of Emonpi and keep data, settings and dashboards? Which files/folder do I copy and paste?

Thanks a lot for the support!!

Paul Reed's picture

Re: Errors after update from pi to pi2

Your settings, dashboards, passwords etc are all stored in mysql, which can be imported into the new version. For details of how/what to backup/restore see this post.

You will have a bit of tidying up to do once you've updated, such as reselecting your feeds again in any visualizations, but nothing too major.
I would keep a backup of the backup just in case though.

Paul

Comment viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.