Wifi emonTX4 not connecting to emonCMS

Hi, I have set up 2 emonTX4s, both connected to wifi with good signal strength and both are accessible via their assigned IP addresses and I do see data. However, when I’m in emonESP and enter the info on the emonCMS section, it never shows as connected. I have copied the read & write API key a couple of times to make sure there were no entry mistakes and even generated a new API key to try that. Still not connecting. Inputs do not show up in emonCMS as a result.

Note - I did not enter username and password in the Admin section of emonESP as I assumed this is for accessing the emonTX4, not emonCMS.

Any suggestions as to what to do next?

thank you,

Gordon

Do you have a local emonCMS? If you have, the APIKeys for your local emonCMS and your account at emoncms.org are NOT the same. (This a common ‘gotcha’.)

Hi Robert,
I do not have a local emonCMS (unless it came pre-loaded with the TX4). I pulled the APIkeys from my account on emonCMS.org

I don’t understand what you mean. emonCMS runs on a web server - usually but not necessarily a Raspberry Pi. There’s no possibility of it running on an emonTx4, or any other emonTx.

I’ve just tried connecting to emoncms.org with an emonTx V3.4, and it required a restart to begin sending (and then only a startup message but that’s because it’s the wrong sketch!).

Robert,
sorry - what I meant is I do not have emonCMS running locally as I only have the TXv4 and the emonVS.

I just tried a restart twice and still not connected.

I haven’t had a lot of experience with the ESP8266, so I’ve run out of ideas. Have you sent anything to your emonCMS? What about one of the example data blocks in Input API Help? - easiest is the one with your APIKey already in it, just copy it into the address line of a new web browser page and send it. If not, we’ll have to get Trystan to check his end.

Ok – I was able to send the example data block to my emonCMS and that seemed to work.

I sent this string emoncms.org/input/bulk?data=[[0,16,1137],[2,17,1437,3164],[4,19,{“data”:1412},{“anotherData”:3077}]]

And was able to see the following on my Inputs page.

So it looks to be a problem either with the sketch not sending any data or not in the expected format on the serial interface to the ESP8266, or it’s the ESP8266 not sending it on. I think we need @TrystanLea again.

Maybe a pedantic difference to you, it’s actually to control access to the ESP8266

It enables and SETS access control. Leaving it blank means unfettered access to the ESP8266 menu via your LAN.

(@TrystanLea - this needs clarifying on the input form (ideally) and ‘Docs’ documentation)

Hi Robert, understood. I’ve left it blank while I do all my testing so as not to overly complicate things. Once I have everything up and running, I will be setting it up appropriately. I mentioned it in my earlier email more to make sure it was just for access control and not needed for emonCMS.

I am sure my issue is some setting that I am not seeing or aware of. Are there any logs at the CMS or ESP end that would show what is failing or not communicating? The only logs that I can see on the ESP seem to be the messages that are capturing the data being seen. I was hoping for an error message that said something simple like APIkey invalid.

No - this is why we need Trystan to look at his logs, to see if anything is arriving. Obviously, he can’t allow a user access there because unless each user has their own log (which I think you don’t) it opens all of everyone’s data to you, and vice versa.

Back at this again. From my ESP logs, I can see that the CT is recording data (I have one CT in P1 and when I turn on the circuit it is connected to, the value increases from the off value around 59 and goes up to 1274 watts). See below - and this matches what shows under the Latest Data tab.

However, in emonESP, on the emoncms tab it still shows as not connected

I am stuck and can’t figure out why my emonTX4 is not connecting to the emonCMS cloud server. Do I need to have an emonBase between the emonTX4 and the emonCMS cloud-based server? I had understood that the emonTX4 with wifi could communicate directly with the emonCMS cloud-based server (which is what I am trying to do).

Any help is greatly appreciated.

{MSG:19101,Vrms:240,P1:59,P2:13,P3:12,P4:12,P5:12,P6:11,E1:3507,E2:1049,E3:1017,E4:1051,E5:929,E6:908,pulse:0,freeram:29240,srssi:-71,psent:1,psuccess:0}
{MSG:19102,Vrms:240,P1:323,P2:13,P3:12,P4:13,P5:11,P6:11,E1:3508,E2:1049,E3:1017,E4:1051,E5:929,E6:908,pulse:0,freeram:29240,srssi:-69,psent:2,psuccess:0}|
{MSG:19103,Vrms:240,P1:1274,P2:13,P3:12,P4:12,P5:11,P6:11,E1:3511,E2:1049,E3:1017,E4:1051,E5:929,E6:908,pulse:0,freeram:29224,srssi:-71,psent:3,psuccess:0}|
{MSG:19104,Vrms:240,P1:862,P2:15,P3:12,P4:13,P5:12,P6:11,E1:3514,E2:1049,E3:1017,E4:1051,E5:929,E6:908,pulse:0,freeram:28864,srssi:-69,psent:4,psuccess:0}|
{MSG:19105,Vrms:240,P1:57,P2:13,P3:12,P4:12,P5:11,P6:11,E1:3514,E2:1049,E3:1017,E4:1051,E5:929,E6:908,pulse:0,freeram:28872,srssi:-64,psent:5,psuccess:0}{MSG:19106,Vrms:240,P1:63,P2:|```

The EmonESP should connect directly, no need for and emonBase.

@TrystanLea @glyn.hudson @Gwil - can you help please?

As Brian says, it should (and mine does) connect to either one or the other (but not both at the same time).

Have you checked your router / firewall etc? You’ve shown your browser connects, is the ESP blocked for some reason?

Hello @grod55 could you PM me your emoncms.org account details and I will look into this for you?

Might also be worth setting node name to something short e.g outdoorAC and checking that there are no added spaces on the write apikey.

Another thing to try is a full factory reset of the EmonESP.

Well, using a shorter name did it! I originally had the name set to Chandler Attic HVAC and just changed it to AtticHVAC. Clicked save and then it connected.

So, was it the space in the name or the character length that caused the ESP to not connect?

I figured it was something simple.

Thanks again for all the support.

Best regards,

Gordon

1 Like

Great to hear, it’s probably the spaces, but not 100%

I just did some testing and the emonCMS Node Name is limited to 15 characters and it does NOT allow spaces. It does accept underscore_ and hyphen- in the name. I’m not sure about any other special characters.

Good info to add to the documentation.

Thanks again for all the help.

Gordon

1 Like