Hello. My emoncms is not populating the input from IoTaWatt.
I had to delete all my inputs and feeds on emoncms and start over due to a configuration problem. But now the IoTaWatt is not populating the emoncms’s inputs. I remember I had problems getting it to populate when I first setup emoncms.
I have the server URL set to http://192.168.1.50/emoncms on my IoTaWatt and it is getting these errors:
12/12/21 09:16:33 emoncms: Query failed -5
12/12/21 09:16:38 emoncms: Query failed 401
12/12/21 09:16:43 emoncms: Query failed 401
There is a device access key in emoncms and write api key. I currently have IoTaWatt setup to use the write api key. Which key should I use? Any idea as how to fix that error?
Not many people here know very much about iotawatt, me included.
You can check that your emonCMS is operating correctly by using a web browser to send one of the test strings that appear in the Input API Help. If one, or ideally, all of those work, then I’d say there’s very little wrong with your emonCMS, and it’s the structure or format of the message that the iotawatr is sending that’s the problem.
The one you’re using - the Read & Write API Key. (It gives permission to write into emonCMS).
Has the server URL been changed by your router, by any chance?
Is emonCMS where you think it is (i.e., do you need to specify the “/emoncms” directory?
I fixed it. I went into emoncms “API Help” and copied the “Read/Write” API key. I then used that in IoTaWatt and it started updating! I was using the write key before this and it didn’t work.
Now you really confused me. There isn’t a write key.
There is a Read only key, which allows whoever possesses it to read from emonCMS, (but not to add or change data) and
there is a Read & Write key, which allows whoever possesses it to both read from and write to emonCMS, in effect to do anything - read, change, add or delete.
I’ve sent a PM to Trystan pointing out the inconsistency, and that I see the names on the Inputs page as rather more descriptive and thus more helpful.
Confusion aside, the two places SHOULD contain the same data - and they certainly do on my system.
The “Write API Key” mentioned on the “My Account” page under Setup aligns exactly with the “Read & Write” key listed on the Input API help page.
Can you compare the two keys on your system and confirm they are in fact different? IF they ARE different - that seems like something has gone wrong somewhere!
Both my local RPi emonCMS and my emoncms.org account have the same key in both places.
I even checked that the “Copy to clipboard” was the same as the visible key - it is on both.
Could @mrfiat have accidentally triggered a new API key if he’s been accessing it in My Account rather than via Input API Help?
[Trystan says he’ll use the Input API Help wording in both places in the next release ]