Go Down

Topic: bug in the timealarm library (Read 12384 times) previous topic - next topic

draythomp

Uh, kinda make it hard to test

Code: [Select]

TimeAlarmsTest.cpp: In function 'void onAlarm()':
TimeAlarmsTest:37: error: 'class TimeAlarmsClass' has no member named 'getTriggeredAlarmId'
TimeAlarmsTest:51: error: 'class TimeAlarmsClass' has no member named 'free'
TimeAlarmsTest.cpp: In function 'void loop()':
TimeAlarmsTest:137: error: 'class TimeAlarmsClass' has no member named 'getNextTrigger'
Trying to keep my house under control http://www.desert-home.com/

draythomp

Trying to keep my house under control http://www.desert-home.com/

viknet

same issue, had to find the beta directory first :-)

missing
void TimeAlarmsClass::write(AlarmID_t ID, time_t value,dtAlarmPeriod_t period)
that I added immediatly,

The new isallocated function make code easier to read, but for the sake of my own knowledge, why a function instead of a macro ?


testing tonight and tommorow evening will send you result then.

regards

viknet

#93
Jul 06, 2011, 07:50 am Last Edit: Jul 06, 2011, 08:09 am by viknet Reason: 1
It is leaking,

I have to see if it is your base code or my modification (new write function)

regards

-------------------------------
Updated:
the dtNBR_ALARMS was back to 6 (from the 8 I am currently using) and that triggered some memory leak, it was there with the previous version and I am not at all sure It come from your sketch, it is probably my code So no issue there, I restart my tests this morning without a memory leak.

viknet

perfectly working on my side :-)

what about you ?

draythomp

I've had it going in a random fashion from a couple of years back to 5 years forward, starting over when it goes past the upper.  Both timers and alarms have been working fine.  I also ran it once to failure in the future and no problem came up.

I suggest publishing it and let other folk play with it as much as they want to.
Trying to keep my house under control http://www.desert-home.com/

mem

Thanks for the feedback.

I will create a new zip with the directories in the expected places so its less confusing to install and publish tomorrow for wider testing


mem

Here is a link to the beta Library that fixes the weekly alarm problem. The only change from the code I posted above is the directory structure now matches the old library so the contents can be directly copied into the libraries folder.  I also added this text in a release note:

Quote
Changes made July 5 2011:

This is a beta test version of the libraries that provides a fix for
recurring weekly alarms.

TheTime library is unchanged except for fixes to a macro in Time.h that
converts the number of days to elapsed seconds and the macros that are used
to calculate weekly alarms.

The functionality of the TimeAlarms library has changed slightly in order to
make the library easier to maintain and enhance.

In short, if your application used an Alarm method to create weekly
alarms then you should change your sketch  to use the methods that take the
explicit DayOfWeek parameter. Only the Alarm methods are affected,
Timer methods are as before.

Here are the details:
The previous version could set weekly alarms by calling the AlarmOnce method
with a value greater than one day to indicate the day and time of the weekly
alarm. This has changed and explicit calls to set weekly alarms must be used
when setting weekly alarms. If you were setting weekly alarms by calling either
   Alarm.alarmRepeat(weeklyValue,  AlarmFunction);
then you need to change this to:
  arm.alarmRepeat(DayOfWeek, Hour, Minute, Second,  AlarmFunction);
 
Also the clock must be set to a time on or after Jan1 1971 when using the Alarm methods.
Timer methods are unchanged and will function even if the clock has not been set


Lets see how this goes for a day or so and then I will circulate this more widely

Michael

p.s. viknet, note that I did not add in the enhanced write method. As explained in my earlier post, I think the library is better suited for its intended purpose without it so will need to add into your version.

mem

I posted info on the update in a new thread so people would not need to read through the seven pages of background to get to the information on the beta release.

Michael


copet_pitik

First, i am noob in arduino and just tinkering arduino.

i make a clock using :
1. Arduino UNO
2. RTC DS1307
3. LCD 16*2

this is how it is work:
==> Visual Basic set RTC time
==> Visual Basic set the Alarm and Save to Arduino EEPROM

and this is the problem that I got:
I have an interval mode alarm, this mode have value to start the alarm, end the alarm, and interval value.
when i compare RTC time and EEPROM value and start the alarm, alarm time is late.
example:
I set the alarm :
- start time : 13.00 pm
- end time : 14.00 pm
- interval :  5 minute

the alarm should 'sound' at 13.05.00 pm (HH.MM.SS), but i get the alarm sound at 13.05.30 and will continue till 14.05.30 pm.

the code is below this post:



Quote
:smiley-fat: sorry for my english:smiley-fat:


Program Studi Instrumentasi Medis
Politeknik Mekatronika Sanata Dharma
Yogyakarta Indonesia

copet_pitik

#100
Jul 09, 2011, 12:14 pm Last Edit: Jul 11, 2011, 02:54 pm by copet_pitik Reason: 1
the code:
Quote

deleted
junk detected

Program Studi Instrumentasi Medis
Politeknik Mekatronika Sanata Dharma
Yogyakarta Indonesia

mem

#101
Jul 09, 2011, 12:37 pm Last Edit: Jul 09, 2011, 12:45 pm by mem Reason: 1
copet_pitik, this thread was reporting a specific issue with the Library so this is not the best place for discussions on help using the library.

I have created a thread for that purpose here and I suggest the we move this discussion there. Can you post a shorter version of your sketch that illustrates the problem so its easer to see if your problem is with Alarms or delays in your code to write to eeprom. It would be easier to help if you can translate comments into english so I can understand the purpose of each of you functions. A summary of the purpose of your sketch and overview of the logic you used to implement it would also help in understanding what your sketch is doing.

Michael

copet_pitik

#102
Jul 09, 2011, 03:18 pm Last Edit: Jul 09, 2011, 07:01 pm by copet_pitik Reason: 1

copet_pitik, this thread was reporting a specific issue with the Library so this is not the best place for discussions on help using the library.

I have created a thread for that purpose here and I suggest the we move this discussion there. Can you post a shorter version of your sketch that illustrates the problem so its easer to see if your problem is with Alarms or delays in your code to write to eeprom.

Michael


^_^ wokey ^_^
Program Studi Instrumentasi Medis
Politeknik Mekatronika Sanata Dharma
Yogyakarta Indonesia

arios85

Hello, I was wondering if an example could be done that displays all of the alarms at once without using the triggered command and using the read(AlarmID_t ID) method. I just cant seem to be able to get multiple alarms to display their time and that isn't triggered by its own alarm but rather a different alarm solely dedicated in collecting all the alarms at once and printing them. Using the read command from the library, I thought would be able to do this, i just can't figure out how.

Go Up