SOLVED - Issue logging in to new emoncms

Hi

I have just followed the wiki page to install emoncms on my pi. Everything went fine, I can get the emoncms login page in the browser but when I try to log in with the suggested username/password of raspi/raspberry it does not log in, instead a pink box appears below the password and above the remember me tick box. This pink box does not contain any text. Following the register option leads to a similar fault after entering the registration details and submitting.

Any ideas?

Is there a log file? Or will I have to enable the apache log files?

Automate's picture

Re: SOLVED - Issue logging in to new emoncms

Did you try it without checking the "Remember Me" box?

mattdale77's picture

Re: SOLVED - Issue logging in to new emoncms

Yes, I tried with both. Same result

Robert Wall's picture

Re: SOLVED - Issue logging in to new emoncms

I have only set up emoncms on a WAMP server, but I would check that you have the right passwords in the right places. emoncms needs to use its own user ID and password to write into MySQL, if that's not right it is not allowed access to the database.

I steered somebody else through the process here: http://openenergymonitor.org/emon/node/2148 - that might shed some light on your problem. (OK, you're on LAMP not WAMP, but the setup and passwords etc should be similar.)

Jérôme's picture

Re: SOLVED - Issue logging in to new emoncms

Hi.

I have just followed the wiki page to install emoncms on my pi. Everything went fine, I can get the emoncms login page in the browser but when I try to log in with the suggested username/password of raspi/raspberry it does not log in, instead a pink box appears below the password and above the remember me tick box.

Which doc are you referring to ? As a general rule, please try to add a link. I'd say the one on emoncms.org, but I don't see suggested username/password.

Anyway I'm pretty sure there shouldn't be any account already created, you need to create one.

This pink box does not contain any text.

No idea why. Looks like an alert message, but without text...

Following the register option leads to a similar fault after entering the registration details and submitting.

Indeed, you must register. The settings.php file contains an option to enable/disable account creation. Should be enabled as default.

Any ideas?

No, I don't see why registration fails. And I suppose (not checked) that if you didn't have access to the database at all, you would see much more garble on the screen.

Is there a log file? Or will I have to enable the apache log files?

Nope, I don't think there's anything else than apache log files.

mattdale77's picture

Re: SOLVED - Issue logging in to new emoncms

The one I was using is at http://emoncms.org/site/docs/raspberrypibuild

The username and password is specified just before the optional section at the bottom.

I originally had a database fault as the password was wrong, it was a php error which I corrected so it should now be connecting to the database.

Does the emonbase module need to be attached for this to work?

mattdale77's picture

Re: SOLVED - Issue logging in to new emoncms

There seems to be a few tables created in the database but users is empty.

Does this need to be run from localhost?

Robert Wall's picture

Re: SOLVED - Issue logging in to new emoncms

You can send input to emoncms either manually using a web browser (see Input API Help) or from an emonBase. It is a lot simpler to do it manually from a browser while you are setting up. You address it as

http://localhost/<dir>/<command string>

 

Example: in my case emoncms is in a subdirectory as I have several versions:

http://localhost/emoncms5/input/post.json?json={power:200}&apikey=[whatever]

 

You also log in to emoncms via your browser at

http://localhost/<dir>/

 

Again, in my case

http://localhost/emoncms5/

 

Always include your read/write apikey when sending data.

You will need to register as a user (not necessarily the same user that is registered to MySQL) for the users table to have a user in it.

mattdale77's picture

Re: SOLVED - Issue logging in to new emoncms

The error message displayed in the apache log file is as follows

File does not exist: /var/www/emoncms/user

I also tried the register without entering anything in the fields at all and it resulted in the same so it does not even get as far as calling the register function, obviously it's having trouble finding the library but not sure why

Robert Wall's picture

Re: SOLVED - Issue logging in to new emoncms

What library are you talking about?

mattdale77's picture

Re: SOLVED - Issue logging in to new emoncms

This fault appears when I either try to login or register a user.

There are a number of other similar errors

Lots of "File does not exist: /var/www/emoncms/raspberrypi"

It looks to me like mod_rewrite is not working or something like that. 

I don't have an api key yet as I've not been able to log in or register.

mattdale77's picture

Re: SOLVED - Issue logging in to new emoncms

Does anyone else have any ideas? I still have this issue.

Just tried on localhost rather than over the network and the same result so that was not the issue

mattdale77's picture

Re: SOLVED - Issue logging in to new emoncms

Solved it, there was an issue in my apache config file which prevented mod_rewrite doing its thing

Kael Arial's picture

Re: SOLVED - Issue logging in to new emoncms

Hello mattdale7

martin.sadler's picture

Re: SOLVED - Issue logging in to new emoncms

Hi, mattdale77,

could you let me know what the specific problem was with apache2.conf, please?

I have exactly the same issue (pink box with no text when trying to register - no user created).

During installation (following the installation guide at http://emoncms.org/site/docs/installlinux) I could find no file named /etc/apache2/sites-enabled/000-default. (as per the doc above). There is a 000-default.conf in the same directory but no "AllowOverride ..." entries.

Having read your post above I looked in /etc/apache2/apache2.conf and found 4 such entries. I changed them all from "None" to "All" - probably not the most sensible thing to do but at 3.00am desperation sets in! However, to no avail - still getting the blank, pink box and no new user. Yes, I did remember to restart Apache2 after modifying apache2.conf.

I found the following error message in the Apache2 error log:

PHP Fatal error:  Call to undefined function json_encode() in /var/www/emoncms/index.php on line 127, referer: http://localhost/emoncms/

I suspect this means I'm missing a *.php file?

Many thanks in anticipation.....

 

martin.sadler's picture

Re: SOLVED - Issue logging in to new emoncms

Ah-hah! I've found the problem. The php5-json package was not installed. The installation instructions at http://emoncms.org/site/docs/installlinux are not correct - the php5-json package needs to be added to the list in the second step - "Install all dependencies".

Also, as mentioned in my previous post, the actions in the 5th step - "Emoncms uses a front controller ..... " needs updating: need to edit /etc/apache2/apache2.conf, NOT the /etc/apache2/sites-enabled/000-default(.conf) as currently documented.

Jérôme's picture

Re: SOLVED - Issue logging in to new emoncms

What system are you using ?

I think the instructions apply to debian systems, but other distributions may configure apache differently.

In debian, php5-json is a virtual package provided by php5-common, so it does not need to be installed explicitely. However, it probably doesn't hurt to do it, so we can add it to the installation command line.

The instructions for the apache config look correct to me. I would rather edit in sites-available but no big deal, sites-enabled is just a symlink to it.

I sent a pull request for php5-json. Regarding the apache config, I'm afraid the doc can't detail it for all distros, but maybe we could add a comment saying that other distros may differ.

https://github.com/emoncms/docs/pull/18

Comment viewing options

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