How to avoid dashboard viewing session expiry

[Discussion moved from Admin session expiry and logout - #6 not on-topic]

I have my emonpi dasboard in a tablet in a wall and after a certain time it expired the session too. How we can do to never expire? Thanks.

This question doesn’t strictly relate to this topic as you do not need an admin session to view a dashboard.

Simply adding your api key to the end of your dashboard url will remove any need to remain logged in.


you only need your readonly apikey but either will work.

Thank you Paul for the reply
But I don´t understand where I add my apikey. I use this link to view my dashboard
http://(my ip)/emoncms/dashboard/view/Main

http://(my ip)/emoncms/dashboard/view/Main&apikey=abc123etc

or strictly speaking I think it should be

http://(my ip)/emoncms/dashboard/view/Main?apikey=abc123etc

as it’s the first arg, but IIRC either will work.

Thank´s once again!!
I´ll try it now.

Yes it is workiing!!!

It doesn´t work for me :((
It log off after 3 or 4 hours.

I’m not sure how it can “log off after 3 or 4 hours” by using the apikey you are bypassing the need to log in at all, if you are not logged in, how can it log you out???

Do not log in to emoncms!

Starting with a fresh browser window and using a dashboard url with an apikey as described above you should see the dash without logging in. That will never timeout from emoncms’s end as there is nothing to time, each request/refresh by the browser is individually authorized by the apikey.

I understand… maybe it´s a browser cache problem or I am doing something wrong… I use the Fully Kiosk browser. Tonight when I arrive at home I´ll try. Thank you.

I try it now in my PC, I already delete cache browser (google chrome) , and when I copy the link I have to put my user and password, it doesn´t go directly.

I assume you are editing it for your setup by changing the host address, dashboard name and apikey, correct?

You said your dashboard works (when logged in) with the url

http://(my ip)/emoncms/dashboard/view/Main

Is “Main” the alias you set up? If not try setting up and using the alias name.

all you should need to do is add the ?apikey= and your read apikey to work

http://(my ip)/emoncms/dashboard/view/(my dash alias)?apikey=(my readonly apikey)

I’m not really sure what else to suggest, is your setup “standard” ie have you made any changes to the way emoncms works? Or to the way the Apache server and virtual hosts work?

I have just tested again on my setup and it works as expected, however, once I add “&apikey=”, even with an incorrect apikey or no apikey at all, it then says “Invalid API key” on the page. It doesn’t take me to the log-in screen.

In fact, when the “?apikey=” text is in the url it will do 1 of 3 things, display the dash correctly if the alias and apikey are correct, display “Invalid API key” if the apikey is wrong regardless of what the alias is or display a blank page if the apikey is correct but the alias is wrong. So I do not know how you are arriving at the login page, the “?apikey=” seems to remove that as a possible outcome.

Can we assume you are not getting the log in page and you are just getting a blank page? If so it is most likely the alias isn’t set (or being used) as mentioned above, can you confirm you are using the alias? And that there are no special characters in the alias.

How up to date is your emonPi? I have to admit, my emoncms is somewhat behind, so if something has changed or broken in the recent revisions, I might not have those updates yet.

Paul thank you very much for your patience. without your explanation I ´ll never resolve this issue.
My mistake. :confused: in the url I add the apikey in the word “apikey” and then =abc123etc. Now with your explanation:
http://(my ip)/emoncms/dashboard/view/(my dash alias)?apikey=(my readonly apikey)
I notice that I must add what is in parenthesis.
Once again, thank you for take your time.

…but I lose the graphs of my dashboard…

If you are saying that you have embedded graphs (from the graphs module) and they are not populating, it may be that an issue I reported back in Feb 2017 remains unaddressed.

Your options are to either set all the feeds and dashboard to public so you don’t use an apikey, but your data will be available to anyone that has access to the network your emoncms is on. Or you can use “multigraphs” instead of “graphs”, this option has the added benefits of not only being more secure/private than the first option, but multigraphs also auto update so that the data displayed doesn’t grow stale due to a static timeline, unless this has been resolved now, the graph module doesn’t auto-update.

See Web browser auto update [Solved] - #2 by pb66 for more info.

Ok thank´s. I will see it.