Community
OpenEnergyMonitor

Community

Wamp Server installation

Hello everyone. I would like to create a WAMP local server for my emoncms. Unfortunately I have a problem with the settings.ini file created from the example settings.ini file. On loading localhost/emoncms the following error is returned.


I have attached my settings.ini file. If any person can tell me what the problem is, I will appreciate

settings.txt (2.1 KB)

Thanks

seems that the function parse_ini_file() is a bit fussy about white spaces…

line 82 of your attached file has a some formatting that breaks the parsing rules php uses:
phpfina[datadir] = "C:\Users\Lui\emoncmsdata\phpfina\"

If you do any of these it should work:

  • remove the space at the end of the line
  • remove the " quotes around the value
  • use single quotes ' in place of the double quotes "

I’m unable to test on a windows box. @Lui please reply if this solves the issue on your WAMP setup.

;tldr

I was able to test this outside the emoncms system by using the php interpreter in the terminal:

$ > php -a
php > var_export(parse_ini_file("/path/to/settings.txt",true));

tweaking the values of the settings.txt file until no errors are returned.

quit the interactive interpreter by pressing CTRL + D

This unfortunately does not work. it still retruns the same error as before. May be I should point out that I am following the guidance provided by this link in creating this settings file from the default settings file. I have attached the default setting file as well. defaul_settings.txt (5.8 KB)

Have you tried deleting the ! in the settings file (I know that in theory it is commented out but…)?

From the docs;

Note: The following reserved words must not be used as keys for ini files: null, yes, no, true, false, on, off, none. Furthermore, the following reserved characters must not be used in the key: {}|&~!()^".

You are probably the first person to try the newer settings process (by ini file) on a WAMP setup. EmonCMS is largely run on a LAMP machine, and is designed for such.

You need 2 ini files, one is the default settings, and a second to override settings as required and is thus a subset of the default settings. Do you have both? The structure and the [headings] must be identical.

Is it a line end problem? When I open that (on a windows machine) there are no line breaks.

But that is counter to the docs. https://www.php.net/manual/en/function.parse-ini-file.php

Note :
If a value in the ini file contains any non-alphanumeric characters it needs to be enclosed in double-quotes (").

@Lui if you have any way to run on Linux (VM, docker, spare RPI perhaps?) you should have a better experience as we dont develop and test on WAMP, just in case it saves you a lot of hassle?..

That’s “normal.”

Windows uses CR/LF as line terminators.
UNIX/Linux uses LF only. i.e no CR.

Yes I realise that, but it means the Win machine may not be interpreting the contents correctly.

I’m not sure I follow you, since that’s expected behavior.
Are you referring to the WAMP server the OP is speaking of?

How will the installation process change should I use VM? I am in the process of trying that out.

You can use our automated build script on a debian based VM (e.g ubuntu): see guide here: https://github.com/openenergymonitor/EmonScripts/blob/master/install/readme.md

Each element of the ini file should be on a single line. If the Win machine opens it and it does not have the correct line breaks, it may be the issue.

OK, now I see what you’re saying.

The first thing that springs to mind is the text editor is going to handle the file differently
than the WAMP server. I recall running a WAMP server and seeing the same thing,
i.e. the file didn’t display correctly in Windows Notepad, yet the WAMP server had no issues with it.

Sounds like it may be a WAMP server issue vice a Windows issue.

After thinking about it for a bit, I realized that if displayed in Windows Wordpad
or Notepad++, Windows will display the file “correctly.”

Well I instead opted to get a raspberry pi v4 for the same task. I followed the instructions on how to install the emonScripts as it is discussed here. Unfortunately on rebooting, I can no longer access the pi. I keep getting the error message “Cannot open access to console, the root account is locked.” I have seen possible pathways to resolving this. Is there any explanation for this? And how easily can I resolve it.

Is that the first reboot after install? Did you wait for it to finish all the resizing etc (does take a while)? You might get that message initially while it is busy doing things.

I don’t think the scripts had been tested on a Pi4. Any reason not to use the EmonSD image?

Have you tried any of them?

I edited the the cmdline.txt by adding init=/bin/sh using a card reader. The console indicates bin/sh: can’t access tty; job control turned off. Then I followed the instructions as explained here. The OS indicates that it has panicked but sync fails. What did I miss?

I’d suggest you start again from scratch or use an EmonSD image.

Hello @borpin.
I installed the emonSD image onto a flashDrive and logged into the emonpi thereafter.
I would like to access have a user interface to use which would enable me to access my emoncms account locally from this point on. Is there a way to proceed from here? How do I transit from the terminal to the EmonCMS GUI interface? Any resources and guide from here will be appreciated.

Regards