Post a new topicPost a reply Page 1 of 1   [ 6 posts ]
Author Message
 Post subject: Using time stamp
PostPosted: Sat Jun 02, 2012 6:16 pm 

Joined: Sun May 08, 2011 7:57 am
Posts: 45
Dear all,
I am using time stamp in my network, and following the programming guide and the work of others on the forum, I managed to get it work, however, I have problem with this kind of time stamp, the problem is as follow:

I do the programming and the coding in one day at specific time, and I upload the code to the mote, switch it off, and use it the following day on site, the time I am getting is referred to the previous day, so the it seems that the clock will not continue running, any way to solve the problem.

I also you hibernate (where I set RTC OFF)

Regards


Top
 Profile  
 
 Post subject: Re: Using time stamp
PostPosted: Mon Jun 04, 2012 8:21 am 

Joined: Mon Sep 28, 2009 1:06 pm
Posts: 7440
mihussein,

Are you using time stamp of RTC?

If you set your current time with RTC.setTime(...) method, then you can hibernate and turn OFF RTC. It will keep the time you set because RTC is still powered by battery coin.

However, take care you do not set time every time you run your code... It must be done only first time.

Let us know your comments.

Regards.


Top
 Profile  
 
 Post subject: Re: Using time stamp
PostPosted: Tue Jun 05, 2012 9:24 am 

Joined: Sun May 08, 2011 7:57 am
Posts: 45
Thanks Libelium for the reply,

What should I do if I did change the time setting every time I upload the code, becuase I did a test first and when it worked, after few days I modefied the code with the new time settings and uploaded it.

Any advice

Regards


Top
 Profile  
 
 Post subject: Re: Using time stamp
PostPosted: Tue Jun 05, 2012 11:31 am 

Joined: Mon Sep 28, 2009 1:06 pm
Posts: 7440
mihussein

One thing you can do is to make a "setup code" where you only set RTC time and other variables you want to save (for example in EEPROM).

Then, upload and run this code, so RTC time will be set.

After that, you can upload your "application code" where RTC time is not set, so no matter you reset mote or modify this code due to RTC was set only one time when you ran "setup code".

Note: This is only possible if you keep coin battery always connected. Otherwise RTC will loss date and time.

Any other questions please feel free to ask.

Regards.


Top
 Profile  
 
 Post subject: Re: Using time stamp
PostPosted: Tue Jun 05, 2012 9:07 pm 

Joined: Sun May 08, 2011 7:57 am
Posts: 45
what about I remove the coin battery instade of using a setuo code (which will reset the RTC) then upload my code.


Top
 Profile  
 
 Post subject: Re: Using time stamp
PostPosted: Wed Jun 06, 2012 8:52 am 

Joined: Mon Sep 28, 2009 1:06 pm
Posts: 7440
mihussein,

We think you did not get the idea.

RTC must be powered (by coin cell) to keep time you have set.

For instance, if today you upload and run a code witch have RTC.setTime("12:06:06:04:08:45"); and then you turn it off, when you turn it tomorrow, same time will be set because same code line will be executed.

To avoid that, you can run one time RTC Setting and Reading Time Example with your current time, and then upload your code with no more changes on RTC. Now you can switch off your waspmote and turn it on next day, time will be right.

Hope this helps.

Regards.


Top
 Profile  
 
Display posts from previous:  Sort by  
Post a new topicPost a reply Page 1 of 1   [ 6 posts ]


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:


Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group
Libelium theme based on 610nm Style by Daniel St. Jules of http://www.gamexe.net


© Libelium Comunicaciones Distribuidas S.L. | Terms of use