RTC on Arduino call to send with Senddata function

Support forum for MegunoLink
Post Reply
4cmclean
Posts: 4
Joined: Mon Oct 12, 2020 2:21 am

Mon Oct 12, 2020 2:35 am

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
philr
Posts: 326
Joined: Mon May 26, 2014 10:58 am

Mon Oct 12, 2020 5:25 am

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
4cmclean
Posts: 4
Joined: Mon Oct 12, 2020 2:21 am

Mon Oct 12, 2020 11:00 pm

Thnx for the reply. I thought i was loosing it.
4cmclean
Posts: 4
Joined: Mon Oct 12, 2020 2:21 am

Tue Oct 13, 2020 10:39 pm

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
philr
Posts: 326
Joined: Mon May 26, 2014 10:58 am

Wed Oct 14, 2020 4:35 am

That's strange. Sounds like an arduino end problem. Can you post your code or a cut down example?
4cmclean
Posts: 4
Joined: Mon Oct 12, 2020 2:21 am

Wed Oct 14, 2020 6:16 am

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
Post Reply