New version of the emoncms apps module

Hi Glyn
I hit update again and downloaded the log as below…
emonpiupdate.log.txt (39.5 KB)

Regards
Dave

Thanks. Mmm the issue is still persisting.

/home/pi/emonpi folder is not updating. I think this is due to a local change made to /home/pi/emonpi/rc.local_jessieminimal

Could you try and see what the change to this file could be by connecting via ssh and running a git diff:

cd /home/pi/emonpi
git diff rc.local_jessieminimal

There also seems to be a file called ##settings.php in /var/www/emoncms and a folder called images that I’m unfamiliar with.

Thanks Glyn
The output from the git diff is…

pi@emonpi(rw):~$ cd /home/pi/emonpi
pi@emonpi(rw):emonpi$ git diff rc.local_jessieminimal
diff --git a/rc.local_jessieminimal b/rc.local_jessieminimal
index b6b2891..07f5bda 100755
--- a/rc.local_jessieminimal
+++ b/rc.local_jessieminimal
@@ -18,6 +18,13 @@ then
   chown -R pi:pi /var/log/logrotate
   chown -R mosquitto:mosquitto /var/log/mosquitto

+if [ ! -d /var/log/supervisor ]; then
+        mkdir /var/log/supervisor;
+        touch /var/log/supervisor/supervisord.log
+        chown -R dataplicity:dataplicity /var/log/supervisor;
+        service supervisor restart
+fi
+
   # Restart services,they should run happy now log dir's are created
   service apache2 restart
   service redis-server restart
pi@emonpi(rw):emonpi$

The ##settings.php was the original settings.php that was causing problems and the images folder is for images that I load in the dashboards.

Regards
Dave

Ah, I see the issue there is an entry in rc.local from dataplicity. I’m assuming you installed dataplicity on the emonPi? I’ve not used it, however I’ve just had a look and it looks like a nice solution for easy remote Pi access: https://www.dataplicity.com/

How have you been finding it?

In order to get the emonpi folder to update while keeping the dataplicity changes to rc.local we need to stash your changes, pull in the new changes then restore your changes. Try running:

rpi-rw
cd /home/pi/emonpi
git stash
git pull
git stash pop

In order to run git stash you may need to give git your name and email. I don’t plan to push anything to github to come you can just make these up.

See the “Dataplicity VPN” thread, @barfle did say he would look at a fix for this back in January.

I saw no mention of any specific commit relating to this when I briefly looked through the repo just now though.

If I get a mo, I will try a fresh install to see if the issue still exists as the installer seems to be downloaded from the main site rather than being in the client repo so a fix might not be obvious without trying it.

Apologies for the delay. We have a new version of the agent due out in the next two weeks. I have asked that this be looked at in time for that release. Some of our own devices are also impacted by this issue.

2 Likes

Thanks Glyn

Please see below output from SSH session

pi@emonpi(rw):emonpi$ git config --global user.email [email protected]
pi@emonpi(rw):emonpi$ git config --global user.name Dave
pi@emonpi(rw):emonpi$ git stash
Saved working directory and index state WIP on master: 91d2e6f use '==' instead                                                                                                  of '='
HEAD is now at 91d2e6f use '==' instead of '='
pi@emonpi(rw):emonpi$ git pull
Updating 91d2e6f..fad6524
Fast-forward
 .gitignore               |  3 ++-
 emoncms-filesystem       |  1 +
 emoncmsupdate            | 53 ++++++++++++++++++++++++++++++++++++++++++++++++
 emonpiupdate             | 21 ++++++++++++++++++-
 factoryreset             |  2 +-
 firmware/readme.md       | 11 ++++++++++
 firmware/src/src.ino     |  6 +++---
 firstbootupdate          |  2 +-
 md5sum.py                | 24 ++++++++++++++++++++++
 ntp_update.sh            | 11 ++++++++++
 rc.local_jessieminimal   |  7 +++++--
 service-runner           |  9 +++++---
 service-runner-update.sh |  2 +-
 sudo_crontab             |  5 +++++
 14 files changed, 144 insertions(+), 13 deletions(-)
 create mode 100644 emoncms-filesystem
 create mode 100755 md5sum.py
 create mode 100755 ntp_update.sh
