After the fail with tech inside the cat coat, Gene decides to give Arduino a shot due to the right form factor and sufficient functionality – read how it went.I was talking to my friend Bill about this, and he laughed. He said: “Why don’t you try Arduino? It’s a small form factor, low power consumption, does exactly what you need – no more no less, and there’re all kinds of chips and solutions out there.” My first question was: “What the hell is Arduino?” It turns out Arduino was a project by some researcher in Italy. It was his master’s thesis. The idea is, like, there’s open source software out there, so why not open source hardware? It’s really cool, it comes in a small chipset, they can stack them on top of each other (see rightmost image above). There are lots of expansion shields. You can make robots, remote control cars, etc. This guy (see leftmost image above) used it to check the food in his freezer. This guy (see middle image above) puts the glove on, he moves the glove, and the robot hand moves. This guy (see rightmost image above) used it to cheat on his video games. It’s a really small form factor (see right-hand image).
The good news with Arduino is it’s open source and relatively inexpensive, until the cat starts losing it and you have to buy nine of them.The bad news is it’s sometimes poorly documented, and it can take forever to get to you if it’s an expansion shield; and questionable performance sometimes.
Well, okay, cool, that’s great, but I’ve never done anything with Arduino. I’ve never worked with small firmware, chipsets or anything like that. I’m not a professional coder. And I’ve never soldered before. And my friend says: “Don’t worry, it’s easy!”So the plan (see right-hand image) was to get some basic Arduino stuff, decide on the most accommodating form factor, put it all together in a collar, and then figure out something for the Denial of Service Dog. So I went out and I bought the how-to book on the Arduino stuff (see leftmost image below) that came with an Arduino Uno – a whole bunch of guides, a whole bunch of learning and reading up on engineering and electronics and stuff. I get the flashy things flashing when they’re supposed to flash, and the non-flashy things not flashing when they’re not supposed to flash.
So I started, okay, I’m ready to go get the more advanced stuff (see middle image above): I need libraries for WiFi – they got it; GPS – they got it; SD card stuff – they got it. Fantastic! Let’s get a little bit higher now. Jeremyblum.com has a lot of videos on making these things work (see rightmost image above). So now I did all my research and background investigation, and I’m now an expert!
So I went out and I got a WiFi Shield (see leftmost image above) and I got a GPS Shield (see middle image above). The plan I had now (see rightmost image above) was to get the WiFi collecting stuff and writing it to an SD card, get the GPS stuff writing to an SD card, combine the two – and then profit.
The WiFi Shield was really cool. It was easy to set up; drivers worked right away – it was even talked about on the Arduino website. Messing around with some parameters and variables, and I’ve got my solution right there for that. That was easy!GPS – not so much easy (see right-hand image). The NMEA string is what satellites are broadcasting out there, stands for National Marine Electronics Association. This comma-separated value right there is what the satellite is actually sending out. The GPS boot process is it starts up and it doesn’t know where it is on the planet – it could be your back pocket, it could be in Timbuktu. So it has to listen to space, get at least three satellites listening to figure out the NMEA string. This whole process can take 2-15 minutes, and if somebody is looking over your shoulder it’s going to take 15 minutes. The GPS Shield was rather poorly documented (see right-hand image); there were no docs, really, in the kit; and it took me a good several weeks of “What’s wrong with this? Why is it not working?” Finally, at the really long end of the research effort I found out that the baud rate is supposed to be 34800. And I wanted to get some demonstration of how it was poorly documented, but now I go online and I can’t NOT find that the baud rate is 34800, I don’t know why.
So I put all the components together (see leftmost image below). The WiFi Shield, as you see, is sitting on top of the Arduino. The GPS Shield is off to the side because I wanted to reuse some of the pins. And so, I put this all together and I combined the code strings, and I got this weird error about 80% memory utilization (see middle image below). And I’m like: “I see that on the news all the time; blow it off, go for it!” And after a little while I was like: “No, they were telling me the truth – with 80% memory utilization the chip can’t work anymore.” There’s only 32K of memory on an Arduino Uno. The Arduino Mega, however, has 256K of memory.
So I purchased the Mega, put that all together (see rightmost image above), played around with some variables, did some stuff – and woohoo! It works! Now I have a working prototype. So, the Arduino Mega 2560 is mo memory – mo betta; mo ports – mo betta; but mo size is not mo betta.So I searched all over the Internet trying to find something that says “Tiny Arduino 2560”, “Tiny Duino 2560”, from JKDevices.com (see leftmost image to the right). JKDevices.com is a complete rebuff, and I told them I was going to mention that during my talk. They never sent me my stuff. So, Defcon now knows about that. But I didn’t know about that at the time, so now I need a WiFi chip, the Adafruit WiFi chip breakout board right there (see rightmost image above).
Read previous: Weaponizing Your Pets 2: Better Luck Next Time with the Cat