# New emoncms settings format - help testing needed

**URL:** <https://community.openenergymonitor.org/t/new-emoncms-settings-format-help-testing-needed/12002>\
**Category:** Emoncms\
**Created:** [24 September 2019 10:46 UTC](https://community.openenergymonitor.org/t/new-emoncms-settings-format-help-testing-needed/12002 "2019-09-24T10:46:05Z")\
**Posts on this page:** 20\
**Page:** 2

<div class="post-metadata">

**Author:** ![alexandrecuer](https://community.openenergymonitor.org/user_avatar/community.openenergymonitor.org/alexandrecuer/32/9158_2.png) [@alexandrecuer](https://community.openenergymonitor.org/u/alexandrecuer)\
**Post date:** [25 September 2019 17:31 UTC](https://community.openenergymonitor.org/t/new-emoncms-settings-format-help-testing-needed/12002/21 "2019-09-25T17:31:33Z")

</div>

> [@borpin](#):
>
> Except it is in a separate Repository/Module. If each of those had a run.php we’d be in a right mucky fuddle. It is a bit like the multitude of `config.cfg` files that float about. You have to know **where** the file is to know what it is doing

I agree that file names are important but documentation also and generally there is a lack of documentation specially in the codes of the modules (API doc)…

---

<div class="post-metadata">

**Author:** ![TrystanLea](https://community.openenergymonitor.org/user_avatar/community.openenergymonitor.org/trystanlea/32/31_2.png) [@TrystanLea](https://community.openenergymonitor.org/u/TrystanLea)\
**Post date:** [25 September 2019 18:09 UTC](https://community.openenergymonitor.org/t/new-emoncms-settings-format-help-testing-needed/12002/22 "2019-09-25T18:09:23Z")

</div>

> [@alexandrecuer](#):
>
> Yes i did it and i also reboot the pi but still the same error

Does the error repeat if you keep restarting demandshaper?

---

<div class="post-metadata">

**Author:** ![borpin](https://community.openenergymonitor.org/user_avatar/community.openenergymonitor.org/borpin/32/193_2.png) [@borpin](https://community.openenergymonitor.org/u/borpin)\
**Post date:** [25 September 2019 18:33 UTC](https://community.openenergymonitor.org/t/new-emoncms-settings-format-help-testing-needed/12002/23 "2019-09-25T18:33:59Z")

</div>

@TrystanLea, Just went onto github and switched to the settings branch in demandshaper and there is apparently no `run.php` file.

---

<div class="post-metadata">

**Author:** ![TrystanLea](https://community.openenergymonitor.org/user_avatar/community.openenergymonitor.org/trystanlea/32/31_2.png) [@TrystanLea](https://community.openenergymonitor.org/u/TrystanLea)\
**Post date:** [25 September 2019 19:09 UTC](https://community.openenergymonitor.org/t/new-emoncms-settings-format-help-testing-needed/12002/24 "2019-09-25T19:09:00Z")

</div>

Yes, I’ve just changed the service name to demandshaper\_run.php. I’ve also updated the service file which will need recopying to /lib/systemd/system/demandshaper.service and then a systemctl reload-daemon. Once this merges to master I will add a notice to the demandshaper thread.

---

<div class="post-metadata">

**Author:** ![borpin](https://community.openenergymonitor.org/user_avatar/community.openenergymonitor.org/borpin/32/193_2.png) [@borpin](https://community.openenergymonitor.org/u/borpin)\
**Post date:** [25 September 2019 20:28 UTC](https://community.openenergymonitor.org/t/new-emoncms-settings-format-help-testing-needed/12002/25 "2019-09-25T20:28:18Z")

</div>

> [@TrystanLea](#):
>
> I’ve just changed the service name to demandshaper\_run.php. I’ve also updated the service file which will need
> 
> - recopying to /lib/systemd/system/demandshaper.service
> - `sudo systemctl reload-daemon`
> - `sudo systemctl restart demandshaper.service`

@alexandrecuer - you will need to re-pull the repo and do the above changes.

If there is still a problem, add the variables to the error message and see if they are pulling through correctly.

> <https://github.com/emoncms/demandshaper/blob/c857c50612b4ad6b4d4ae0be571c71790eaee267/demandshaper_run.php#L56-L56>

---

<div class="post-metadata">

**Author:** ![borpin](https://community.openenergymonitor.org/user_avatar/community.openenergymonitor.org/borpin/32/193_2.png) [@borpin](https://community.openenergymonitor.org/u/borpin)\
**Post date:** [25 September 2019 20:28 UTC](https://community.openenergymonitor.org/t/new-emoncms-settings-format-help-testing-needed/12002/26 "2019-09-25T20:28:51Z")

</div>

> [@TrystanLea](#):
>
> recopying to /lib/systemd/system/demandshaper.service

Can we change the install to do a link please? I raised an Issue.

---

<div class="post-metadata">

**Author:** ![TrystanLea](https://community.openenergymonitor.org/user_avatar/community.openenergymonitor.org/trystanlea/32/31_2.png) [@TrystanLea](https://community.openenergymonitor.org/u/TrystanLea)\
**Post date:** [25 September 2019 20:49 UTC](https://community.openenergymonitor.org/t/new-emoncms-settings-format-help-testing-needed/12002/27 "2019-09-25T20:49:52Z")

</div>

Sorry I forgot, theres an install script in the demandshaper module that handles the service install, including the correct path location:  
[demandshaper/install.sh at master · emoncms/demandshaper · GitHub](https://github.com/emoncms/demandshaper/blob/master/install.sh)

running:

```
./install.sh

```

inside the demandshaper folder sorts out the service file install.

> [@borpin](#):
>
> Can we change the install to do a link please? I raised an Issue.

and I realise now why its copied. Its because of the path change… so we need to use a override if we are to symlink. Will look into that alongside what we where discussing for setting the user for the other services.

---

<div class="post-metadata">

**Author:** ![borpin](https://community.openenergymonitor.org/user_avatar/community.openenergymonitor.org/borpin/32/193_2.png) [@borpin](https://community.openenergymonitor.org/u/borpin)\
**Post date:** [25 September 2019 21:03 UTC](https://community.openenergymonitor.org/t/new-emoncms-settings-format-help-testing-needed/12002/28 "2019-09-25T21:03:10Z")

</div>

> [@TrystanLea](#):
>
> and I realise now why its copied. Its because of the path change

Um, but the other services work fine…

---

<div class="post-metadata">

**Author:** ![TrystanLea](https://community.openenergymonitor.org/user_avatar/community.openenergymonitor.org/trystanlea/32/31_2.png) [@TrystanLea](https://community.openenergymonitor.org/u/TrystanLea)\
**Post date:** [26 September 2019 11:45 UTC](https://community.openenergymonitor.org/t/new-emoncms-settings-format-help-testing-needed/12002/29 "2019-09-26T11:45:30Z")

</div>

Their run paths are all fixed to /var/www/emoncms/scripts… though. While the script path for demandshaper is system dependent .

---

<div class="post-metadata">

**Author:** ![borpin](https://community.openenergymonitor.org/user_avatar/community.openenergymonitor.org/borpin/32/193_2.png) [@borpin](https://community.openenergymonitor.org/u/borpin)\
**Post date:** [26 September 2019 12:05 UTC](https://community.openenergymonitor.org/t/new-emoncms-settings-format-help-testing-needed/12002/30 "2019-09-26T12:05:25Z")

</div>

> [@TrystanLea](#):
>
> While the script path for demandshaper is system dependent .

Oh yes, I was thinking of the modules that get installed as links. You could pass the path as a variable to the demandshaper install script but default to the existing path - that might help transition.

---

<div class="post-metadata">

**Author:** ![TrystanLea](https://community.openenergymonitor.org/user_avatar/community.openenergymonitor.org/trystanlea/32/31_2.png) [@TrystanLea](https://community.openenergymonitor.org/u/TrystanLea)\
**Post date:** [26 September 2019 15:41 UTC](https://community.openenergymonitor.org/t/new-emoncms-settings-format-help-testing-needed/12002/31 "2019-09-26T15:41:38Z")

</div>

I’ve create stable and master branches for all the emoncms modules and modified the emonSD update process to switch modules that did not have stable branches over to stable (if emoncms core is on stable).

So the testing process for the above is now to ensure all modules are on the master branch.

---

<div class="post-metadata">

**Author:** ![TrystanLea](https://community.openenergymonitor.org/user_avatar/community.openenergymonitor.org/trystanlea/32/31_2.png) [@TrystanLea](https://community.openenergymonitor.org/u/TrystanLea)\
**Post date:** [26 September 2019 15:52 UTC](https://community.openenergymonitor.org/t/new-emoncms-settings-format-help-testing-needed/12002/32 "2019-09-26T15:52:57Z")

</div>

The only repository that needs to be on the settings\_object branch at the moment is the emonpi repository. On an emonSD system:

```
cd
cd emonpi
git checkout settings_object
```

---

<div class="post-metadata">

**Author:** ![alexandrecuer](https://community.openenergymonitor.org/user_avatar/community.openenergymonitor.org/alexandrecuer/32/9158_2.png) [@alexandrecuer](https://community.openenergymonitor.org/u/alexandrecuer)\
**Post date:** [27 September 2019 13:14 UTC](https://community.openenergymonitor.org/t/new-emoncms-settings-format-help-testing-needed/12002/33 "2019-09-27T13:14:22Z")

</div>

OK fine for demandshaper - no more error message on the admin page

for dashboards, I have the following warnings :

```auto
EmonCMS Error
-------------
Message: ReferenceError: Vue is not defined
Route: Modules/graph/graph.js?v=2
Line: 1294
Column: 21 

```

and

```auto
EmonCMS Error
-------------
Message: ReferenceError: _lang is not defined
Route: Modules/graph/graph.js?v=2
Line: 635
Column: 21

```

Anyway, no malfunction : you can edit and view dashboards…

As far as postprocess module is concerned, when creating a powertokwh process, it is correctly injected in the data field of the mysql postprocess table, the process begins to treat the datas, but the process is then removed from the list…the processed feed is anyway correctly created…I think it is not linked to the new settings, but do you have such a behaviour ? if yes I will raise an issue…  
for other process, I dont have the problem

---

<div class="post-metadata">

**Author:** ![borpin](https://community.openenergymonitor.org/user_avatar/community.openenergymonitor.org/borpin/32/193_2.png) [@borpin](https://community.openenergymonitor.org/u/borpin)\
**Post date:** [1 October 2019 06:40 UTC](https://community.openenergymonitor.org/t/new-emoncms-settings-format-help-testing-needed/12002/34 "2019-10-01T06:40:10Z")

</div>

@alexandrecuer, can you try an update please, specifically the **database** update. I don’t think the database update has been changed to use the new settings object.

---

<div class="post-metadata">

**Author:** ![alexandrecuer](https://community.openenergymonitor.org/user_avatar/community.openenergymonitor.org/alexandrecuer/32/9158_2.png) [@alexandrecuer](https://community.openenergymonitor.org/u/alexandrecuer)\
**Post date:** [1 October 2019 09:30 UTC](https://community.openenergymonitor.org/t/new-emoncms-settings-format-help-testing-needed/12002/35 "2019-10-01T09:30:33Z")

</div>

Thanks database is up to date

---

<div class="post-metadata">

**Author:** ![borpin](https://community.openenergymonitor.org/user_avatar/community.openenergymonitor.org/borpin/32/193_2.png) [@borpin](https://community.openenergymonitor.org/u/borpin)\
**Post date:** [1 October 2019 16:22 UTC](https://community.openenergymonitor.org/t/new-emoncms-settings-format-help-testing-needed/12002/36 "2019-10-01T16:22:21Z")

</div>

@TrystanLea - might I suggest something in the admin page that informs which settings files are in use? Might be useful for debugging as the migration happens.

---

<div class="post-metadata">

**Author:** ![TrystanLea](https://community.openenergymonitor.org/user_avatar/community.openenergymonitor.org/trystanlea/32/31_2.png) [@TrystanLea](https://community.openenergymonitor.org/u/TrystanLea)\
**Post date:** [1 October 2019 16:33 UTC](https://community.openenergymonitor.org/t/new-emoncms-settings-format-help-testing-needed/12002/37 "2019-10-01T16:33:36Z")

</div>

I’ve now merged the master branches into stable, which means this is all now live and available via emonSD update. I will do a forum post detailing this release next.

@borpin good idea, will look into that.

---

<div class="post-metadata">

**Author:** ![borpin](https://community.openenergymonitor.org/user_avatar/community.openenergymonitor.org/borpin/32/193_2.png) [@borpin](https://community.openenergymonitor.org/u/borpin)\
**Post date:** [1 October 2019 18:19 UTC](https://community.openenergymonitor.org/t/new-emoncms-settings-format-help-testing-needed/12002/38 "2019-10-01T18:19:03Z")

</div>

~~I’m not sure the backup Module has been modified. I raised an issue.~~

My bad - wrong redis prefix so service-runner did not pick it up.

All fine except it is not currently backing up the settings.ini. I’m sure Trystan will fix that shortly 🙂

---

<div class="post-metadata">

**Author:** ![borpin](https://community.openenergymonitor.org/user_avatar/community.openenergymonitor.org/borpin/32/193_2.png) [@borpin](https://community.openenergymonitor.org/u/borpin)\
**Post date:** [4 October 2019 16:16 UTC](https://community.openenergymonitor.org/t/new-emoncms-settings-format-help-testing-needed/12002/39 "2019-10-04T16:16:51Z")

</div>

> [@TrystanLea](#):
>
> If settings.ini is not found emoncms will look for settings.php

It seems to me, that this is the other way round in that, emoncms will first try and process a `settings.php` file (so backwards compatible) and if not found, will process a `settings.ini`.

> <https://github.com/emoncms/emoncms/blob/388e03c5a2d6f019dbc0ac5883044fcbe5084ed7/process_settings.php#L20-L20>

---

<div class="post-metadata">

**Author:** ![relnah](https://community.openenergymonitor.org/letter_avatar_proxy/v4/letter/r/0ea827/32.png) [@relnah](https://community.openenergymonitor.org/u/relnah)\
**Post date:** [14 October 2019 18:54 UTC](https://community.openenergymonitor.org/t/new-emoncms-settings-format-help-testing-needed/12002/40 "2019-10-14T18:54:03Z")

</div>

I’m running a custom Docker image. I’ve cloned stable branch and tried settings with env vars. Didn’t get it to work.  
Below example gives error that user {{MYSQL\_USER}} has no access. Placeholders doe not seem to be replaced with env vars. Setting the real values instead works nicely.  
Example of my settings.ini

[sql]  
server = 192.168.1.6  
username = {{MYSQL\_USER}}  
password = {{MYSQL\_PWD}}

[redis]  
enabled = true

[mqtt]  
enabled = false

[log]  
level = 1

[Previous page](https://community.openenergymonitor.org/t/new-emoncms-settings-format-help-testing-needed/12002.md?page=1)

[Next page](https://community.openenergymonitor.org/t/new-emoncms-settings-format-help-testing-needed/12002.md?page=3)
