I mentioned yesterday that teknick gave me idea on how to log a time using RTIs in the microcontroller. Well I ran that by cattykid later and he dismissed it. In fact, he didn't see why timestamping events was even necessary. He insisted on saying that if we absolutely needed a timestamp on events we should timestamp using the host computer by updating the room status on an interval (whether it be every 5 minutes or every 1 minute). He then begin working on a C++ program that would create a html file and update it periodically.
It's good that he created a program that would format the data into an html file that could be displayed on a webpage, but I was frustrated how he doesn't think event triggered timestamping was important. I told him one of the reasons why I wanted to do event triggered timestamping was to leave the microcontroller in a room for a day and update on status changes and I wanted accurate timestamps of when people leave and enter the room to make sure the sensors weren't going off at 3 in the morning. He suggested just checking the minicom log file every minute (without knowing whether the file would be updated not) and updating the current status that way. Although that's a simple way to do the task through loops and file I/O, that's also rather inefficient for collecting useful data. What if there were no room changes for 10 hours? I don't want minute updates of the past 10 hours only to find nothing in the room has changed. That's constant recording and checking instead of recording only when necessary. Also, the way his code was working, he was reading from one log file and putting data into another file, which can lead to problems if the file with the data goes missing or more than one line of data was generated since the last update. In other words, cattykid's simple method could not tell him intelligently that the room status was actually changing. I was really frustrated how he didn't see the importance of collecting data for a day to test our sensors (the reason why I even considered timestamping) and also with how he didn't want to take the more difficult approach to things.
So with timestamping in mind and the stubborness to do things the way I wanted, I scoured the net for a way to input timestamps into a log. I finally resorted to scripting with the minicom script interpreter. The script function isn't perfect (it was designed for login scripts) but I was able to use shell commands through the script that updates only one file with the correct timestamp ONLY WHEN AN EVENT TRIGGERS IT. This might've taken me 2 days of research and loss of sleep but I'm satisfied with the solution and it's way better than polling a second file constantly…
OH DEAR IT'S LATE… BED TIME!!!