Apps not working unless logged in

Hi,

My EmonPi updated this morning after a powercut, and since then I have only been able to see the My Solar Battery app if I am logged into Emoncms.
If I try and use the link I was using yesterday, I get taken to the config screen, but there are no options in the Select Feed dropdowns (except for AUTO SELECT and DISABLE).

Has something changed, or do I need to do something different to make these ‘public’?

Thanks

Tim

Try “cd /var/www/emoncms && git pull”

Hi,

That comes back with “Already up to date.”

Strangely, the graphs don’t seem to be updating properly either, not 100% but it is almost like they are moving the date scale so it goes back in time, rather than forward…
Weird.

Tim

Hello @Tim_Meadows on the Admin > Components page are all of the components on the stable branch?

Hi @TrystanLea,

I have just checked, and they are all on the Master Branch. Should I update this to Stable?

Cheers

Tim

good to know, Im not sure what’s causing this and what change on the master branch may be responsible. Could you try doing another full update but keeping the system on the master branch? I wonder if the issue was caused by a partial update…

I did try another update this morning - just in case, but it doesn’t seem to have changed anything…

Starting update via service-runner-update.sh (v3.0) >
Filesystem      Size  Used Avail Use% Mounted on
/dev/root       4.1G  2.5G  1.5G  64% /
devtmpfs        430M     0  430M   0% /dev
tmpfs           463M     0  463M   0% /dev/shm
tmpfs           463M   47M  416M  11% /run
tmpfs           5.0M  4.0K  5.0M   1% /run/lock
tmpfs           463M     0  463M   0% /sys/fs/cgroup
tmpfs           1.0M  8.0K 1016K   1% /var/lib/php/sessions
tmpfs            30M     0   30M   0% /tmp
tmpfs           1.0M     0  1.0M   0% /var/tmp
/dev/mmcblk0p1  253M   48M  205M  19% /boot
/dev/mmcblk0p3  9.9G  1.4G  8.1G  15% /var/opt/emoncms
log2ram          50M  7.7M   43M  16% /var/log
- emonSD version: emonSD-08May21
- supported images: emonSD-21Jul21 emonSD-08May21 emonSD-24Jul20 emonSD-02Oct19 emonSD-17Oct19
- emonSD base image check passed...continue update
git pull /opt/openenergymonitor/EmonScripts
* master
  stable
On branch master
Your branch is up to date with 'origin/master'.

nothing to commit, working tree clean
Already up to date.
-------------------------------------------------------------
Main Update Script
-------------------------------------------------------------
Date: Wed 8 Dec 07:32:59 GMT 2021
EUID: 1000
openenergymonitor_dir: /opt/openenergymonitor
type: all
serial_port: ttyAMA0
firmware: none
Reading package lists...
Building dependency tree...
Reading state information...
python3-pip is already the newest version (18.1-5+rpt1).
0 upgraded, 0 newly installed, 0 to remove and 109 not upgraded.
Looking in indexes: https://pypi.org/simple, https://www.piwheels.org/simple
Requirement already satisfied: redis in /usr/local/lib/python3.7/dist-packages (3.5.3)
Hardware detected: EmonPi
Stopping emonPiLCD service
Display update message on LCD
Running apt-get update
Get:1 http://raspbian.raspberrypi.org/raspbian buster InRelease [15.0 kB]
Get:2 http://archive.raspberrypi.org/debian buster InRelease [32.6 kB]
Hit:3 https://deb.nodesource.com/node_14.x buster InRelease
Get:4 http://archive.raspberrypi.org/debian buster/main armhf Packages [393 kB]
Fetched 441 kB in 3s (170 kB/s)
Reading package lists...
git pull /opt/openenergymonitor/emonpi
* master
On branch master
Your branch is up to date with 'origin/master'.

nothing to commit, working tree clean
Fetching origin
Already up to date.
git pull /opt/openenergymonitor/RFM2Pi
* master
On branch master
Your branch is up to date with 'origin/master'.

