We got back from DefCon last weekend. Our Sentry Gun didn't do very well (tied for last place), but the trip was a lot of fun overall. We knew before we went that we weren't going to win, so coming in to it with that mindset made it a lot more enjoyable.
The robot was mostly finished a few weeks before the competition, which was good compared to the 30 pound combat robot where we stayed up until 2 am the week before the competition and barely finished a functional robot in time. This was also nice in that Joe was going to summer school every weekday, so the only time we could work on it together was on the weekends. The biggest part remaining at that point was just optimizing the software, which I could do during the week and then do minor changes to the gun itself during the weekend, like getting a single power supply with appropriate connectors rather than having 3 separate batteries with alligator clips to power the gun.
There were a few hurdles we had to overcome to make the gun function properly. Originally the intent was to have a single fixed camera, and calibrate the gun based on that. However, the servos aren't very accurate when commanded to go to a particular position from another. Going to position 2000 from position 2300 was up to a couple inches off from position 2000 from position 1800. It was possible to change it so that we could manually make it go to the same spot from different approaches (instead of 2300 -> 2000 -> 1800 -> 2000, we did 2300 -> 1992 -> 1800 -> 2008), but after running the gun for a while, what was working a half hour ago to make the gun go to the same position, doesn't work now (now required 2300 -> 1990 -> 1800 -> 2010). To solve this, Joe glued the camera on to the gun itself, and I modified the algorithm to use this. The down side to this approach though is it takes a lot longer to go to a particular position because it has to move, then see where the target is, then move closer, then see how close it is, then finally move again and then see that it's in the right spot.
Another problem we were having was due to the way the gun was created, in that there is a servo that pushes a switch that triggers the air valve. Occasionally the solenoid in the valve triggering would cause a big EM pulse that messed up the USB <-> Serial converter we were using, requiring it to be unplugged and plugged in again. However, this happened when the servo was contacting the switch, so the valve was stuck open until the serial port could be reattached and the servo moved away from the switch. Luckily this didn't happen at the competition though.
The weekend before the competition we created a facade for the gun to make it look like a sentry gun from team fortress (well, Zach and Joe did; I mostly watched). The original plan was to make it out of pieces of plastic, but when we actually started to mount all of the parts it was way too heavy for the servos, so they decided to make it out of cardboard instead. It turned out really nice for being made out of cardboard.
The trip to Vegas was pretty nice. All three of us bought a Nintendo DS and Mario Kart DS before going and we played that on the airplane. I still don't like Southwest though, as the boarding procedure is what my family calls a "Cattle Call" to find seats. We found 4 seats near each other, and someone with a shirt that was something like "I've got the root password to your box" sat down next to Joe and Jamie. I commented that I bet he was going to Defcon too, and it turned out that he was.
We arrived Friday morning and Joe and Jamie went to get the air compressor and pick up the package from the hotel while Zach and I went to a talk on SQL Injection and out-of-band channeling. We got there late so we missed the introduction (luckily I knew what SQL injection was already, but Zach didn't). It was a very neat attack as it allowed data to be leaked out of the SQL server than would be allowed in a normal SQL injection attack, and in places that injection wouldn't even allow data to get out of the system. I'm trying to be vague here as not to confuse, but suffice it to say, I was pretty impressed with it.
After the talk, we met up and assembled the gun and took it to the practice area. It was both nice and awkward carrying the gun down the hotel lobby, as some people were like "woah what's that, that's cool" while we were walking down the halls, and then there was hotel security I was wondering what they were thinking. They didn't say anything though, so we proceeded to the practice area. We did a bit of firing and tuning to get the system to work a little bit better. When we were satisfied that it would knock down the targets, we packed it up and took it back to their hotel room.
Then Zach and I went to another talk about how to use FPGAs to speed up brute-force attacks. I was thinking it would be more of an introduction to them, and how they worked, but the speaker just skipped over that because "a lot" of the audience had seen his previous talk(s) (it was about one in four), so the talk was mostly "Here's me running this code on my laptop.. look how slow it is. Here's me running it on the FPGA.. look how fast it is," and the different things that all used the same kind of encryption (Bluetooth, and a few others). After that we went to a talk on how to hack the ECU on a car. It was a really interesting talk as he talked about the different settings in them, and the history of the different ways to do it: purchase a completely custom one, fake out the sensors, or reflash the current one, with the reflashing being the current method. He also explained what the different kinds of things meant, like the fuel mixtures at different RPMs and loads, and had a few analogies to the Dukes of Hazard. I think Zach liked that one the most, as he could relate to it the most.
After that Zach and I did a bit of walking down the strip (Joe and Jamie were already down the strip somewhere when we went to the talk). On the Defcon web site it said that Las Vegas is hot, and they were right. Even at 9-10 pm it was still hot enough to sweat. It was nothing like Sacramento where it gets cool in the night. We were hungry so the first stop was to get some food. Originally I wanted to go to Dennys, but we decided to see what else was there. We ended up making it to a place called "Strip Burger" which was on the Strip (not because they had strippers; I was slightly disappointed that there weren't). The burger was pretty good, and I got a raspberry something on the waiter's suggestion (it had mint leaves in it, which was slightly disturbing). Then we went and saw one of the shows on the road with a siren ship and a pirate ship - apparently women can cause another ship to sink simply by dancing in the show's alternate reality. It was incredibly cheesy and we didn't have a good view. We continued on and went into Caesar's Palace and saw a bunch of stores that sold things which we couldn't afford, and one of the talking statue shows. The animatronics were pretty neat. After that, we decided we would each get one of the "Yard Long Margaritas" or something to that effect (I think it was 40+ oz), and proceeded to drink most of them before getting back to the hotel.
On Saturday we went to the contest area again and set up our gun for the contest itself. In our first round we went against the winners from last year. Our gun had only shot down one target before they got to their last target, but their gun jammed and we managed to shoot down 2 more before they got their gun un-jammed and finished off the last target. Our second round we went up against a two-gun team that didn't seem able to hit targets by aiming at them, so it just sprayed bullets everywhere, and they managed to knock down more targets than us, so they won, even though we were 100% accurate. There was supposed to be black targets to discourage this, but there weren't any so they took advantage of that and beat us because of that.
Zach and I went to a few more conferences on Saturday. One was about how the radio signal used to tell GPS devices of road conditions works, and how to broadcast it. It was a really nice talk because the presenter was a good speaker and pretty funny to listen to. One of the things he mentioned was how it's possible to send fake alerts to a particular car that says there's a road is closed because of an air raid, or maybe bull fight instead (along with a bunch of other reasons). The next talk we went to was about identification devices (like smart card readers, fingerprint scanners, etc) to get in to buildings, and how easy it was to hack them (essentially unscrewing the plastic cover and installing a "tap" on it by cutting a few wires). He gave a nice demonstration of the device he made and how it worked. This speaker was a very good presenter as well and very funny.
On Saturday night we went and saw Penn & Teller at the Rio. We took a taxi from the Riviera to the Rio (which was my first time taking a taxi actually) and made it there about an hour ahead of time. Originally we were going to take the bus, but we didn't realize how long it would take. We had pretty good seats: close to the front row of the balcony, right in the middle. The show was as amazing as I could have hoped for; with the exception of one or two parts (I'm not really interested in juggling or fire-breathing).
On Sunday, we didn't see any more talks and instead went to Denny's for brunch, then took the air compressor back and then headed off to the airport. I originally wanted to have a later flight because I wanted to stay a little longer, but I didn't really feel like staying there by myself, so I went with them to the airport and just played my DS while I waited for my flight. It would've cost like $200 to move my flight up, so I decided it wasn't worth it and just waited a little longer.
Overall the event was a lot of fun, and we're definitely going to do it next year if we can. For our next gun we're going to try to build it with a more reliable control system (stepper motors most likely) and probably a gun that doesn't need to be calibrated, but rather just works, so probably something powered solely with air to fire and load the next pellet. I have a few ideas on how that's going to work. Also Joe is looking in to another camera, even though the one we have worked pretty well. I think the main upgrade would be a cleaner image and a controllable zoom so that we're not wasting 75% of the camera area on the surroundings of the arena.