Sending time to Emoncms

Jérôme's picture

Re: Sending time to Emoncms

This syntax means : at time 13781997, the node of which the ID is 1 received a frame of 3 values that are 100, 200 and 300. 13781997 is the number of seconds since the 1st of january 1970, basically (epoch, see here).

What do you mean "send time to Emoncms" ?

By default, when emoncms receives a sample, it stores it with current time. In order to send delayed samples, you need to indicate a time, either with an absolute value, like in your example, or with a relative value (I don't have an example here, see the API in emoncms.org itself).

If you mean to send samples asynchronously and specify a time, then this is what you need. You just have to figure out how to change the date and time from the format you have into this number of seconds.

 

michalgaska's picture

Re: Sending time to Emoncms

Thanks so much! I am new in PHP,

echo strtotime ("now");

Is it good formula to convert actual time to Unix timestamp?

Jérôme's picture

Re: Sending time to Emoncms

I haven't tried, but I guess so: http://php.net/manual/en/function.strtotime.php

If the time is now, you don't have to specify it. Unless you expect a great delay in the communication.

michalgaska's picture

Re: Sending time to Emoncms

I want to send samples asynchronously. For example, I am sending my value and time:

//emoncms.org/input/post.json?json={V: 230}&apikey=x&time=strtotime ("now")

And how to visualize my data? I am traing to use update feed @time in Input menu. But it doesn't work.

Comment viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.