nothing to commit, working tree clean
Fetching origin
Already up to date.
Start emonhub update script:
-------------------------------------------------------------
emonHub update
-------------------------------------------------------------
Updating /opt/openenergymonitor/emonhub
- current branch: master
- local changes: no
- git fetch: Fetching origin
Already on 'master'
- git checkout: Your branch is up to date with 'origin/master'.
- git pull: Already up to date.
- database update: no changes
- running module install/update script
Reading package lists...
Building dependency tree...
Reading state information...
python3-configobj is already the newest version (5.0.6-3).
python3-pymodbus is already the newest version (2.1.0+dfsg-1).
python3-serial is already the newest version (3.4-4).
bluetooth is already the newest version (5.50-1.2~deb10u2+rpt1).
libbluetooth-dev is already the newest version (5.50-1.2~deb10u2+rpt1).
python3-pip is already the newest version (18.1-5+rpt1).
0 upgraded, 0 newly installed, 0 to remove and 109 not upgraded.
Looking in indexes: https://pypi.org/simple, https://www.piwheels.org/simple
Requirement already satisfied: paho-mqtt in /usr/local/lib/python3.7/dist-packages (1.5.1)
Requirement already satisfied: requests in /usr/lib/python3/dist-packages (2.21.0)
Requirement already satisfied: pybluez in /usr/local/lib/python3.7/dist-packages (0.23)
Requirement already satisfied: py-sds011 in /usr/local/lib/python3.7/dist-packages (0.9)
Requirement already satisfied: sdm_modbus in /usr/local/lib/python3.7/dist-packages (0.4.5)
Requirement already satisfied: minimalmodbus in /usr/local/lib/python3.7/dist-packages (1.0.2)
Requirement already satisfied: pyserial in /usr/lib/python3/dist-packages (from py-sds011) (3.4)
Requirement already satisfied: pymodbus>=2.3.0 in /usr/local/lib/python3.7/dist-packages (from sdm_modbus) (2.5.1)
Requirement already satisfied: six>=1.15.0 in /usr/local/lib/python3.7/dist-packages (from pymodbus>=2.3.0->sdm_modbus) (1.16.0)
Looking in indexes: https://pypi.org/simple, https://www.piwheels.org/simple
Requirement already satisfied: RPi.GPIO in /home/pi/.local/lib/python3.7/site-packages (0.7.0)
The user `emonhub' is already a member of `gpio'.
Unit /etc/systemd/system/[email protected] is masked, ignoring.
useradd: user 'emonhub' already exists
- installing emonhub.service
- Service ActiveState=active
- component updated

Start emoncms update:
-------------------------------------------------------------
Update Emoncms Core
-------------------------------------------------------------
Updating /var/www/emoncms
- current branch: master
- local changes: no
- git fetch: Fetching origin
Already on 'master'
- git checkout: Your branch is up to date with 'origin/master'.
- git pull: Already up to date.
- database update: no changes
- component updated
-------------------------------------------------------------
Update Emoncms Services
-------------------------------------------------------------
emoncms_mqtt.service already installed
feedwriter.service already installed
service-runner.service already installed

Reloading systemctl deamon
Restarting Services...
- sudo systemctl restart feedwriter.service
--- ActiveState=active ---
- sudo systemctl restart emoncms_mqtt.service
--- ActiveState=active ---
- sudo systemctl restart emonhub.service
--- ActiveState=active ---
/opt/openenergymonitor/EmonScripts/sudoers.d/emoncms-rebootbutton: parsed OK
emonPi emoncms admin reboot button sudoers updated