pi@emonpi(rw):emonpi$ git stash pop
Auto-merging rc.local_jessieminimal
On branch master
Your branch is up-to-date with 'origin/master'.
Changes not staged for commit:
  (use "git add <file>..." to update what will be committed)
  (use "git checkout -- <file>..." to discard changes in working directory)

        modified:   rc.local_jessieminimal

Untracked files:
  (use "git add <file>..." to include in what will be committed)

        1
        Atmega328/emonPi_RFM69CW_RF12Demo_DiscreteSampling/compiled/emonPi_Firmw                                                                                                 are.hex
        hardware/emonpi/emonpi2c/

no changes added to commit (use "git add" and/or "git commit -a")
Dropped refs/stash@{0} (581402d08aa6e5822dc1df9afbc239139549dc13)
pi@emonpi(rw):emonpi$

Thanks for your help all and kind regards
Dave

I’ve just added the bash commands you need to setup dataplicity log files to the standard emonPi rc.local so dataplicity will work out of the box for all emonPi users. You can now stash your changes and pull in the latest change and you will be good to go for automatic updates in the future:

rpi-rw
cd /home/pi/emonpi
git stash
git pull
rpi-ro

Then reboot to test dataplicity comes back online ok.

See my post on the dataplicity thread for more info:

1 Like

That sounds great, thank you. Is there a forum for discussing Dataplicity?

I’d like to test the new apps, but can’t find them… Have they moved to another location?

Edit: Ok got it, It’s merged to master :slight_smile:

Hi, I’m pretty much a novice with respect to EmonCMS but am getting the hang of things.
I recently updated the apps (git pull) and noticed a change from the previous My Solar Divert. Previously the divert was displayed as ‘cumulative’ with the house use. Like in this picture.

You can see the orange ‘divert’ is stacked on top of the light blue house use.

But now the divert starts on the x-axis. The reason I like it stacked is that it was easy to see if the there was a problem with the diversion. The cumulative house use and divert should not exceed the solar generation. I.e. the orange stacked on the light blue should not be more than the yellow. But now with the divert not being stacked on the house use it is difficult to visualize the total use.

Sorry…as a new user I am only allowed to post 1 picture. I hope this makes sense?
Marty

You should be able to post more.

These may help explain the point:

My Solar Divert

My Solar PV

These are “My Solar Divert” vs “My Solar PV”. You can see in the top image that the ‘divert’ (orange) is not added to the ‘use’ (light blue). In the lower image the ‘use’, that includes the divert as it is not divert aware, approximates the solar generation.

With the previous version of the app the ‘divert’ sat on top of the ‘use’, and looked more like the lower image but made up of light blue and orange. You can imagine adding the orange to the light blue in the top image. Any orange that was greater than the yellow means that too much power is being diverted and is therefore using electricity from the grid. So ‘house use’ plus ‘divert’ should not be more than solar generation if the diversion is working correctly. Of course the house use may exceed solar generation, in which case there should be no divert at all.

I’ve edited the image using photoshop to approximate what it looked like before the apps were updated:

Does this make sense?

Marty

When did you install the new apps module or last update?

There was a recent change regarding this or a very similar issue, 2 days ago.

Brilliant. Thanks Paul.
I updated about 5 days ago and noted the issue. But the latest update (git pull) fixed the problem.
Thanks for that.
Marty

A few more app module improvements:

  • Cost mode is implemented in the new my electric 2 and time of use apps
  • Improvements to responsive design, especially in the time of use app around the totals box
  • Ability to set the My Electric 2 app title and hide the comparison box
  • Option to access app via emoncms/app/view/appname in addition to emoncms/app/view?name=appname thanks to @pb66

We recently installed a monitoring system for our local community hydro in Llanberis, North Wales. As a good demo of the new MyElectric2 app with the app title set to the hydro name and the energy comparison box hidden, here’s the live turbine output:

https://emoncms.org/app/view/AfonGoch&readkey=1536a560ccd4edb343d43c46f63a7b15

10 posts were split to a new topic: Emoncms Apps: Missing menu controls on update

2 posts were split to a new topic: Emoncms Apps: Call to a member function fetch_object() on a non-object?