» pages: blog | About Me | projects | Resume |

wind-powered wifi AP repeater

projects, wind power — davidb — April 22nd, 2008

I can not really take credit for this one, but a couple weekends ago I helped a friend of mine, Dan Lampie, set up a wind turbine here at RIT (check out his website for more details). Dan has been talking about/working on this project for about a year now (well, he started it last year at least). Last summer he sent me a couple of pictures of the turbine set up in his backyard. It was more or less the same set up that he has now, only the previous iteration was just being used to power a light bulb (and to measure what kind of power it can supply). Dan built the whole thing himself along with a bit of advice from a professor and some internet forums. It is quite impressive and (at least to me) surprisingly not terribly complicated to do.

He wanted to set it up at RIT for Imagine RIT: RIT’s Innovation & Creativity Festival (on May 3rd, if you are in the area, check it out). After about half a year of red tape and bureaucracy (literally 100s of emails), he finally managed to get RIT’s permission to install it on campus. Dan drove up for the weekend from Boston (where he’s currently interning at Cisco) and asked me to help him set it up. We took a bunch of pictures, so here’s a few. This first one is after we got most of the stakes down, when we were installing the turbine itself onto the post.

Ataching the turbine to the post

I’m the one with my back turned to the camera, Dan is in front of me, and Chris (who also offered to help) is the one in the brown sweatshirt.

Almost there..

The next step was just to stake everything down. You can’t really tell from the picture, but the ground was extremely wet as it had been raining quite a bit. The stakes went in rather easily, but we were covered in mud by the time we finished.

Electronic guts. Two 12V batteries and a circuit to limit the charge

This picture shows the electronics that make the whole thing work. Dan built the charging circuit himself. Essentially the windmill recharges two 12V batteries and the circuit exists to make sure it does not over charge them. The wireless AP/repeater (not in the picture) is connected to the battery terminals. We “waterproofed” it using plumber’s putty, the platic tuperware box, and that metal box that Dan got off ebay). It is not exactly environmentally tested, but the components are rugged enough that they should be fine even if a bit of water gets in there from humidity/condensation.

The finished product

There’s Dan standing proud with his finished product. As you can tell from the picture, when there’s a big gust the blades spin pretty fast. Standing right underneath it was kinda scary, but it is very stable. The location is not ideal for a wind turbine because the trees/buildings shield it from the wind, but it still works. The building behind him is Gracie’s (the main RIT cafeteria on the dorm side of campus). The turbine’s AP gets the wifi signal from there and then broadcasts it down the “quarter mile” (RIT’s main walkway from the dorm to the academic side of campus). We haven’t done too much extensive testing of it, but it does work. Dan will probably be up here before the festival to do a bit more tweaking of the project. It’s certainly cool and goes along with the seemingly “new trend” of eco-friendliness/”going green.” If you are interested in doing something like this yourself, there is a vast amount of resources online (search diy wind turbine) or contact me and I can get you in touch with Dan.

my router plays music!

projects, wireless boombox — davidb — April 17th, 2008

I think I mentioned this project in a previous post, if not here it goes: I plan to make a wireless, portable internet boombox from a bunch of parts I scrounged up/have had lying around my house for a while. I bought a Netgear WGT634U wireless router off of ebay for ~$30. The reason I went for this particular model is that it comes with a USB port on the router itself. This was really useful since it allowed me to buy a cheap USB sound card off of ebay (~$5). This, combined with an old Magnavox boombox that I have had for years, will form my wireless boombox. My goal is to have it be completely battery powered, but that may not be 100% feasible.

As soon as I got the router, I spent a few hours installing and configuring/playing with OpenWRT. Unfortunately the sound card shipped from Hong Kong, so I had to wait about a week for it to get here. It finally arrived yesterday and as soon as I got a chance today, I hooked it up and started streaming my music over the air.

Wireless Boombox