-------------------------------------------------------------
Update Emoncms Modules
-------------------------------------------------------------
Updating /var/www/emoncms/Modules/app
- current branch: master
- local changes: no
- git fetch: Fetching origin
Already on 'master'
- git checkout: Your branch is up to date with 'origin/master'.
- git pull: Already up to date.
- database update: no changes
- component updated
Updating /var/www/emoncms/Modules/config
- current branch: master
- local changes: no
- git fetch: Fetching origin
Already on 'master'
- git checkout: Your branch is up to date with 'origin/master'.
- git pull: Already up to date.
- database update: no changes
- component updated
Updating /var/www/emoncms/Modules/dashboard
- current branch: master
- local changes: no
- git fetch: Fetching origin
Already on 'master'
- git checkout: Your branch is up to date with 'origin/master'.
- git pull: Already up to date.
- database update: no changes
- component updated
Updating /var/www/emoncms/Modules/device
- current branch: master
- local changes: no
- git fetch: Fetching origin
Already on 'master'
- git checkout: Your branch is up to date with 'origin/master'.
- git pull: Already up to date.
- database update: no changes
- component updated
Updating /var/www/emoncms/Modules/graph
- current branch: master
- local changes: no
- git fetch: Fetching origin
Already on 'master'
- git checkout: Your branch is up to date with 'origin/master'.
- git pull: Already up to date.
- database update: no changes
- component updated
Updating /var/www/emoncms/Modules/setup
- current branch: master
- local changes: no
- git fetch: Fetching origin
Already on 'master'
- git checkout: Your branch is up to date with 'origin/master'.
- git pull: Already up to date.
- database update: no changes
- component updated
Updating /var/www/emoncms/Modules/wifi
- current branch: master
- local changes: no
- git fetch: Fetching origin
Already on 'master'
- git checkout: Your branch is up to date with 'origin/master'.
- git pull: Already up to date.
- database update: no changes
- component updated
Updating /opt/emoncms/modules/backup
- current branch: master
- local changes: no
- git fetch: Fetching origin
Already on 'master'
- git checkout: Your branch is up to date with 'origin/master'.
- git pull: Already up to date.
- database update: no changes
- running module install/update script
- config.cfg already exists, left unmodified
- creating /etc/php/7.3/mods-available/emoncmsbackup.ini
post_max_size = 3G
upload_max_filesize = 3G
upload_tmp_dir = /var/opt/emoncms/backup/uploads
- phpenmod emoncmsbackup
- restarting apache
- component updated
Updating /opt/emoncms/modules/demandshaper
- current branch: master
- local changes: no
- git fetch: Fetching origin
Already on 'master'
- git checkout: Your branch is up to date with 'origin/master'.
- git pull: Already up to date.
- database update: no changes
- running module install/update script
- reinstalling demandshaper.service
- demandshaper service: ActiveState=active
- component updated
Updating /opt/emoncms/modules/postprocess
- current branch: master
- local changes: no
- git fetch: Fetching origin
Already on 'master'
- git checkout: Your branch is up to date with 'origin/master'.
- git pull: Already up to date.
- database update: no changes
- component updated
Updating /opt/emoncms/modules/sync
- current branch: master
- local changes: no
- git fetch: Fetching origin
Already on 'master'
- git checkout: Your branch is up to date with 'origin/master'.
- git pull: Already up to date.
- database update: no changes
- component updated
Updating /opt/emoncms/modules/usefulscripts
- current branch: master
- local changes: no
- git fetch: Fetching origin
Already on 'master'
- git checkout: Your branch is up to date with 'origin/master'.
- git pull: Already up to date.
- database update: no changes
- component updated
/opt/openenergymonitor/EmonScripts/sudoers.d/wifi-sudoers: parsed OK
wifi sudoers entry updated

