New install of EmonCMS on Ubuntu 20LTS

Trying to install EmonCMS on Ubuntu 20.04LTS. The install script fails with this error:

PHP Warning:  chdir(): No such file or directory (errno 2) in /opt/openenergymonitor/EmonScripts/common/emoncmsdbupdate.php on line 8
PHP Warning:  require(process_settings.php): failed to open stream: No such file or directory in /opt/openenergymonitor/EmonScripts/common/emoncmsdbupdate.php on line 9
PHP Fatal error:  require(): Failed opening required 'process_settings.php' (include_path='.:/usr/share/php') in /opt/openenergymonitor/EmonScripts/common/emoncmsdbupdate.php on line 9

When I checked /var/www there was no emoncms folder.

Any idea what’s wrong?

1 Like

@ishtangli, I shared my Ubuntu install notes in this topic. Hopefully my notes are of some use…

How long ago was this install?

I was able to successfully install it using the script last year. Must have been some significant change since then.

I’ve gotten the system to partially run by manually doing a git clone of emoncms to /var/www and changing the default passwords in settings.ini to match the ones in config.ini.

I still have 2 red lights under System Info: feedwriter and demandshaper.

Any ideas?

I was able to setup a fresh install with 0 hassle (2021 edition). Here are the steps:

  1. Install Ubuntu 20.04LTS. When asked to create a user, use “pi”
  2. sudo echo $USER’ ALL=(ALL) NOPASSWD: ALL’ | sudo tee /etc/sudoers.d/$USER && sudo chmod 0440 /etc/sudoers.d/$USER
  3. wget https://raw.githubusercontent.com/openenergymonitor/EmonScripts/master/install/init.sh
    chmod +x init.sh && ./init.sh
  4. say Y when asked to review the config
  5. cd /opt/openenergymonitor/EmonScripts/install/
    nano config.ini
  6. Set emonSD_pi_env=0
  7. replace all “stable” with “master
  8. Save and quit
  9. ./main.sh

You can now access the server through the IP address. Everything works out of the box except for update which gives the “invalid serial port” error.

update App throws a “connection error”

Thanks @ishtangli that should now be fixed! Though you may have to manually run the following commands to get past the issue:

cd /opt/openenergymonitor/EmonScripts
git pull

cd /var/www/emoncms
git pull

Worked perfectly. Thanks.

Now my only problem is in the app

Get a connection error after 10 seconds which wasnt an issue on my 2019 installation (ubuntu 18).

I get the following error when executing the first instruction:

-bash: syntax error near unexpected token `(’

When I run the commands using ‘sudo’ (since I get an error on the first instruction), I receive the following error on the last step:

./main.sh: 90: /EmonScripts/install/non_emonsd.sh: not found

I was able to get a clean install using these steps on July 27th.

Which instruction from where?

Here? https://github.com/openenergymonitor/EmonScripts/blob/master/install/readme.md#ubuntu

Thanks for the link. That works properly. I was using the text from the Jul 19 post.

1 Like