There’s a picture of the setup I have so far. I took the top of the router off to start messing around with it and haven’t put it back on yet. That little thing jutting out of the back of the router is the USB sound card. The boombox does not have an aux in port, so for now I ripped apart a really old pair of head phones and attached the leads to the tape deck head. I don’t have long enough screwdrivers to take apart the boombox yet, but once I do I plan to take out the electronics for the cd player and enclose the router in the boombox. Also, I will attach the headphone leads more permanently (likely replacing the cd player module’s connections). The other thing I need to do is find an appropriate battery to power this set up as I would really like it to be truly wireless.

Once all of that is out of the way, the only thing left to do is to figure out how to control the thing. I plan on using mpd/mpc for the music player software, but having to ssh to the boombox to get it to play music somewhat defeats the purpose. The router does have a serial console port, so I may end up wiring the buttons on the boombox to change the song and use a c program to monitor it and trigger the appropriate mpc commands. Another option/additional feature might be setting up a very simple webpage that I could view from my phone that displays information about the current song and allows the various playback controls. I don’t have one of those fancy smart phones, but my phone should be able to support something like that. Besides that, I could also have a fancier AJAX-y web interface (but again, that seems to defeat the purpose). I am looking forward to finishing this thing up, but I have quite a bit of school work these next couple of weeks so I’ll see how it goes. The weather’s getting nicer outside so I’d really like to get this thing together and use it at a BBQ.

barcamprochester3

barcamp, clubs — davidb — April 7th, 2008

Yesterday I hosted and attended my first BarCamp ever and it was awesome! What is a BarCamp? Basically, it is an “unconference” – an ad hoc gathering of individuals to share knowledge about various topics through presentations. The key – every one is a participant, no spectators. To be honest, I was more than a bit skeptical at first, but I could not be more pleased with the event. It was great. But before I get to the details, I want to thoroughly thank all of our sponsors that helped us out this year (clearspring, IEEE Computer Society, Computer Science House, RIT CS Department, HTB Press, Microsoft, and Google). We could not have done it without them and hopefully they will all continue to support events like this.

The most import thing about a BarCamp, however, are its participants – ours were amazing! We had presentations on just about everything. Just a little sampling: political lobbying, intellectual property, jQuery, 3d user interface design, robotics, multitouch, network security, OpenID, CPU Design (me!), the future of RF technologies, shellcode exploits, telephone-controlled web applications, board game strategy, One Laptop Per Child Initiatives at RIT (me!), XSLT, Grid Computing, and all kinds of other cool stuff. I learned a lot about a bunch of cool new stuff that people are working on, but my favorite part was all of the discussion that occurred. The level of participation and interaction between the presenter and the attendees for each of the talks is what made this BarCamp such a success. You could tell that everyone was legitimately interested in what they were there to hear about (even if they had never heard of it before!). A lot of the talks turned into more of a discussion of a topic than a simple lecture with a question and answer session, which really is the ideal format for this conference.

If you have never experienced a BarCamp before, I encourage you to give it a try. How can you go wrong with a bunch of smart people with a desire to learn and share knowledge? To give you more of an idea of what it was like, check out some of the pictures from this year and last. Not everyone uses flickr, so if you have a facebook account, roam around there and you should hopefully find some more pictures.

After such a great experience, I am looking forward to planning and hosting the next BarCamp. I liked it so much, I’m going to try to put together two of them next year – one in the fall, and one in the spring. So, be on the lookout for BarCampRochester4 and 5. If you are interested in helping out, shoot me an email! Again, thanks to the sponsors and the participants for making this such a great BarCamp!

a new quarter

clubs, projects — davidb — March 17th, 2008

This past month, specifically the past few weeks, has been rather busy for me. It’s the beginning of yet another quarter at RIT and I have an overwhelming feeling of relief. I decided to take on 20 credit hours last quarter. I did quite well (all A’s), but I don’t miss that feeling of always having some homework assignment, project, or paper looming over me.

This quarter I should have a lot more free time since I decided not to continue working as a grader. That said, I am going to spend this free time doing the numerous projects that I have wanted to finish up/start. I am really excited about this because I have been wanting to finish these projects up for quite some time. To start with, I have decided to work with a friend of mine, Heewa Barfchin, to start up a few new initiatives here at RIT.

