Log remotely on my remote server

Hi everyone,

I am trying to make my emon pi sending his data in real time to my server that has emon cms but i don’t understand what i am doing wrong. I tried to follow the instructions here : 3. Log Remotely - Guide | OpenEnergyMonitor ; but when I enter the ApiKey into local EmonCMS (the one of the EmonPi) and then I hit save, my server does not receive any data and even does not recognize any EmonPi in the inputs. I am pretty sure there is a link with the fact that my serveur adress is not on emoncms.org, but I didn’t find a solution.

Thanks in advance

Antonin

Welcome to the OEM forum, Antonin.

You need your server’s address and (possibly, the path to emonCMS) in emonHub in the place of url = https://emoncms.org and naturally that also needs your server’s APIkey (not the emonPi APIkey).

Thank you for the welcome.

I tried to put my server’s adress where you said but nothing changed (I had already put my server’s APIkey). What is the path to emonCMS you are talking about? Is it in the server’s adress?

I just saw on the API Input helper that maybe I need to enter in the url section mort informations than only the server’s adress, like input/bulk but I do not understand how it works. Here is an example of request given : https://outils-numeriques.ines-solaire.org/mesuresPEB/input/bulk?data=[[0,16,1137],[2,17,1437,3164],[4,19,1412,3077]]
I understand thanks to the API input helper what are the first two numbers between the brackets, but I can’t see what to enter for the two after them.

Hi Antonin,

Is there a reason you don’t want to and/or can’t run an instance of emonCMS on your emonPi?

Hi Bill,

Yes it is the instruction that i got, because in fact the server I use will also receive some data from others monitoring systems, so it would be beter to have all the data from all the installations on the same server.

OK. That makes sense. Just wanted to make sure you knew you can run emonCMS on your emonPi.

Yes I knew that, thank you.

thumbsup

So somebody has the response?

Hi Antonin,

bulk is used for uploading historical data, whereas you are looking to upload realtime data.

Try this - http://192.168.1.4/input/post?node=emontx&fulljson={“power1”:100,“power2”:200,“power3”:300}&apikey=_your_API_KEY

Obviously you will need to replace 192.168.1.4 with the address of your server, and “power1”:100 with your actual values.

I don’t understand what you are trying to do there - if I understood you correctly, that is not what you want.

Do you want to record data on your emonPi’s emonCMS, and at the same time send the same data onwards to your other server and the emonCMS running there?

If it is, then where I told you to enter your other server’s URL in emonhub.conf, you also need the path all the way to emonCMS on that server. So unless emonCMS is in the root of that server, https://www.myotherserver.com is not good enough, you need something like https://www.myotherserver.com/emoncms Depending on how your server is set up, you might need a final /.

The ssl certificate from my server is correct but in the emonHub log I get this message :
emoncmsorg couldn’t send to server, URLError: [SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed (_ssl.c:581)
send failure: wanted ‘ok’ but got ‘’
When I am searching this adress : sending: http://outils-numeriques.ines-solaire.org/mesuresPEB/input/bulk.json?apikey=E-M-O-N-C-M-S-A-P-I-K-E-Y&data=[[1582667559.257176,5,6,0,6,247.37,29.1,0,0,0,0,0,0],[1582667561.184171,5,0,0,0,248. […] in my navigator with the right apiKey it works however.

I want also to thank you for helping me on this problem.

@TrystanLea should be able to help here.

I can send to emoncms.org with https, so I think it should work. But I’m not a networking expert.

Antonin,

It looks like your cert may not be fully installed on your server. If you go to https://www.sslchecker.com/ and point it at your site it reports back that a number of the certificates in the chain are not found.

I’m a bit rusty on the SSL configuration side, but without the chain in place what you can end up with is the server saying “I am ines-solaire.org and you can trust me because I say so” instead of “I am ines-solaire.org and you can trust me because Gandi says this is me and you already trust Gandi (and Verisign and DigiCert and others).”

It’s possible (as I say, I’m a little rusty) that the issue is on the emonpi front and the pi (the client in this case) is saying “I don’t know Gandi, so I don’t trust certs signed by Gandi, so I don’t trust your cert.”

You may want to validate the SSL config with more generic tools (search for something like “ssl checking tool” first and once the tools are happy that all is 100% working on the server side try from the pi (client) again.

David

1 Like