EmonCMS on DirectAdmin

Hey guys,

I’ve been trying to run EmonCMS on a DirectAdmin server… the web part works (somewhat), however, when I try to point an IoTaWatt device to it - nothing happens - no inputs no devices - nothing.

When I point it to emoncms dot org - it works (at least - there’s data showing up there).
On the DA install - the device shows:
8/25/22 16:21:15 emoncms: Starting, interval:5, url:http://emoncms.mydomain.com
8/25/22 16:21:35 emoncms: Query failed -4
8/25/22 16:21:59 emoncms: Query failed -4
8/25/22 16:22:23 emoncms: Query failed -4
8/25/22 16:22:47 emoncms: Query failed -4
8/25/22 16:23:11 emoncms: Query failed -4
8/25/22 16:23:35 emoncms: Query failed -4

Any ideas on how to “make it work” on DA?
Any specific steps that need to be taken?

Hopefully someone knows the right answers.

Does emoncms respond when you send it test data using your browser? There are test strings on the Input API Help page - you’ll need the example with the API key:

GET [https://emoncms.org/input/post?node=emontx&fulljson={"power1":100,"power2":200,"power3":300}&apikey=39323397b3c2ddf1e198b397b12bc1af5a2](https://emoncms.org/input/post?node=emontx&fulljson={%22power1%22:100,%22power2%22:200,%22power3%22:300}&apikey=2ddf139323397b312bc1afc2ddf1e193397b8bb5a2) 

[No, it’s not a genuine APIkey :face_with_hand_over_mouth: ]

If those appear on the Inputs page, then it could be an addressing problem.

It might be worth asking on the IoTaWatt forum. That is managed by Bob Lemaire, its creator, and he and the other users there are more likely to have the specific knowledge to help you. There are few here who know very much about his device.

I’m aware that Bob Lemarie manages the IoTaWatt community, however, IoTaWatt is not related to EmonCMS in any way which is why I’m writing here.

As I said - I can get the device to talk to emoncms dot org - I see data there, all the inputs, everything.
What I don’t see is that same data on a local emoncms install on a DirectAdmin server, which is really why I’m here and not on the IoTaWatt forum.

It’s almost exactly the same process whether you use a WAN or LAN. Your emonCMS will receive data via your LAN in exactly the same way. Can you use your web browser to send the test string that your local emonCMS generates? And does it receive the data?

What LAN or WAN are you referring to?
I’m not running DirectAdmin (it’s a webhosting control panel) on a raspberry PI. I’m running it on an actual Debian server.

I cloned GitHub - emoncms/emoncms: Web-app for processing, logging and visualising energy, temperature and other environmental data directly into /home/theuser/public_html/ (as is the default location for all DA users).
There is Redis running along with the appropriate PHP extensions.
PHP-FPM, v7.4
MySQL is also running and the database gets created properly when I register an initial account.

Tried to attach settings.ini however… “new users” aren’t allowed …

Turns out… the problem was on the DirectAdmin’s side… Mod_Security blocked the source IP for multiple violations. Now started to get data into the local install.

1 Like

I figured is was either something missing with the installation or a permissions problem of emonCMS, or an addressing problem from the Iotawatt.