There has been a lot of talk recently about the One Laptop Per Child project. After looking over the current state of the project, it is fairly evident that there is still an unmet need in the amount of software that has been ported to/created for it. There are a number of project ideas that I have related to this project, so Heewa and I decided to try to get the RIT CS department involved in OLPC. So far, we have a couple of professors interested in the project and now the ball is in our court. We plan to develop a fully-functional application by the end of the quarter that can be used as a “prototype” to showcase the potential of the project at RIT and potentially establish an OLPC lab at RIT.

Another idea stemmed from discussions with Heewa has brought light to a new club, the Society of Lectors. Check out our Google Groups page. Essentially the idea is to encourage collaborative education. It is impossible to learn every thing you need to know to be successful in your field by just going to your classes. A lot of my friends have specialties in a lot of different areas. Not only that, but sometimes I am not able to take a class on a topic I may be interested in. So, we decided to start a club that meets weekly and allows its members a venue to lecture one another on a topic of each individual’s choice. This society is not at all limited to RIT students. We encourage anyone to stop by and listen or to even give a presentation. Students, professors, industry professionals, researchers, community members, visitors to the area, etc. Our first meeting is this Wednesday. All the information on the meeting is available here.

In addition to all of that, I plan to develop a few individual software and hardware projects of my own. More on that will come as the ideas are further developed and realized. Though, I’ll mention one of them – I have an old wireless router and boombox that I plan to combine to make a portable wireless mp3 player.

Oh, one more thing – BarCampRochester3. If you don’t know what a BarCamp is, go check out the wiki. I agreed to help co-host the event this year at RIT (handling the finances and filling in wherever else). BarCamp is an excellent, unique opportunity to meet up with some cool people and discuss a large variety of topics. The idea is very similar to the Society of Lectors – a collaborative exchange of knowledge. Essentially it is a day full of presentations; the catch is you are not only an audience member, you are a participant. I’m really excited about this year’s BarCamp. The date is set for Saturday, April 5 10am until end in the Golisano College of Computing and Information Sciences at RIT. Check out the wiki page for all the details. Hope to see you there!

why seg-fault? (etymology)

programming, segfault, x86 — davidb — February 4th, 2008

If you have ever programmed in C or C++, then you have likely run into a situation where you have received an error message like this:

$ ./runmyprogram
Segmentation fault
$

SIGSEGV, our favorite POSIX signal! Hopefully, you know what that means and why that happens. Coincidentally, I was asked this question just the other day (at a party no less) and figured I would share my insight. So, if you don’t know what a segfault is, I’ll hopefully shed a bit of light on the situation – essentially you messed up with your memory management. Somewhere in your program you decided to access memory that you do not have access to or you tried to access memory in a way that is illegal. You used a null pointer, used an un-initialized pointer, tried writing to read-only memory, tried overwriting another program’s (or the operating system)’s memory, etc. Essentially, you were a bad boy (or girl) and made the poor little CPU/Operating System angry. Segfaults can be really easy to debug, but usually it takes at least a bit of digging. Fire up your favorite debugger and go to work.

But wait a second, why is it called a Segmentation Fault? What does that even mean? By just dissecting the word, it is apparent. If you know a bit about the CPU architectures, you’d know that a fault is an exception thrown by the processor and that segmentation is a memory model that divides the address space into separate regions. Essentially, as mentioned before, you messed with a segment that isn’t yours to mess with. Segmentation is an older memory model originally introduced to the x86 architecture in the late 70s. x86 has since been expanded to support “multi-mode operation.” Segmentation is still supported in x86, but using strictly segmentation is a thing of the past that is rarely done in execution of modern programs (generally speaking). Instead, a flat memory model is used. Technically segmentation is still in use, but because the segment bases are treated as if they are zero and the limits are ignored, the segmentation mechanism is essentially disabled. Paging is used to enforce the protection limits on lesser privileged software and to allow the use of virtual memory. It should be noted, however, that in 64-bit mode segmentation is disabled.

