Winter 2010 CPEG Fun

We're not doomed after all

So cattykid figured out everything and didn't need anyone's help like he said. Yay! Well I did get him a serial to USB cable so he could finally test stuff out. Gotta do more work tomorrow though in putting the whole project and a presentation together.

· 2010/02/01 23:12 · ketty

IR Trip sensors are working but again, the project is still not packaged together

cattykid got the IR trip sensors to work to up to a distance of 2 meters. W00t! However, he still didn't get the python script to work. He thinks it's just adding one line of code and I'm wondering why he's not adding that one line of code and testing it instead of focusing on other stuff like the IR trip sensors. Even if we have like 10 different sensors all working, without a master control and update code running to tie everything together, the different sensors are useless.

I can't wait to get this paper done so I can go look at the code because this is making me anxious. Without a working code, we'll have nothing to show people.

Nothing's pulled together still...

afterburn suggested using a python script to read form the serial port and update the website, so cattykid decided to do it using the logic code he's written (for the microcontroller) and a python script he later wrote. So yesterday he was testing the code and couldn't get it to work because he couldn't get his python script to take updates of the data, or maybe it's both. I asked him if he wanted any help, but he declined.

That's unfortunate that he doesn't want my help because I've tested the PIR sensor and the reed switch using a different set of code I've written for the microcontroller and blackthroat and I successfully simulated the turning off of a light using the on board LEDs so I know my code will at least update sensor statuses successfully. Even though my code works, cattykid probably will still end up using his own code because he wants to do things his own way. I don't really mind if he wants to do it all himself but if he wants to do it he should realize we only have a couple of days left to get a working prototype. I'm getting annoyed that so far his code still isn't working not to mention not tested at all.

There's other bad news as well. Our amplifier part didn't come in so blackthroat can't work on it. The IR trip sensors don't seem feasible now either because the dining hall group can't get them to work properly and we had counted on them to get them working. =(

I have an english paper to write now so I don't have time to look at the coding stuff, but by tonight if cattykid still hasn't gotten his code to work, I'm going to take a look at it myself and try to get it tested and working.

· 2010/02/01 19:33 · ketty

I can't put a problem down until I solve it. =/

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!!!

Not the solution I was looking for but it'll have to do...

So I was trying to find a serial port logger that would include a timestamp with each line of text. Couldn't find one. I did find some embedded systems code written in tcl/tk that does what I want but I think it's a nasty approach to solve the problem. I don't want to go out of my way to learn some new language to do something so simple.

teknick suggested I should just use the microcontroller's RTI to keep track of time and he even provided code on how to do it. My only worry was that each time the microcontroller is powered off, the time would be reset. Then I realized, it's not absolutely necessary to report an absolute time in the log. I can just report a minute count relative to instant that the timer started for testing purposes. If I wanted an absolute time later for reporting status on the webserver, we can just configure the server to add in a time stamp at time of its update. This of course would be more coding later on and the team probably won't be able to get to that point by the end of this week.

So tomorrow, my goal is to get a relative timer working and set up the sensors in the room and start collecting some data.

 
Back to top
users/ketty/blog.txt · Last modified: 2010/02/01 19:33 by ketty
 
 
chimeric.de = chi`s home Creative Commons License Valid CSS Driven by DokuWiki do yourself a favour and use a real browser - get firefox!! Recent changes RSS feed Valid XHTML 1.0