Page 1 of 1

RTC on Arduino call to send with Senddata function

Posted: Mon Oct 12, 2020 2:35 am
by 4cmclean
hi
Im not having much luck to get this working with TimePlot. Im looking for how to format the senddata command so i can use the local RTC vs the pc time.

My function is as
TemperaturePlot.SendData(F("Temperature Fahrenheit"),TempsF); and prints as {TIMEPLOT:Temperature|DATA|Temperature Fahrenheit|T|32}
in the serial monitor which is correct.

Fahrenheit|T|32} The |T| tells us this is using pc time. I need to know where and how to format to use arduino rtc in the function. I cannot find any info thru the online docs.
Thanks

Re: RTC on Arduino call to send with Senddata function

Posted: Mon Oct 12, 2020 5:25 am
by philr
Hi, unfortunately the arduino library doesn't support that functionally (yet). We have added it to our request list. To make it work you'd need to manually assemble a serial message and match your real time clock daya to the format covered here:
https://www.megunolink.com/documentatio ... reference/

Cheers
Phil

Re: RTC on Arduino call to send with Senddata function

Posted: Mon Oct 12, 2020 11:00 pm
by 4cmclean
Thnx for the reply. I thought i was loosing it.

Re: RTC on Arduino call to send with Senddata function

Posted: Tue Oct 13, 2020 10:39 pm
by 4cmclean
Hi
I have tried using the serialized version of the send command {TIMEPLOT:TemperaturePlot|data|Temperature Celcius|T|25.6} and of course this works. Then replacing T with a string, that CONCATENATES my time format as per your link yyyy-mm-dd hr:mm:ss this doesnt work. In the serial monitor it merely shows my String function variable name and of course this is incorrect.

What am i missing?

Thanks

Re: RTC on Arduino call to send with Senddata function

Posted: Wed Oct 14, 2020 4:35 am
by philr
That's strange. Sounds like an arduino end problem. Can you post your code or a cut down example?

Re: RTC on Arduino call to send with Senddata function

Posted: Wed Oct 14, 2020 6:16 am
by 4cmclean
PlotTemperatureC(TempsInC); to call the function below, where "TempsInC" is a string variable of temperature.

This as is works with no problem, but is using computer time |T|

void PlotTemperatureC(String data)
{
Serial.print("{TIMEPLOT:Temperature|data|Temperature Celcius|T|");
Serial.print(data);
Serial.println("}");
}

Simply replacing |T| with a string variable of time stamp. The string is "2020-10-14 02:09:10"
I have also tried "2020/10/14 02:09:10"

Serial.print("{TIMEPLOT:Temperature|data|Temperature Celcius|2020/10/14 02:09:10|");

Actual .... Serial.print("{TIMEPLOT:TemperatureColin|data|Temperature Celcius|TimeIn|"); where "TimeIn string variable is formatted as shown above.
If its not a string variable that is valid, what is the correct method to populate this with?

Thanks