Adding IoTaWatt inputs to Emoncms server on EmonPi Emoncms

I’m currently having a lot of trouble setting up IoTaWatt data inputs into my emoncms server (which is being hosted by an EmonPi). The IoTaWatt input simply doesn’t show up on emoncms. I have been able to set up emonTHs successfully. Below is the configuration I have in the IoTaWatt Web server setup:

17475f442f641f5637e2660923b29e5f804440b5_1_431x500

Please let me know what, if anything, I’m doing wrong.

Hi Dan,

Let’s start with the basics. Sorry if these seem like stupid questions, but i’m coming in cold here:

  • It’s typical that both the IoTaWatt and the Pi are on the same LAN. Can you verify that is the case?

  • If you type the IP address that you are using into a browser, does it produce the Emoncms logon?

  • Are you using the read/write key from the instance of Emoncms on the Pi as opposed to a possible account on Emoncms.org?

If all of the above are yes, then could you restart your IoTaWatt (in the tools menu), then post a screenshot of the status display, and the message log?

Thanks.

Hi

I configured the IotaWatt to send the data to my own server. At first it didn’t work, I couldn’t recieve the data from my IotaWatt to my server. I configured the IotaWatt as per screenshot of dhix17. After I restarted the IotaWatt, it did do the trick. Below the log.

1/03/19 14:56:27z EmonService: started. url=192.168.0.213:3306, node=IotaWatt, interval=10
1/03/19 14:56:49z EmonService: get input list failing, code: -4
1/03/19 15:46:43z Restart command received.
** Restart **
SD initialized.
1/03/19 15:46:46z Real Time Clock is running. Unix time 1546530406
1/03/19 15:46:46z Version 02_03_20
1/03/19 15:46:46z Reset reason: Software/System restart
1/03/19 15:46:46z Trace: 1:4, 1:3, 1:4, 1:3, 1:4, 1:3, 1:4, 1:3, 1:4, 1:3, 1:4, 1:3, 1:4, 1:3, 1:4, 1:3, 1:4, 1:3, 1:4, 1:3, 1:4, 1:3, 1:4, 1:3, 1:4, 1:3, 1:4, 1:3, 1:4, 1:3, 10:2, 10:3
1/03/19 15:46:46z ESP8266 ChipID: 2518091
1/03/19 15:46:46z SPIFFS mounted.
1/03/19 15:46:47z Local time zone: +0:00
1/03/19 15:46:47z device name: IotaWatt
1/03/19 15:46:47z MDNS responder started for hostname IotaWatt
1/03/19 15:46:47z LLMNR responder started for hostname IotaWatt
1/03/19 15:46:47z HTTP server started
1/03/19 15:46:47z WiFi connected. SSID=telenet-5B9DC6F, IP=192.168.0.158, channel=1, RSSI -82db
1/03/19 15:46:47z timeSync: service started.
1/03/19 15:46:47z statService: started.
1/03/19 15:46:47z Updater: service started. Auto-update class is MINOR
1/03/19 15:46:47z dataLog: service started.
1/03/19 15:46:48z dataLog: Last log entry 01/03/19 15:46:40
1/03/19 15:46:48z historyLog: service started.
1/03/19 15:46:48z historyLog: Last log entry 01/03/19 15:46:00
1/03/19 15:46:49z Updater: Auto-update is current for class MINOR.
1/03/19 15:46:52z EmonService: started. url=192.168.0.213:80/emoncms, node=IotaWatt, interval=5
1/03/19 15:46:53z EmonService: Node doesn’t yet exist.
1/03/19 15:46:53z EmonService: Start posting at 12/25/18 00:00:05

As you can see, I first tried to guide the IotaWatt through port 3306, because at the /var/www/html/emoncms/settings.php file as (as per installation instructions https://github.com/emoncms/emoncms/blob/master/docs/LinuxInstall.md) it states:

/1 #### Mysql database settings
$server = “localhost”;
$database = “emoncms”;
$username = “emoncms”;
$password = “MYPASSWORD”;
$port = “3306”;
// Skip database setup test - set to false once database has been setup.
$dbtest = true;

So it specifies the port 3306, that’s why I thought I should also specify it at the emoncms config at my IotaWatt. But this didn’t work, so I removed the port specification in the url. After saving, it still didn’t work. After a restart, it did work :).

Does anyone know why there is a port specified in the emoncms/settings.php file, but it shouldn’t be specified at the URL in the IotaWatt setup?

1 Like

I’m not an expert with RPi, and IoTaWatt supports several different external servers including multiple flavors of emoncms. Questions about that should probably go to the OEM forum, but I understand the frustration because as soon as you utter the word IoTaWatt, they send you over here without looking at the problem.

Looking at what you posted, it looks like that’s the port configuration for the Mysql database that I believe emoncms uses as a backend. Again, I’m not up to speed on emoncms, but my understanding is that emoncms is simply a collection of .php modules that run on the apache (or whatever) HTTP server - which is usually at port 80. So it would probably work to specify port 80, although it’s implied with the HTTP:// URL. The /emoncms URI, I believe, directs the HTTP server to fetch the emoncms page which I think is a .php file and takes it from there.

@overeasy is correct, on both counts. The people at emoncms don’t seem very friendly towards iotawatt, for some reason. The configuration above is for MySQL, which is used to keep track of users but not much else anymore. Port 80 is the default for the web UI/API and does not need to be specified.

Hallo @dhix17
Did you manage to come right with the link between IotaWatt and EmonPi?

I just wanted to chime in. I have a pi 3b using the pre-built image dated Oct 17 2019 . I have the pi plugged in with Ethernet and on ip 192.168.1.147. I went to that ip in a browser, then made an account on the emoncms. When you are logged into emoncms as that account, in the upper right is a user icon, click it and choose “my account”. this page show stats on that user. you will see “Write API Key”. Copy that info.

Back on your IoTaWatt – Setup → web server → emoncms
Edit Emoncms Service
Node = IotaWatt
post interval(sec) = 10
bulk send = 1
upload history = I did not touch this it says mm/dd/yyyy
server URL = http://192.168.1.147
api key = the write API key that you just copied from the emoncms user account
emoncms userid = blank, I did not enter anything into this field.

After that, it seemed to start sending over inputs that are located below these settings.