-------------------------------------------------------------
EmonPi LCD Update
-------------------------------------------------------------
Reading package lists...
Building dependency tree...
Reading state information...
i2c-tools is already the newest version (4.1-1).
python3-smbus is already the newest version (4.1-1).
python3-gpiozero is already the newest version (1.6.2-1).
python3-rpi.gpio is already the newest version (0.7.0-0.1~bpo10+4).
0 upgraded, 0 newly installed, 0 to remove and 109 not upgraded.
Looking in indexes: https://pypi.org/simple, https://www.piwheels.org/simple
Requirement already satisfied: redis in /usr/local/lib/python3.7/dist-packages (3.5.3)
Requirement already satisfied: paho-mqtt in /usr/local/lib/python3.7/dist-packages (1.5.1)
Requirement already satisfied: xmltodict in /home/pi/.local/lib/python3.7/site-packages (0.12.0)
Requirement already satisfied: requests in /usr/lib/python3/dist-packages (2.21.0)
- reinstalling emonPiLCD.service
Removed /etc/systemd/system/emonPiLCD.service.
Removed /etc/systemd/system/multi-user.target.wants/emonPiLCD.service.
- installing emonPiLCD.service
Created symlink /etc/systemd/system/multi-user.target.wants/emonPiLCD.service → /opt/openenergymonitor/emonpi/lcd/emonPiLCD.service.
Created symlink /etc/systemd/system/emonPiLCD.service → /opt/openenergymonitor/emonpi/lcd/emonPiLCD.service.
- Service ActiveState=active
Stopping emonPiLCD service
Display update message on LCD

Starting emonPi LCD service..


-------------------------------------------------------------
System update done: Wed  8 Dec 07:35:41 GMT 2021
-------------------------------------------------------------
restarting service-runner

@TrystanLea - Not sure what it was, But I have moved the app module to the Stable branch, and it has resolved the issue.

I see there were updated to the Master branch recently, so maybe there was a side effect.

Thanks

Tim

Hello @Tim_Meadows I realise what the issue was now and have pushed a fix to the master branch. Would you be able to try the latest app master branch alongside latest emoncms core master branch as well?

Hi @TrystanLea,

Just updated back to the master branch, and getting this at the top of the screen when viewing the app:

Notice: Undefined index: order in /var/www/emoncms/Modules/app/app_model.php on line 60

Notice: Undefined index: order in /var/www/emoncms/Modules/app/app_model.php on line 60

Notice: Undefined index: order in /var/www/emoncms/Modules/app/app_model.php on line 60

Notice: Undefined index: order in /var/www/emoncms/Modules/app/app_model.php on line 60

Notice: Undefined index: order in /var/www/emoncms/Modules/app/app_model.php on line 60

Notice: Undefined index: order in /var/www/emoncms/Modules/app/app_model.php on line 60

Notice: Undefined index: order in /var/www/emoncms/Modules/app/app_model.php on line 60

Seems to have fixed the issue with viewing when not logged in though! :+1:

Thanks @Tim_Meadows, could you update the app module again now, should fix that issue. Do you have a custom app that you are using?

Hi @TrystanLea,
FAB - thanks that worked. It all looks good now.

I do have a slightly custom app, I have just copied the MySolarPVBattery app and tweaked the resize function to make the graph 60% of the screen as it displays better on the tablet I have in the Kitchen.

Thanks again.

Tim

1 Like

Good to hear, it might be worth taking the latest MySolarPVBattery app and re-applying your changes to that as there are some API related changes in the latest version of the app module that would be worth having.

Yes - I noticed that the recent updates stopped my copy working, so have recopied and all is good! :slight_smile:

Thanks!

1 Like

Morning @TrystanLea,

Whilst the non authenticated access is working OK - there seems to be an issue with the app displaying.
Over time something happens to the X axis meaning that the graph seems to go back in time.
For example - this is the screen after being left for a while:

And this is what it should look like after a refresh of the page:

As you can see, it looks like the X Axis is moving the wrong way over time…

Any ideas?

Thanks

Tim

Thanks Tim, I’ve pushed up a fix for this to the app module master branch. Thanks for testing the latest versions!

Fab. That looks like it has fixed it.

Thanks @TrystanLea

Tim

1 Like