Feeding emoncms DB with data from cmdline script?

Hi *
Forgive me maybe silly/simple question.
I just don’t have time to drill across whole documentation…

May somebody hint me what is simplest/easiest method to feed emoncms with data using source as cmdline script?
I’ve written perl script asking SmartPlug for power/energy which returns power/energy values.
If I will call such script every 30 or 60sec - what will be easier way to feed such data to emoncms?

I can write mysql access with my script - but maybe there is more easy way to do things?

installing mqtt as proxy for such simple task seems to be overkill…

thx in advance!

Why then not use the same perl script to send the data to emonCMS? I do this with dozens other things on my own setup :slight_smile: And this way you not even need to store it in a db first to read it out again.

Script I use:

use LWP::Simple;
my $url = “http://localhost/input/post.json?node=whateveryoulike&json={title:value}&apikey=yourapikey”;
my $content = get $url;

So use the values you read out and use them to create the link as needed on the fly. This way the call to read the data also does the sending part. Nice and easy…

This way thousand of solar inverters are sending their data to my site :slight_smile:

Have fun…

Ah before I forget, you can even do a sanity check if the data has been sent. If you print $content you will see the result of the request which should be ok or true. If not you could do a if clause to either print a error log or wait for it to send it again. If you trust your Environment like I do it’s not necessary.