Hi
I'm getting ready for my EmonPi. I'm planning on running Emoncms locally on my energy efficient server that is running linux and is currently serving as my mail server, file server, htpc with all my movies and music on etc etc.
Running Emoncms that machine instead of on the EmonPi would also solve the potential problem of wearing out the SD card. However I notice Emoncms requires "swift mailer", now I'm loathed to run unnecessary services and I don't want to mess up my email setup so can Emoncms be configured to run without email ?
Thanks for any advise.
Re: Why does Emoncms require "swift mailer" ?
As far as I'm aware it's optional, but if you don't install it, you will not be able reset your emoncms password if you ever forget it (because it will not be able to email you the link). Also, any add-ons such as the event module would also not send email alerts (I use 'push' messaging anyway!).
Paul
Re: Why does Emoncms require "swift mailer" ?
Do you need email to reset emoncms password? surely you can just SSH into the box and edit files directly ?
Re: Why does Emoncms require "swift mailer" ?
Yes! correct.
By editing the MYSQL database, with a little work you can overwrite the password.
Paul
Re: Why does Emoncms require "swift mailer" ?
If, for some reason, you don't want to, or can't, edit the database directly, here's how to reset the emoncms MySQL password from the command line: (can be done locally, or via SSH)
Log on to MySQL as the MySQL root user
mysql -u root -p
Enter the MySQL root password, then issue the command:
SET PASSWORD FOR 'user-name-here'@'hostname-name-here' = PASSWORD('new-password-here');
Re: Why does Emoncms require "swift mailer" ?
Bill, we're talking about resetting the emoncms password, not the MYSQL root password.
See this post for resetting the emoncms password via editing MYSQL.
Paul
Re: Why does Emoncms require "swift mailer" ?
OK. Post updated with info on how to change the emoncms MySQL password...
Re: Why does Emoncms require "swift mailer" ?
Bill, sorry, we are still talking different passwords.
We are discussing the emoncms 'user' password - the one which you login to the ui, when accessing emoncms from a desktop, and not the MYSQL root or emoncms password.
The emoncms user password is stored in encrypted format in a MYSQL table, and is usually recovered by clicking 'forgot password' and swift mailer emails you a recovery link.
Paul
Re: Why does Emoncms require "swift mailer" ?
Right. I was working on a method of resetting that password (emoncms user) via the command line when I got sidetracked by some flash flooding we had last night and this morning. (had to go out and buy a pump and some hose)
Re: Why does Emoncms require "swift mailer" ?
Got it worked out. Here's how to reset the emoncms user password from the MySQL command line: (can be done locally, or via SSH)
N.B. This assumes your emoncms admin account user name, and your database, are both named emoncms. If not, substitute your admin account username where you see the emoncms username, and your database name where you see the emoncms database name.
Create a new user from the emoncms login screen. For this example, we'll give that user the name emontemp.
Take note of the password you gave the emontemp user.
run Mysql as the MySQL root user:
mysql -u root -p (you'll be prompted for the MySQL root user password)
Switch to your database. (Substitute your database name if it's not emoncms) issue the command:
use emoncms;
To copy emontemp's password to the emoncms user account, issue the command:
update users set password=(select * from (select password from users where username='emontemp') x) where username='emoncms';
To copy emontemp's password salt to the emoncms user account, issue the command:
update users set salt=(select * from (select salt from users where username='emontemp') x) where username='emoncms';
Time saver tip: The two commands are the same save for the words password and salt. After you issue the first command, hit the up arrow key, change the two instances of password to salt, hit enter.
That's it. You should be able to log on to your emoncms admin account with the password you gave emontemp.
Re: Why does Emoncms require "swift mailer" ?
Brilliant, thanks Bill. I've cut & pasted your advice and saved so if I ever need to do it I don't need to ask.... just waiting on my EmonPi now :-)