The point of that blurb is this – since we are not actually using the segmentation model any more, why call it a “Segmentation Fault”? That question I really did not know the answer to (other than the obvious – no one wants to actually change it). The actual x86 exception is (and to my knowledge always has been) called a “General Protection Fault.” Logically, it may follow to just call this error by the x86 exception name. However, x86 is not the only architecture in existence. Other CPU architectures may simply name this fault differently. Thus, it would seem that the term “Segmentation Fault” was coined as it is a more generic and descriptive name. Although the segmentation model is no longer used, calling a region of memory a “segment” is not an invalid statement. So, the term lives on to continue to annoy programmers (well at least those programming on POSIX systems). Windows has dubbed the signal “STATUS_ACCESS_VIOLATION,” but I am fairly certain the error message is still something along the lines of “Segmentation Violation.”

code style

code — davidb — January 31st, 2008

This quarter I started grading for a couple courses at RIT in the Computer Science Department. Coincidentally, I was also exposed to some of the ugliest code that I have ever seen in my life. The projects/labs that I grade are written in C/C++: two languages that make it easy to do the wrong thing (when you don’t know them). A combination of a lack of understanding of the language/syntax, a lack of exposure to proper style, and waiting until 11:59PM to submit what you’ve got before your midnight deadline has really broadened my horizon as to what bastardizations of style can occur. It really has taught me a lot. I already know the importance of comments, proper indentation, and producing readable, maintainable code, but nothing really reinforces that as much as if you were asked to analyze someone else’s poorly maintained code.

I’m almost done with my job as a grader for this quarter, so I feel like it’d be a good time to reflect a bit on what makes code good or bad. Good coding style means it is easily humanly readable, well documented/commented, and efficient. If you don’t know how to do something or know you’re having problems with a particular function/block of code, throw a comment in there to that effect and describe why it fails/is a hack/is iffy at best! It’s ok to leave debug code in, but surround it in #ifdef’s and document that as well – at the very least, note it as being for debug. You can take that a step farther by actually documenting what your debug code is doing. Sometimes, you just can’t get a solution (run out of time, bad day, too complicated of a scope, etc). That’s ok with me, but at least explain your thought process. Sometimes that’s interesting to see – maybe I can give you some points because you were on the right track but just don’t have enough exposure to the language. Take this for example (I did actually receive a submission quite similar to this):

 1 //getValues(**a, **b, &c); DIDN"T WORK!!!!
 2 //getValues(**a, *b, &c); DIDN"T WORK AGAIN!!!!
 3 //getValues(*a, *b, &c); BAHHHHHHHHH WHY>
 4 //getValues(a,b,c); i don’t get it. why god, why?
 5 //getValues(a,b,&c) JUST GIVE ME THE DAMN VALUES ALREADY!!!
 6 //giveUP() - sorry… please don’t take points off :) 
 7 //The use of this function doesn’t really have anything to do 
 8 //with the course material. This is just a stupid c function. 
 9 //I understand the course
10 //... [clip]

So, please, use good coding style for anything you do. Comment the heck out of your code. Another thing I highly suggest – actually look at the compiler’s output. It will save you a lot of headaches if you just suck it up and read it.

my new domain name

Uncategorized — davidb — January 31st, 2008

So, it’s about 4:00AM, I have a midterm in 6 hours, and I just finished setting up my domain. I had been meaning to buy one for a while now, but apparently David Brenner is a common name. Not only that, but I share my name with a semi-famous comedian. Notice the semi-famous part. He was voted #53 on Comedy Central’s Top 100 comedians, which apparently means approximately 1 out of every 100 or so people that read/hear my name decide to ask me, “Hey, are you related to that comedian?” and the other 99 have no idea that another David Brenner exists.

That said, I had the opportunity a few years ago to take davidbrenner.com, but I didn’t. What a shame. This is just about the only combination of my name available. I just found out it was available a few days ago, so I decided to go ahead and buy it. So, here it is.

« Previous Page
(c) 2010 david-brenner.net | powered by WordPress with Barecity