1 00:00:00,000 --> 00:00:04,300 I'm Philip, also known as Follower, and this is Lee. 2 00:00:06,560 --> 00:00:09,460 Physical computing. Who here is familiar with the term? 3 00:00:12,900 --> 00:00:14,280 I take that as a no. 4 00:00:14,640 --> 00:00:20,640 Physical computing is the idea of taking computing power and taking it away from the box. 5 00:00:20,820 --> 00:00:24,160 So instead of having a box with a monitor and a keyboard and a screen, 6 00:00:24,160 --> 00:00:31,240 you have some other device that looks different and, like this, may look slightly more friendly. 7 00:00:31,500 --> 00:00:34,000 This is an example of a project called Momo. 8 00:00:35,900 --> 00:00:40,180 Momo has the ability to tell you where to go. 9 00:00:40,520 --> 00:00:43,900 It has a home programmed into it, and it finds its way, 10 00:00:44,040 --> 00:00:49,920 and the way that it directs you is that it tilts its head to point you in the direction that you need to go. 11 00:00:50,640 --> 00:00:53,800 This is an example of a physical computing project, 12 00:00:54,160 --> 00:00:58,860 that is able to create an emotional connection with the people that use it. 13 00:00:59,400 --> 00:01:04,580 For example, when was the last time that you saw someone snuggling up to their Garmin GPS device 14 00:01:04,580 --> 00:01:06,620 and go, oh, a little LCD, how cute you are? 15 00:01:06,760 --> 00:01:11,380 But this is the kind of response that physical computing devices can provoke in people. 16 00:01:13,200 --> 00:01:15,440 Does anybody here read Hackaday.com? 17 00:01:16,780 --> 00:01:19,500 Okay, you've probably never heard of the Arduino before then, 18 00:01:19,560 --> 00:01:20,920 so I'll give you a little bit of an introduction. 19 00:01:21,980 --> 00:01:23,060 This is the Arduino. 20 00:01:24,160 --> 00:01:31,180 The Arduino is an example of a project, which is designed to help people create physical computing devices. 21 00:01:31,580 --> 00:01:39,380 It was originally designed for artists and designers and non-technical users to get into using hardware and electronics. 22 00:01:40,200 --> 00:01:44,660 It was developed in Italy by a group of people at a design school, 23 00:01:44,900 --> 00:01:50,560 and contrary to popular belief, it's not actually named after an Italian emperor, 24 00:01:50,680 --> 00:01:53,080 it's named after a pub down the road from where they worked. 25 00:01:55,680 --> 00:01:59,420 So, we'll have a look at some other examples of physical computing projects. 26 00:01:59,680 --> 00:02:01,320 This is a project called Botanicals. 27 00:02:02,900 --> 00:02:04,380 Anybody here have pot plants? 28 00:02:06,040 --> 00:02:07,380 Are they dead or alive? 29 00:02:09,100 --> 00:02:12,840 So, one of the problems that these people were looking at was people have pot plants, 30 00:02:12,960 --> 00:02:15,000 but apparently they don't know when to water them. 31 00:02:15,240 --> 00:02:20,540 So, with a botanical, you can plug it into the dirt in your pot plant, 32 00:02:20,700 --> 00:02:23,560 and it will tweet you or send you an SMS message, 33 00:02:24,160 --> 00:02:26,100 saying it needs to be watered, and then when you water it, 34 00:02:26,220 --> 00:02:28,860 it will tweet you and say, hey, thanks a lot, and, or... 35 00:02:28,860 --> 00:02:31,540 You're referring to plants in pots, right? 36 00:02:32,120 --> 00:02:32,540 Yeah. 37 00:02:32,700 --> 00:02:34,720 Okay, just making sure on that one. 38 00:02:36,140 --> 00:02:38,480 Yeah, it probably won't work quite so well in your garden. 39 00:02:41,120 --> 00:02:45,760 So, although, to be honest, maybe you should try that and find out. 40 00:02:45,840 --> 00:02:47,240 Maybe there's a whole new market for it. 41 00:02:47,680 --> 00:02:49,600 This is a turn signal jacket. 42 00:02:50,640 --> 00:02:52,420 Basically, when you're riding along at night, 43 00:02:52,860 --> 00:02:54,140 you want to be able to... 44 00:02:54,160 --> 00:02:55,940 show people which way you're turning. 45 00:02:56,200 --> 00:02:58,880 It has little switches at the end of the sleeves, 46 00:02:59,060 --> 00:03:02,120 and you basically indicate which way you're going, 47 00:03:02,300 --> 00:03:06,080 and it will send you your lights one way or the other, 48 00:03:06,140 --> 00:03:07,860 and hopefully people avoid driving into you. 49 00:03:09,920 --> 00:03:12,920 So, these are examples of projects where, 50 00:03:13,080 --> 00:03:17,520 hopefully you'll get the idea that it's no longer about being in a grey box or a black box. 51 00:03:17,680 --> 00:03:20,000 It's about taking some input from the world, 52 00:03:20,180 --> 00:03:21,780 doing a little bit of processing on it, 53 00:03:21,840 --> 00:03:23,220 and then taking some result, 54 00:03:23,220 --> 00:03:27,220 whether it's lighting a light, or sending a text message, or moving a servo. 55 00:03:28,020 --> 00:03:32,020 So, the tools that people are using include the Arduino board I showed at the beginning, 56 00:03:32,200 --> 00:03:34,900 but it's also available in a lot of different shapes and sizes. 57 00:03:35,400 --> 00:03:37,560 This is the Nano, which is a smaller version. 58 00:03:38,260 --> 00:03:40,020 The Mega, which is a bigger version. 59 00:03:41,460 --> 00:03:44,740 And the LilyPad, which you saw in the turn signal jacket. 60 00:03:45,200 --> 00:03:50,280 So, the LilyPad is a little bit different in that it's designed to be incorporated into clothing and fabric. 61 00:03:50,460 --> 00:03:52,140 And it's actually connected using 62 00:03:52,140 --> 00:03:55,460 a conductive thread, which apparently originates from fencing. 63 00:03:56,320 --> 00:03:59,460 That's the sport, not what people do in New Zealand to keep the sheep in. 64 00:04:01,060 --> 00:04:07,180 The project for the Arduino, all the board files are available under an open source license. 65 00:04:07,560 --> 00:04:11,100 So, people have produced clones like this one, which is called the FreeDUINO. 66 00:04:12,380 --> 00:04:15,940 And you can also have bare bones variations as well. 67 00:04:16,740 --> 00:04:21,480 So, the main chip on the board is a chip from a company called Atmel. 68 00:04:22,140 --> 00:04:27,040 You can buy it off the shelf, it's probably kind of $2 to $4, depending on which version you get. 69 00:04:28,160 --> 00:04:32,220 And because of that, you can start from buying an official board, 70 00:04:32,440 --> 00:04:34,640 and that's probably kind of $20 to $30. 71 00:04:34,900 --> 00:04:38,320 And then when you create a project, you can then make a standalone version. 72 00:04:38,580 --> 00:04:42,180 So, that means that you can have just the microcontroller itself. 73 00:04:42,660 --> 00:04:49,020 The Arduino is a really good case study in a successful open source hardware project, as well as open source software. 74 00:04:49,580 --> 00:04:52,120 Despite there being dozens and dozens of different versions, 75 00:04:52,120 --> 00:04:57,360 and different clones of the Arduino, they sell 50,000 a year of the original one, something along those lines? 76 00:04:58,240 --> 00:05:03,340 Yeah, they've sold somewhere north of 150,000 units over the last five years. 77 00:05:05,700 --> 00:05:10,060 So, the Arduino doesn't just consist of the board, it consists of a complete environment. 78 00:05:10,280 --> 00:05:15,980 So, you've got the board, you've got the development environment, which is based on a project called Processing. 79 00:05:16,640 --> 00:05:19,900 It uses Java for the actual software. 80 00:05:20,140 --> 00:05:22,100 But what you write in is a software. 81 00:05:22,120 --> 00:05:23,320 It's a subset of C and C++. 82 00:05:23,720 --> 00:05:24,860 Don't let the Java scare you. 83 00:05:25,100 --> 00:05:26,800 Yeah, you'll never have to touch it. 84 00:05:27,320 --> 00:05:31,820 And underneath it is GCC, which I think is really cool, 85 00:05:32,000 --> 00:05:35,760 because it means that the project's open source, sort of all the way down. 86 00:05:36,140 --> 00:05:42,600 But also, once you learn a little bit at the beginning, you can kind of work your way down through the software stack. 87 00:05:42,780 --> 00:05:47,440 And if you run into limitations going through the easier development environment, 88 00:05:47,700 --> 00:05:51,140 you can drop down to GCC and assembly if you really wanted to. 89 00:05:52,940 --> 00:05:56,500 An example of the code and the language that you use. 90 00:05:56,780 --> 00:06:01,460 This is the first sketch, which is what they call a program in the Arduino world. 91 00:06:03,360 --> 00:06:09,440 Basically, you write these two required functions, a setup function that gets run once, 92 00:06:09,640 --> 00:06:15,420 and a loop function that keeps on running until the power turns off or the end of the world occurs, whichever comes first. 93 00:06:15,760 --> 00:06:17,300 So, watch out around 2012. 94 00:06:18,580 --> 00:06:21,080 You don't want to waste extra battery power if you don't need it. 95 00:06:22,120 --> 00:06:24,460 You'll see that it's very similar to C. 96 00:06:25,460 --> 00:06:30,140 It's got kind of little bits of JavaScript if you're used to kind of using that. 97 00:06:30,320 --> 00:06:31,680 It's a very similar sort of language. 98 00:06:32,020 --> 00:06:36,040 You do have to worry eventually about things like types and memory management, 99 00:06:36,220 --> 00:06:39,380 but certainly starting off, there's heaps of examples that you can use. 100 00:06:39,760 --> 00:06:45,220 The other thing that makes the Arduino environment powerful is that there's a lot of third-party library support for it. 101 00:06:45,780 --> 00:06:52,100 So, that means that a lot of your projects can really take a library from somewhere that deals with one aspect of it, 102 00:06:52,100 --> 00:06:55,800 and a library from another area, and then just pull them together with a little bit of glue coat. 103 00:06:58,320 --> 00:07:00,840 So, you're not limited to just the board itself. 104 00:07:01,440 --> 00:07:04,780 There's a whole range of expansion shields that are available. 105 00:07:07,280 --> 00:07:09,320 Ethernet gives you a wired Ethernet connection. 106 00:07:10,600 --> 00:07:18,720 It has a hard-wired TCP IP stack on a chip, and there's basically a socket stable interface that's been written to it, 107 00:07:18,780 --> 00:07:20,900 and then there's another library over top of that, 108 00:07:20,900 --> 00:07:22,620 which makes it easier to access. 109 00:07:22,880 --> 00:07:28,680 So, you basically can make a call out and to retrieve, make a client connection or act as a server as well. 110 00:07:29,020 --> 00:07:30,400 It's quite a powerful solution. 111 00:07:30,580 --> 00:07:35,360 You can have up to four hardware connections at a time, or three hardware connections, 112 00:07:35,500 --> 00:07:38,720 and as many software connections as you care to implement. 113 00:07:39,520 --> 00:07:45,660 And it goes down to Mac-level access and obviously other protocols you can implement on top. 114 00:07:47,300 --> 00:07:49,520 GPS, which will tell you where you are. 115 00:07:49,940 --> 00:07:50,880 Unless you're inside a building. 116 00:07:50,900 --> 00:07:52,520 In which case, it won't. 117 00:07:53,560 --> 00:07:56,600 And there's a lot of solutions available. 118 00:07:56,820 --> 00:08:01,920 This particular board you can plug different GPS modules in depending on what your requirements are. 119 00:08:02,820 --> 00:08:11,420 You can also have cellular connections, sending SMS messages, making data connections and so forth. 120 00:08:12,920 --> 00:08:19,480 And also micro SD, which gives you the ability to have large amounts of storage. 121 00:08:19,480 --> 00:08:23,100 So, on the Arduino chip, or the chip used on the Arduino, 122 00:08:23,420 --> 00:08:28,660 you've got 32 kilobytes of program storage space and 2K of RAM. 123 00:08:29,220 --> 00:08:34,480 So, no Windows 7 installed, but you can kind of reduce your target a little bit. 124 00:08:34,660 --> 00:08:36,280 You can do a lot in that space. 125 00:08:36,480 --> 00:08:41,540 One of the projects I'm showing a little bit later is using maybe two-thirds of the available memory. 126 00:08:41,760 --> 00:08:43,980 And it's a reasonably sophisticated project. 127 00:08:44,200 --> 00:08:47,040 So, don't let those numbers put you off. 128 00:08:47,040 --> 00:08:49,440 It's more like back in the 80s when you could do a lot. 129 00:08:50,780 --> 00:08:52,140 Also, Wi-Fi modules. 130 00:08:52,360 --> 00:08:53,700 This one's called the Wi-Fly board. 131 00:08:54,780 --> 00:08:58,380 And it can connect over secured and insecure networks. 132 00:08:58,660 --> 00:09:01,020 It supports up to WPA2 and so forth. 133 00:09:02,500 --> 00:09:04,200 So, one question you might have is, 134 00:09:04,340 --> 00:09:09,260 OK, so if I'm going to get started with this, why should I get started with microcontrollers 135 00:09:09,260 --> 00:09:15,400 rather than using, say, an embedded Linux board or a plug computer or something like that? 136 00:09:15,400 --> 00:09:19,040 Basically, you're going to have a trade-off between three factors. 137 00:09:19,540 --> 00:09:22,080 One of them is the cost. 138 00:09:22,440 --> 00:09:28,000 You've got the option to buy an official board, which, as I say, is about $20 to $30. 139 00:09:29,500 --> 00:09:33,140 Or you can buy one of the knock-offs, which is kind of somewhat less than that. 140 00:09:34,380 --> 00:09:39,140 You might get a more powerful system if you buy, say, a plug computer or something like that. 141 00:09:39,360 --> 00:09:44,300 But then you're going to probably be looking at about $100 to start off with. 142 00:09:44,300 --> 00:09:48,000 And then if you're wanting multiples of them, there's no way to kind of easily get it cheaper. 143 00:09:49,120 --> 00:09:53,140 So, the main restriction in terms of processing power 144 00:09:53,140 --> 00:09:56,040 is that you're not going to be doing video and audio processing. 145 00:09:57,520 --> 00:09:58,860 It's going to be more limited. 146 00:09:59,120 --> 00:10:01,900 So, depending on what your project is that you're wanting to do 147 00:10:02,480 --> 00:10:06,940 will determine whether or not you want to go for an embedded Linux board 148 00:10:06,940 --> 00:10:09,360 or stick with something that's microcontroller-based. 149 00:10:12,020 --> 00:10:14,280 So, anybody here interested in security? 150 00:10:19,160 --> 00:10:25,840 So, with any new development, there's new opportunities for doing research 151 00:10:25,840 --> 00:10:31,580 into both positive and negative side effects of a new technology or a new use of a technology. 152 00:10:33,140 --> 00:10:34,840 Physical computing is no different. 153 00:10:35,280 --> 00:10:39,120 It's also part of a concept called the Internet of Things, 154 00:10:39,240 --> 00:10:44,200 which is basically the idea that you have millions and billions of smart sensors 155 00:10:44,300 --> 00:10:49,620 that are connected to the Internet that detect particular states and then report back. 156 00:10:51,180 --> 00:10:54,000 But again, because a lot of this stuff is hardwired, 157 00:10:54,080 --> 00:10:58,940 then that means that if somebody's making a mistake, then it's there kind of forever. 158 00:11:00,080 --> 00:11:03,480 So, a lot of the issues that you'll run into are the same sort of things 159 00:11:03,480 --> 00:11:07,580 that have been run into traditional computer systems, traditional websites, 160 00:11:07,860 --> 00:11:09,600 but they're in a hardwired solution. 161 00:11:09,840 --> 00:11:12,220 So, they're a lot harder to just upgrade. 162 00:11:12,220 --> 00:11:12,300 Great. 163 00:11:13,320 --> 00:11:20,160 So, for example, the Ethernet board I indicated earlier has a hardware TCPIP stack. 164 00:11:20,400 --> 00:11:22,620 So, the question is, are there any vulnerabilities in that? 165 00:11:22,780 --> 00:11:25,760 And to which I say, you should try and find that out. 166 00:11:27,820 --> 00:11:31,140 Basically, I would be surprised if it was a perfect TCPIP stack 167 00:11:31,140 --> 00:11:32,720 because I don't think that's been invented yet. 168 00:11:32,940 --> 00:11:37,840 This is a TCPIP stack that, when sending HTTP requests, uses a packet per character. 169 00:11:38,180 --> 00:11:40,400 Well, to be fair, that's the driver. 170 00:11:40,540 --> 00:11:40,820 But yeah. 171 00:11:40,820 --> 00:11:46,880 So, you've got both the hardware level and the driver level stuff as well. 172 00:11:47,560 --> 00:11:53,520 And so, yeah, certainly there's room there to find ways that it could be improved 173 00:11:53,520 --> 00:11:56,540 and potentially risks associated with it. 174 00:11:57,560 --> 00:12:00,600 So, one of the other approaches that you can do 175 00:12:00,600 --> 00:12:04,440 is maybe reimplement some old friends in new ways. 176 00:12:05,560 --> 00:12:09,880 So, one of the projects that I looked at was DHCP exhaustion, 177 00:12:09,880 --> 00:12:13,740 which seemed like a reasonably simple project to start with. 178 00:12:14,620 --> 00:12:18,560 The WISNET board, which is the wide Ethernet board, 179 00:12:18,780 --> 00:12:21,540 allows you to change your MAC address on the fly. 180 00:12:22,900 --> 00:12:27,860 And this is the sum total of code, basically, to implement DHCP exhaustion, 181 00:12:28,780 --> 00:12:31,260 which is, you know, not really much to it. 182 00:12:31,880 --> 00:12:33,280 Steer and oar. Yeah. 183 00:12:34,940 --> 00:12:37,780 Other people have taken other approaches. 184 00:12:37,780 --> 00:12:42,780 This is from a payment machine in Canada somewhere. 185 00:12:43,480 --> 00:12:47,800 You'll notice just above the S of the word skimming, a little board. 186 00:12:47,920 --> 00:12:48,860 That's a Bluetooth board. 187 00:12:49,540 --> 00:12:52,620 So, basically, these people set up a Bluetooth link 188 00:12:52,620 --> 00:12:55,800 between the handset for a payment unit and wherever they were, 189 00:12:55,940 --> 00:12:58,440 and were skimming cards off the top. 190 00:12:58,860 --> 00:13:02,740 And it used to be that if you wanted to get a custom Bluetooth solution, 191 00:13:03,320 --> 00:13:06,560 you'd have to have a whole lot more intelligence than just plugging in some wires. 192 00:13:06,560 --> 00:13:09,840 But now you too can, you know, take these approaches if you'd like. 193 00:13:11,500 --> 00:13:15,620 So, another popular activity during the 90s, 194 00:13:15,640 --> 00:13:16,920 which some of you may remember, 195 00:13:17,140 --> 00:13:19,120 was the whole concept of war driving. 196 00:13:21,060 --> 00:13:23,120 You'd probably have a laptop and maybe an aerial 197 00:13:23,120 --> 00:13:25,860 and the right Wi-Fi card, 198 00:13:26,000 --> 00:13:28,840 and eventually you'd get something running. 199 00:13:33,540 --> 00:13:36,240 Now, this stack, 200 00:13:36,560 --> 00:13:38,780 will implement the same sort of thing for you. 201 00:13:39,140 --> 00:13:42,620 So, this has got a Wi-Fi board, 202 00:13:42,960 --> 00:13:44,260 which does the wireless connections, 203 00:13:44,600 --> 00:13:46,040 micro SD that does logging, 204 00:13:47,620 --> 00:13:49,580 GPS, which detects where you are, 205 00:13:49,680 --> 00:13:50,980 and an Arduino board. 206 00:13:53,820 --> 00:13:55,260 So, let's have a look at this. 207 00:14:05,800 --> 00:14:08,380 Well, Lee hopefully gets that working. 208 00:14:08,640 --> 00:14:11,780 So, basically, the motivation with this was to be able to apply power, 209 00:14:12,880 --> 00:14:15,240 and you probably can't see all the way from the back, 210 00:14:15,260 --> 00:14:17,280 but this is the actual size unit. 211 00:14:17,800 --> 00:14:20,400 Apply power to it, it sits there, 212 00:14:20,480 --> 00:14:22,060 waits until it gets a GPS lock, 213 00:14:22,260 --> 00:14:24,600 and then starts doing a scan. 214 00:14:24,600 --> 00:14:26,260 for the available networks, 215 00:14:26,540 --> 00:14:28,200 and then records anything that it finds. 216 00:14:28,560 --> 00:14:30,100 Now, one of the interesting things that you have 217 00:14:30,100 --> 00:14:32,700 working in a cut-down environment like this, 218 00:14:32,780 --> 00:14:34,940 is that some things that you take for granted 219 00:14:34,940 --> 00:14:35,820 aren't actually implemented. 220 00:14:36,160 --> 00:14:38,240 So, one of the issues I ran into was, 221 00:14:38,380 --> 00:14:41,820 well, how do I keep track of which access points 222 00:14:41,820 --> 00:14:43,420 I've already had recorded, 223 00:14:43,660 --> 00:14:44,920 and which ones I haven't? 224 00:14:45,140 --> 00:14:48,640 And I considered briefly installing PostgreSQL 225 00:14:48,640 --> 00:14:50,100 or something on it, 226 00:14:50,160 --> 00:14:52,120 but that apparently hasn't been ported yet. 227 00:14:52,560 --> 00:14:54,580 So, what has been ported is, 228 00:14:54,580 --> 00:14:56,420 an SDFAT library, 229 00:14:56,720 --> 00:14:59,420 which implements the FAT file system on the SD card. 230 00:14:59,980 --> 00:15:02,920 And so, by creating a directory path 231 00:15:02,920 --> 00:15:04,500 which matched the MAC address 232 00:15:04,500 --> 00:15:06,820 of any access point as I accessed it, 233 00:15:06,940 --> 00:15:09,500 I could then just check to see if that file existed, 234 00:15:09,660 --> 00:15:11,640 and, hey, you've got a simple on-disk database 235 00:15:11,640 --> 00:15:12,960 of all the access points. 236 00:15:13,420 --> 00:15:16,760 And so, then that records it to a file, 237 00:15:17,000 --> 00:15:18,280 and then carries on. 238 00:15:18,420 --> 00:15:20,000 And then, potentially, 239 00:15:20,620 --> 00:15:22,540 this could also serve up the data, 240 00:15:23,940 --> 00:15:24,560 but, you know, 241 00:15:24,580 --> 00:15:27,060 and as far as I've modified it so far, 242 00:15:27,600 --> 00:15:29,380 it basically records the SD card, 243 00:15:29,500 --> 00:15:30,960 and then you can pull it off onto your own machine. 244 00:15:32,200 --> 00:15:33,240 Are we in luck? 245 00:15:35,080 --> 00:15:35,720 Excuse me. 246 00:15:35,920 --> 00:15:36,240 Yeah? 247 00:15:36,500 --> 00:15:37,660 This is kind of reminding me 248 00:15:37,660 --> 00:15:38,100 of a lot of, like, 249 00:15:38,100 --> 00:15:38,480 . 250 00:15:39,380 --> 00:15:39,700 Yeah? 251 00:15:42,740 --> 00:15:44,000 It's just a lot more advanced, 252 00:15:44,120 --> 00:15:44,840 and you can do, of course, 253 00:15:44,840 --> 00:15:46,100 a lot more with the hardware now. 254 00:15:46,260 --> 00:15:48,120 I mean, back then, you know, 2K was like, 255 00:15:48,180 --> 00:15:48,560 oh, my God. 256 00:15:48,700 --> 00:15:48,940 Yeah. 257 00:15:50,740 --> 00:15:51,380 But it's... 258 00:15:51,380 --> 00:15:52,420 Plus, they were a bit harder 259 00:15:52,420 --> 00:15:53,220 to fit in your backpack. 260 00:15:53,220 --> 00:15:53,860 Yeah. 261 00:15:54,300 --> 00:15:55,240 But, yeah, I mean, 262 00:15:55,260 --> 00:15:56,440 that's totally... 263 00:15:57,300 --> 00:15:59,460 It's kind of going back to, yeah, 264 00:15:59,540 --> 00:16:00,920 like the 70s and 80s, 265 00:16:00,920 --> 00:16:02,580 where you could actually achieve a lot 266 00:16:02,580 --> 00:16:05,580 without a whole lot of support 267 00:16:05,580 --> 00:16:07,000 in terms of RAM and so forth. 268 00:16:10,800 --> 00:16:11,880 Oh, cool. 269 00:16:12,880 --> 00:16:13,960 Okay, so... 270 00:16:18,340 --> 00:16:22,480 So, this is basically the result of opening up 271 00:16:22,480 --> 00:16:24,820 the logged file, 272 00:16:26,780 --> 00:16:29,880 and using another project called OpenLayers, 273 00:16:30,000 --> 00:16:33,140 which does mapping and provides a JavaScript interface 274 00:16:33,140 --> 00:16:36,900 and uses OpenStreetMap for the mapping data. 275 00:16:37,360 --> 00:16:39,400 And so, basically, it's recorded, 276 00:16:39,660 --> 00:16:41,400 whether or not it's an open network, 277 00:16:41,560 --> 00:16:43,440 a WPA network, 278 00:16:43,600 --> 00:16:46,460 or a web network with different coloured stars 279 00:16:46,460 --> 00:16:47,520 to make it look pretty. 280 00:16:48,620 --> 00:16:51,480 And, yeah, so that's all... 281 00:16:53,900 --> 00:16:56,540 produced automatically from the log file 282 00:16:56,540 --> 00:16:57,800 once you've got it. 283 00:17:00,020 --> 00:17:02,040 Now, the interesting thing is that, in theory, 284 00:17:02,120 --> 00:17:05,040 that particular page is being served off a server. 285 00:17:05,200 --> 00:17:07,940 But, in theory, aside from the actual map data, 286 00:17:08,180 --> 00:17:11,020 the whole page itself could be served off the module as well, 287 00:17:11,180 --> 00:17:15,480 which then gives you the ability to access it remotely 288 00:17:16,840 --> 00:17:19,560 or, potentially, to have the unit upload the data 289 00:17:20,520 --> 00:17:23,100 autonomously so it can just sit in your backpack 290 00:17:23,100 --> 00:17:25,480 or sit in a target area. 291 00:17:26,040 --> 00:17:28,400 And this was in case the demo didn't work, 292 00:17:28,480 --> 00:17:29,040 but, of course, it did. 293 00:17:29,380 --> 00:17:30,420 You should probably... 294 00:17:31,020 --> 00:17:31,500 Yeah. 295 00:17:44,320 --> 00:17:46,380 So, when it finds it again... 296 00:18:11,260 --> 00:18:12,500 Linux is... 297 00:18:12,500 --> 00:18:13,680 AV, anybody? 298 00:18:14,100 --> 00:18:14,460 No. 299 00:18:28,120 --> 00:18:29,060 It's finding it. 300 00:18:31,020 --> 00:18:32,000 It's finding it. 301 00:18:43,340 --> 00:18:47,520 So, the next topic, when we get up to it, 302 00:18:47,520 --> 00:18:49,620 is software USB. 303 00:18:50,640 --> 00:18:53,840 So, there's been a few talks already this week, 304 00:18:53,860 --> 00:18:57,520 both at B-Sides 305 00:18:57,520 --> 00:19:00,180 and I think there's some more coming up today, 306 00:19:00,420 --> 00:19:04,560 about software or about USB fuzzing 307 00:19:04,560 --> 00:19:06,540 and fun stuff that you can do 308 00:19:06,540 --> 00:19:09,100 if you can create your own custom USB device. 309 00:19:09,660 --> 00:19:13,100 So, a lot of those solutions use a hardware USB implementation. 310 00:19:14,120 --> 00:19:16,960 There was a guy in Austria that wrote... 311 00:19:17,520 --> 00:19:22,140 a software USB implementation called VUSB, 312 00:19:22,320 --> 00:19:24,360 which was previously known as... 313 00:19:27,320 --> 00:19:28,040 AVR USB. 314 00:19:31,180 --> 00:19:32,860 And, basically, this guy, 315 00:19:33,000 --> 00:19:34,960 apparently in one of Austria's long winter nights, 316 00:19:35,180 --> 00:19:37,360 sat down and decided that he'd work out 317 00:19:37,360 --> 00:19:39,580 how to implement low-speed USB in software. 318 00:19:39,880 --> 00:19:42,840 So, basically, that was assembly-level hacking, 319 00:19:43,140 --> 00:19:45,320 you know, working out individual clock cycles 320 00:19:45,320 --> 00:19:47,420 and managed to get this chip, which... 321 00:19:47,520 --> 00:19:49,480 only runs at 16 megahertz, 322 00:19:49,620 --> 00:19:51,840 to actually support low-speed USB. 323 00:19:52,300 --> 00:19:56,020 So, you can implement low-speed USB devices. 324 00:19:56,200 --> 00:19:58,200 So, that's things like keyboards, mice, 325 00:19:58,380 --> 00:19:59,960 and those sorts of things. 326 00:20:00,960 --> 00:20:03,480 Then, I came along and thought that was pretty cool, 327 00:20:03,620 --> 00:20:06,320 and a few people had kind of used it around things, 328 00:20:06,440 --> 00:20:07,500 but there wasn't a lot documented, 329 00:20:07,820 --> 00:20:10,080 and there wasn't an easy way to access it 330 00:20:10,080 --> 00:20:11,020 from the Arduino environment. 331 00:20:11,320 --> 00:20:15,740 So, I created an Arduino library that wrapped VUSB. 332 00:20:16,780 --> 00:20:17,500 So, some of the things that I've done, 333 00:20:17,520 --> 00:20:19,200 some of the projects that have done keyboard emulation 334 00:20:19,200 --> 00:20:21,120 in the past are things like CapsLocker 335 00:20:21,120 --> 00:20:22,040 from a couple of years ago, 336 00:20:22,220 --> 00:20:24,240 when you plugged a USB device in 337 00:20:24,240 --> 00:20:26,880 and it would toggle the CapsLock key 338 00:20:26,880 --> 00:20:29,080 on your victim's computer at random, 339 00:20:29,160 --> 00:20:30,700 so they think that their keyboard is broken. 340 00:20:31,840 --> 00:20:34,460 I implemented an example of that called the... 341 00:20:35,880 --> 00:20:37,620 that performed the same technique. 342 00:20:38,120 --> 00:20:41,420 Slightly more useful is there's a project called UBKey, 343 00:20:41,500 --> 00:20:43,000 which actually does authentication, 344 00:20:43,340 --> 00:20:45,960 and it will send in an authentication key 345 00:20:45,960 --> 00:20:48,240 when you press a button or something like that, 346 00:20:48,360 --> 00:20:49,860 which means you don't have to type in something 347 00:20:49,860 --> 00:20:52,700 from a two-factor authentication device. 348 00:20:55,540 --> 00:21:02,740 So, as an example of how you can use the USB side of things, 349 00:21:03,940 --> 00:21:06,140 this is a two parts. 350 00:21:06,220 --> 00:21:08,840 The first part is a piece of Python code, 351 00:21:09,020 --> 00:21:12,740 and it creates...uses libUSB in the background 352 00:21:12,740 --> 00:21:14,780 to create what's essentially a serial connection 353 00:21:14,780 --> 00:21:15,820 to a device, 354 00:21:16,060 --> 00:21:23,120 and then the USB code on the Arduino is this section, 355 00:21:23,360 --> 00:21:26,440 and basically it reads whatever's being sent over it. 356 00:21:26,800 --> 00:21:28,580 Now, I can give you a demo of something here. 357 00:21:41,660 --> 00:21:42,240 So... 358 00:21:54,340 --> 00:21:59,100 So, basically, this here has an Atmel chip in it, 359 00:21:59,180 --> 00:22:01,680 which is running in the same way as an Arduino. 360 00:22:02,140 --> 00:22:04,660 It's got a switch on the back and a pretty light on the front, 361 00:22:04,720 --> 00:22:06,940 which isn't doing anything at the moment. 362 00:22:07,360 --> 00:22:09,200 When you press the button down, 363 00:22:09,380 --> 00:22:13,020 it changes into a green light mode, 364 00:22:13,020 --> 00:22:16,680 which means that when you press the button again, 365 00:22:16,900 --> 00:22:18,560 it'll type out my domain name, 366 00:22:18,720 --> 00:22:19,520 which is really impressive 367 00:22:19,520 --> 00:22:20,960 when you have a decent internet connection 368 00:22:20,960 --> 00:22:22,120 and it actually goes there. 369 00:22:22,600 --> 00:22:25,520 But, basically, the idea is that you can send 370 00:22:25,520 --> 00:22:27,320 any keystrokes that you like. 371 00:22:27,480 --> 00:22:29,880 So that includes things like on a Mac, 372 00:22:30,020 --> 00:22:31,760 you can do things like make expose 373 00:22:31,760 --> 00:22:33,840 or dashboard appear and disappear. 374 00:22:34,920 --> 00:22:37,640 Some of the other projects that have been mentioned 375 00:22:37,640 --> 00:22:40,420 and I think are coming up again later today 376 00:22:40,420 --> 00:22:43,000 do things like they'll actually do things like 377 00:22:43,020 --> 00:22:45,540 send the content of an exploit or something like that. 378 00:22:46,160 --> 00:22:48,320 One advantage with this approach is that, basically, 379 00:22:48,380 --> 00:22:51,320 you need the chip and about four passive components 380 00:22:51,320 --> 00:22:52,880 and the actual connector yourself. 381 00:22:53,520 --> 00:22:54,760 And so it's really cheap 382 00:22:54,760 --> 00:22:57,040 and really easy to get started with as well. 383 00:22:57,680 --> 00:22:59,020 There are downsides to it. 384 00:22:59,120 --> 00:23:00,540 It doesn't work in every device. 385 00:23:00,840 --> 00:23:02,720 In fact, I've got one laptop where it'll work 386 00:23:02,720 --> 00:23:04,980 if you plug it into one USB port on one side, 387 00:23:05,040 --> 00:23:06,800 but it won't work if you plug it in on the other side. 388 00:23:07,440 --> 00:23:10,160 But it's still fun to actually be able to create a USB device 389 00:23:10,160 --> 00:23:11,880 and do stuff with it. 390 00:23:15,560 --> 00:23:19,400 One of the other projects is software protection dongles. 391 00:23:20,880 --> 00:23:22,560 I won't demonstrate it now, 392 00:23:22,680 --> 00:23:25,740 but basically you can have a chunk of Python, 393 00:23:25,880 --> 00:23:28,260 which is encrypted in some way, 394 00:23:28,880 --> 00:23:30,460 send it out to the device, 395 00:23:30,560 --> 00:23:32,600 which will then decrypt it and then send it back. 396 00:23:33,060 --> 00:23:35,800 Which is really just an example of how you can have 397 00:23:35,800 --> 00:23:38,160 an external device perform some function 398 00:23:38,700 --> 00:23:41,460 that won't work if it's not connected. 399 00:23:41,460 --> 00:23:43,240 And of course we know how well 400 00:23:43,240 --> 00:23:44,800 software protection dongles work in practice. 401 00:23:46,580 --> 00:23:49,940 So one of the other aspects is USB fuzzing. 402 00:23:50,840 --> 00:23:54,760 So this is the idea of finding faults in drivers 403 00:23:55,420 --> 00:23:58,380 and hopefully exploiting them. 404 00:23:59,160 --> 00:24:01,360 For those who don't know how USB works, 405 00:24:01,480 --> 00:24:03,960 essentially when you plug in a USB device, 406 00:24:04,160 --> 00:24:05,460 the host says, 407 00:24:05,540 --> 00:24:06,220 Hi, who are you? 408 00:24:06,400 --> 00:24:07,780 And the device says, 409 00:24:07,880 --> 00:24:09,520 Oh, hey, I'm this device here. 410 00:24:09,520 --> 00:24:11,540 And gives a vendor ID and a product ID. 411 00:24:13,800 --> 00:24:17,660 And how fuzzing works, 412 00:24:17,780 --> 00:24:21,680 and so normally the host would load the correct driver 413 00:24:21,680 --> 00:24:22,880 and things would carry on happy. 414 00:24:23,740 --> 00:24:25,300 So what you do with USB fuzzing, 415 00:24:25,380 --> 00:24:26,680 or at least the first stage of it, 416 00:24:26,740 --> 00:24:27,120 is you say, 417 00:24:27,260 --> 00:24:28,520 Oh, hi, I'm this device. 418 00:24:30,280 --> 00:24:31,460 Oh, hi, I'm this device. 419 00:24:32,200 --> 00:24:33,160 Oh, hi, I'm this device. 420 00:24:33,280 --> 00:24:34,880 And then eventually, if you're lucky, 421 00:24:35,040 --> 00:24:36,060 your operating system will go, 422 00:24:36,160 --> 00:24:37,500 Oh, hey, I've got a driver for that here. 423 00:24:37,580 --> 00:24:38,120 Let's load it. 424 00:24:39,520 --> 00:24:41,700 And then, because you're not actually that device, 425 00:24:41,840 --> 00:24:43,260 if the driver is making some assumption 426 00:24:43,260 --> 00:24:44,460 about the way that you work, 427 00:24:45,960 --> 00:24:47,280 it'll dislike it. 428 00:24:47,800 --> 00:24:49,620 So the question is, does it actually work? 429 00:24:51,160 --> 00:24:52,880 Well, the answer is yes. 430 00:24:53,560 --> 00:24:56,040 So this is a log taken from, 431 00:24:56,160 --> 00:24:59,380 I think it was an Ubuntu 9.04 432 00:24:59,380 --> 00:25:00,580 or something like that machine. 433 00:25:01,100 --> 00:25:03,920 And basically by plugging in the device 434 00:25:03,920 --> 00:25:06,980 and pretending to be a particular IPAC device, 435 00:25:07,140 --> 00:25:08,320 the IPAC driver would load 436 00:25:08,320 --> 00:25:11,900 and then I think it was a null point of dereference 437 00:25:11,900 --> 00:25:12,480 that it encountered. 438 00:25:13,340 --> 00:25:15,060 Now, the interesting thing about this was 439 00:25:15,060 --> 00:25:19,080 that when the crash happened, 440 00:25:19,180 --> 00:25:21,920 basically no more USB devices were recognized 441 00:25:21,920 --> 00:25:23,980 and you had to reboot the machine 442 00:25:23,980 --> 00:25:25,280 to actually get USB back. 443 00:25:25,540 --> 00:25:28,720 And the funny thing was that it could actually still do this 444 00:25:28,720 --> 00:25:30,340 even if you were just sitting on the login screen, 445 00:25:30,560 --> 00:25:32,320 which means there's a whole lot of stuff about, 446 00:25:32,540 --> 00:25:35,200 well, why are you making every single USB driver 447 00:25:35,200 --> 00:25:37,780 active at the login screen because, you know, 448 00:25:37,780 --> 00:25:39,100 you're not going to use half of them there. 449 00:25:39,580 --> 00:25:43,160 But it also means that it creates a greater attack surface 450 00:25:43,160 --> 00:25:45,420 because it means that you don't actually have to 451 00:25:45,420 --> 00:25:48,380 only have a device that might handle some sort of input. 452 00:25:48,500 --> 00:25:50,240 It can be any device because the drivers 453 00:25:50,240 --> 00:25:51,640 are potentially going to be loaded already. 454 00:25:53,140 --> 00:25:55,100 So there's other people 455 00:25:55,100 --> 00:25:57,140 who have done some work on that as well. 456 00:25:59,160 --> 00:26:01,220 This is a really sophisticated program 457 00:26:01,220 --> 00:26:02,840 that will cause the crash. 458 00:26:03,480 --> 00:26:05,980 It sets the vendor ID and the product ID 459 00:26:05,980 --> 00:26:07,480 and then it sits there. 460 00:26:07,780 --> 00:26:09,720 And waits for you to, you know, plug it in. 461 00:26:12,560 --> 00:26:14,980 So Lee is going to talk a little bit more 462 00:26:14,980 --> 00:26:17,340 about the USB fuzzing side of things 463 00:26:17,340 --> 00:26:18,420 and what other people have done. 464 00:26:18,700 --> 00:26:20,680 So just from this slide here, 465 00:26:20,860 --> 00:26:23,360 you got that IPAC crash from running through 466 00:26:23,360 --> 00:26:26,480 the entire Linux USB device ID database. 467 00:26:26,760 --> 00:26:26,940 Yeah. 468 00:26:27,100 --> 00:26:30,900 Yeah, so basically there's a list of known USB devices 469 00:26:30,900 --> 00:26:35,380 and so the code that didn't just exploit it 470 00:26:35,380 --> 00:26:36,900 but actually searched for it 471 00:26:36,900 --> 00:26:39,560 went through the whole list and tried it out. 472 00:26:39,760 --> 00:26:42,300 There's potentially other devices that aren't supported 473 00:26:42,300 --> 00:26:44,360 on other operating systems. 474 00:26:44,560 --> 00:26:46,040 So you could actually just go through 475 00:26:46,040 --> 00:26:48,560 the complete key space on that. 476 00:26:53,060 --> 00:26:54,340 I haven't got it on. 477 00:26:54,540 --> 00:26:55,440 You didn't close it. 478 00:26:55,780 --> 00:26:56,300 Sorry. 479 00:27:08,340 --> 00:27:09,740 . 480 00:27:18,500 --> 00:27:19,200 . 481 00:27:19,200 --> 00:27:19,260 . 482 00:27:19,260 --> 00:27:20,700 . 483 00:27:20,700 --> 00:27:20,720 . 484 00:27:20,720 --> 00:27:20,740 . 485 00:27:46,580 --> 00:27:48,360 Sorry about all the AV fail, folks. 486 00:28:17,760 --> 00:28:18,300 All right. 487 00:28:46,260 --> 00:28:52,180 So a few other ideas, inspiration about potential ways that this kind of hardware attacks can 488 00:28:52,180 --> 00:28:52,660 be used. 489 00:28:54,280 --> 00:29:01,160 How about a pocket RFID data collector in the same way as we've implemented what we're 490 00:29:01,160 --> 00:29:06,600 driving here, potentially you could walk around collecting RFID identification tokens or something 491 00:29:06,600 --> 00:29:06,880 like that. 492 00:29:06,880 --> 00:29:12,680 Much smaller self-contained rig possible than sort of hooking it up to a laptop. 493 00:29:14,560 --> 00:29:22,900 Similarly with Bluetooth, with the BlueSmith module, follower already mentioned the pin 494 00:29:23,860 --> 00:29:25,380 catcher that was built. 495 00:29:27,420 --> 00:29:31,460 There's a wide variety of other applications for Bluetooth sniffing possible. 496 00:29:32,880 --> 00:29:36,060 Appliance control, did you want to go back to talking about that? 497 00:29:36,220 --> 00:29:36,500 So. 498 00:29:36,880 --> 00:29:45,080 One of the other approaches that you can do is you might go, hey, can I control some 499 00:29:45,080 --> 00:29:46,620 sort of mains powered device? 500 00:29:48,260 --> 00:29:53,520 And the concept is really appealing, but unfortunately it can also be lethal. 501 00:29:53,800 --> 00:29:57,640 So one approach that you can take if you want to control something that's mains powered 502 00:29:57,640 --> 00:30:03,900 is you can get these PowerPoint sockets which are remote controlled with an RF remote. 503 00:30:04,220 --> 00:30:06,800 And so I gave a demo where you could. 504 00:30:06,800 --> 00:30:11,520 You could actually vote during a presentation as to whether you wanted Christmas tree lights 505 00:30:11,520 --> 00:30:13,660 on or a fan light on or a lamp on. 506 00:30:13,920 --> 00:30:19,240 And it would just send the signal over the RF remote and turn those particular devices 507 00:30:19,680 --> 00:30:20,260 on and off. 508 00:30:20,420 --> 00:30:23,460 And that didn't require any interaction with mains power at all. 509 00:30:24,380 --> 00:30:31,120 Another potential avenue, there's a project to combine the Arduino, the Arduino project 510 00:30:31,120 --> 00:30:32,940 with Android cell phones. 511 00:30:33,040 --> 00:30:35,020 So to be able to control your Android. 512 00:30:35,520 --> 00:30:36,780 To control your Arduino. 513 00:30:36,800 --> 00:30:40,780 Arduino based hardware project from an Android cell phone, there's a toolkit available. 514 00:30:42,640 --> 00:30:47,280 And sort of forward thinking, there's, who here has heard the term road apple? 515 00:30:47,560 --> 00:30:49,380 Not in the context of horse shit. 516 00:30:50,540 --> 00:30:55,600 So a road apple is a social engineering attack where you drop USB keys or another piece of 517 00:30:55,600 --> 00:30:59,160 hardware in the parking lot of the company that you're targeting. 518 00:31:00,300 --> 00:31:05,480 And as people tend to do, people are going to plug that thing into their computers when 519 00:31:05,480 --> 00:31:06,340 they get into the office. 520 00:31:06,340 --> 00:31:09,800 So, yeah, exactly, what's on this effect? 521 00:31:10,100 --> 00:31:16,980 And it's, you know, it can be as simple as including bright shiny things.exe on that 522 00:31:16,980 --> 00:31:17,420 road apple. 523 00:31:18,300 --> 00:31:25,900 Where you run into issues is a lot of corporations will have USB device IDs whitelisted and only 524 00:31:25,900 --> 00:31:27,340 allow those whitelisted device IDs. 525 00:31:27,620 --> 00:31:32,020 Fortunately you can guess what those whitelisted device IDs are going to be just based on like, 526 00:31:32,060 --> 00:31:35,180 you know, what you know people to be deploying in their corporate networks. 527 00:31:36,340 --> 00:31:41,880 And with the functionality of the Arduino USB stack to be able to spoof device IDs you 528 00:31:41,880 --> 00:31:45,040 can potentially pretend to be one of those and present yourself as a mass storage device. 529 00:31:45,660 --> 00:31:50,120 Another one that I've been thinking a lot about lately is haptic inputs and outputs. 530 00:31:50,880 --> 00:31:56,140 Building covert input devices if you're potentially going into an area where you're not allowed 531 00:31:56,140 --> 00:32:02,160 to take notes or record video or whatever, you could potentially use soft switches, 532 00:32:02,300 --> 00:32:05,260 soft circuits to build a haptic interface. 533 00:32:05,380 --> 00:32:06,320 That, you know, when you nod your head, you can use that. 534 00:32:06,320 --> 00:32:14,160 When you tap a spot on your sleeve, it records text based on Morse code, something like that. 535 00:32:15,400 --> 00:32:21,060 And thinking about that sort of physical way of bypassing things brings me to a brief 536 00:32:21,060 --> 00:32:21,480 interlude. 537 00:32:21,980 --> 00:32:25,860 Some of you may have seen the T-shirts folks are wearing that say Free Byron on them, the 538 00:32:25,860 --> 00:32:26,620 stickers and the buttons. 539 00:32:27,380 --> 00:32:28,840 Check out freebyron.org. 540 00:32:29,040 --> 00:32:33,940 Byron is a friend of mine and fellow hackerspace member who is currently being detained in 541 00:32:33,940 --> 00:32:35,840 Canada for criticizing the security apparatus. 542 00:32:36,320 --> 00:32:37,720 Security spending around the G20. 543 00:32:38,100 --> 00:32:44,160 If you're interested at all in the right to dissent and the right to criticize crappy 544 00:32:44,160 --> 00:32:47,340 security infrastructure, you should check out freebyron.org. 545 00:32:48,600 --> 00:32:49,880 Back to USB fuzzing. 546 00:32:50,700 --> 00:32:55,040 I'm going to do a little bit of a summary about the current research and then hand it 547 00:32:55,040 --> 00:32:55,720 back over to Follower. 548 00:32:56,780 --> 00:33:04,080 In terms of USB sniffing and protocol reversing, there's the sort of old and busted USB snoop, 549 00:33:04,100 --> 00:33:05,860 which is still workable up to Windows XP. 550 00:33:05,860 --> 00:33:07,480 But it doesn't work on Vista or 7. 551 00:33:08,640 --> 00:33:12,200 It is useful but produces kind of crappy output. 552 00:33:13,340 --> 00:33:15,580 PyUSB is useful for that as well. 553 00:33:15,900 --> 00:33:21,160 And Nick and Ferkin gave a talk on Thursday called Go Go Gadget Python where they did 554 00:33:21,160 --> 00:33:25,900 a bunch of protocol analysis on the USB snoop output using Python. 555 00:33:26,200 --> 00:33:27,480 So that's definitely worth checking out. 556 00:33:27,740 --> 00:33:32,700 There's also a variety of expensive commercial USB sniffers and protocol analyzers out there. 557 00:33:32,760 --> 00:33:33,600 But that's not that interesting. 558 00:33:33,740 --> 00:33:35,840 We're talking like a couple thousand dollars kind of expensive. 559 00:33:35,860 --> 00:33:41,620 Some other folks that are working on this stuff, Rafael Dominguez Vega gave a talk last 560 00:33:41,620 --> 00:33:42,200 year at DEF CON. 561 00:33:43,080 --> 00:33:45,400 He built a pic-based USB fuzzing device. 562 00:33:46,200 --> 00:33:51,040 More at Stradate has a really interesting presentation covering a bunch of security 563 00:33:51,040 --> 00:33:55,920 aspects of USB at a protocol level and has done a bunch of software-based fuzzing that's 564 00:33:55,920 --> 00:33:56,520 pretty interesting. 565 00:33:57,140 --> 00:33:58,440 So back to you. 566 00:34:02,140 --> 00:34:03,940 Last time we switch, I promise. 567 00:34:21,520 --> 00:34:24,040 We're in Vegas, I guess you should, oh wow, there you go. 568 00:34:24,140 --> 00:34:24,960 That would have been a good bet. 569 00:34:29,900 --> 00:34:35,840 So one thing to keep in mind is I was introduced to the Arduino about three years ago. 570 00:34:37,040 --> 00:34:41,280 And up until that stage I'd had an interest in electronics but never sort of got into 571 00:34:41,280 --> 00:34:41,840 it too much. 572 00:34:42,460 --> 00:34:45,700 There always seemed to be a whole lot of stuff that you had to remember and it was 573 00:34:45,700 --> 00:34:49,460 like electricity is like water except when it's not and it kind of goes through a pump 574 00:34:49,460 --> 00:34:49,960 and I'm like what? 575 00:34:50,800 --> 00:34:55,860 But the great thing with the Arduino is it takes what used to be a 100% hardware problem 576 00:34:55,860 --> 00:34:59,360 and makes it a 90% software problem and then a 10% hardware problem. 577 00:34:59,580 --> 00:35:03,280 And that means that if you're familiar with software then you can kind of get a long way 578 00:35:04,100 --> 00:35:05,340 with just writing code. 579 00:35:05,840 --> 00:35:10,740 And then you can look at things like the little pieces of hardware that you actually need 580 00:35:10,740 --> 00:35:13,160 to learn and pick up that knowledge as you go. 581 00:35:13,500 --> 00:35:17,540 Just the other big step up with the Arduino from previous microcontroller and 582 00:35:17,540 --> 00:35:18,540 hardware hacking platforms. 583 00:35:19,360 --> 00:35:23,420 The sheer amount of yak shaving that is involved in setting up a lot of other microcontroller 584 00:35:23,420 --> 00:35:25,780 platforms is a real barrier to entry for a lot of folks. 585 00:35:25,980 --> 00:35:29,720 With the Arduino you download a zip file, install the driver or it's even already installed 586 00:35:29,720 --> 00:35:32,960 on Linux and you're ready to go. 587 00:35:33,220 --> 00:35:33,640 . 588 00:35:35,840 --> 00:35:38,100 So it's basically free stack whereas a lot of the other microcontroller environments 589 00:35:38,100 --> 00:35:42,140 out there require proprietary and potentially even non-gratis software. 590 00:35:42,160 --> 00:35:42,460 Cost free scale. 591 00:35:42,680 --> 00:35:43,480 Yeah, exactly. 592 00:35:43,900 --> 00:35:49,260 So potentially non-free as in Libra as well as non-free as in no cost. 593 00:35:49,520 --> 00:35:50,220 So yeah. 594 00:35:52,180 --> 00:35:56,740 So then there's another section of things which you can do just because you can. 595 00:36:00,220 --> 00:36:03,140 This is an example of one of those things. 596 00:36:03,340 --> 00:36:05,820 So you can serve up pretty much anything. 597 00:36:05,840 --> 00:36:15,080 Pretty much anything you like when you're doing a when you're using a wireless or wired 598 00:36:15,080 --> 00:36:15,440 shield. 599 00:36:16,020 --> 00:36:22,140 And so I played for a while with using Python to generate a flash file and then served that 600 00:36:22,140 --> 00:36:25,120 flash file up from the chip. 601 00:36:25,420 --> 00:36:30,160 Now the restriction in that case was this was before there was a good implementations 602 00:36:30,160 --> 00:36:35,140 of microSD support and so essentially everything you were serving up had to be served up from 603 00:36:35,140 --> 00:36:35,820 your app. 604 00:36:35,840 --> 00:36:38,420 In those days, 16K of RAM. 605 00:36:39,140 --> 00:36:43,220 And so it turned out that Flash was kind of a more efficient way 606 00:36:43,220 --> 00:36:44,520 of getting some kind of cool stuff done. 607 00:36:44,820 --> 00:36:47,740 So this is a demo of a demo, 608 00:36:48,680 --> 00:36:52,140 which has a Flash file which is served up, 609 00:36:52,240 --> 00:36:57,260 and then the little grey lines, which you hopefully can see, 610 00:36:59,140 --> 00:37:04,780 basically have the ability to return the values of analog pins on the Arduino. 611 00:37:04,780 --> 00:37:09,300 And so the idea with this is that you don't actually have to install any software to play with it. 612 00:37:09,380 --> 00:37:11,020 You can just plug it into your machine, 613 00:37:11,660 --> 00:37:13,520 go to the local link IP address, 614 00:37:13,700 --> 00:37:16,820 and it will pop this up and you can automatically start doing stuff with it. 615 00:37:17,020 --> 00:37:20,860 And in the background, it uses a HTTP REST implementation, 616 00:37:21,400 --> 00:37:26,880 which basically gives you a URL for each digital pin that you want to turn on and off. 617 00:37:27,400 --> 00:37:30,820 So which then means you can also use things like JavaScript and stuff like that. 618 00:37:30,960 --> 00:37:34,760 So there's a couple of other variations of this, 619 00:37:34,780 --> 00:37:36,140 that people have done out there, 620 00:37:36,780 --> 00:37:39,220 which gives you kind of the ability to do stuff. 621 00:37:49,220 --> 00:37:52,980 So we have one last demo, which is VNC. 622 00:37:53,360 --> 00:37:56,200 Now one of the restrictions is that if you've only got 2K of RAM, 623 00:37:56,420 --> 00:37:58,920 you can't have a particularly large display space. 624 00:38:00,120 --> 00:38:01,920 At least that used to be the case. 625 00:38:04,780 --> 00:38:08,000 So if we bring this all together. 626 00:38:12,860 --> 00:38:15,720 So here I've got a VNC client. 627 00:38:18,260 --> 00:38:22,580 And it turns out that the VNC server implementation is actually relatively straightforward. 628 00:38:23,420 --> 00:38:24,820 Although I suppose I should really say, 629 00:38:24,880 --> 00:38:27,260 man, VNC implementation is really, really difficult, 630 00:38:27,380 --> 00:38:29,580 and it took a really long time to get this to work. 631 00:38:30,500 --> 00:38:33,180 Yeah, the protocol is quite well documented, 632 00:38:33,180 --> 00:38:38,060 and it's something that you can kind of generate on the fly. 633 00:38:42,980 --> 00:38:44,520 So we plug it in. 634 00:38:44,780 --> 00:38:48,080 This is how a shield and an Arduino fit together. 635 00:38:49,640 --> 00:38:50,440 And connect. 636 00:38:54,040 --> 00:38:57,300 So one of the things that you can keep in mind with this, 637 00:38:57,380 --> 00:38:58,380 and there we have it. 638 00:38:58,460 --> 00:39:01,820 So we have our 255 pixel by 255 pixel screen, 639 00:39:01,920 --> 00:39:03,080 which our Arduino is serving, 640 00:39:03,080 --> 00:39:10,220 and it's currently giving you a reading of the analog pins. 641 00:39:10,640 --> 00:39:15,420 So those red bars and the numbers represent the current state of the analog pins. 642 00:39:15,820 --> 00:39:18,260 And because they're what's known as a floating input, 643 00:39:18,420 --> 00:39:21,500 it will change as the screen advances. 644 00:39:22,580 --> 00:39:27,240 And yeah, so this is an example of if you're needing to get feedback from a device 645 00:39:27,240 --> 00:39:29,320 that you've installed in a location, 646 00:39:29,720 --> 00:39:32,620 you've got options out there for things like VNC, 647 00:39:33,080 --> 00:39:36,280 or using a web browser to retrieve that information. 648 00:39:37,180 --> 00:39:42,160 And again, there's a lot of cool stuff that's still yet to be done. 649 00:39:42,280 --> 00:39:44,140 People are finding out what can be done. 650 00:39:44,340 --> 00:39:46,520 And you know, people say, you know, a few years ago, 651 00:39:46,560 --> 00:39:48,440 it was like, oh, you can't connect a camera to an Arduino. 652 00:39:48,600 --> 00:39:50,780 And then this camera came out that you could do stuff with. 653 00:39:51,360 --> 00:39:55,900 Then it was like, oh, you can't attach USB devices like, you know, 654 00:39:55,920 --> 00:40:00,080 keyboards or cameras to a USB, to an Arduino, 655 00:40:00,140 --> 00:40:01,920 because it can't act as a USB host. 656 00:40:02,100 --> 00:40:03,060 And then a USB. 657 00:40:03,060 --> 00:40:05,980 A USB host chip was released, and somebody created USB host shield, 658 00:40:06,180 --> 00:40:11,300 and they're currently working on getting that to do P2P communication with cameras, 659 00:40:11,500 --> 00:40:13,860 so you can take photographs and stuff like that. 660 00:40:15,860 --> 00:40:19,400 So yeah, if it's a field where you like to do things for the first time, 661 00:40:19,500 --> 00:40:20,780 there's heaps of space there. 662 00:40:21,180 --> 00:40:24,260 There's heaps of opportunity for doing cool hacks. 663 00:40:25,100 --> 00:40:27,820 If that's what motivates you, I'm sure it doesn't. 664 00:40:30,640 --> 00:40:31,360 Thank you. 665 00:40:36,260 --> 00:40:38,440 That was in case the VNC demo didn't work. 666 00:40:39,180 --> 00:40:44,580 So that pretty much covers the main stuff that we wanted to talk about. 667 00:40:44,660 --> 00:40:47,340 We've got a few minutes if we want to get any questions, 668 00:40:47,520 --> 00:40:50,320 or you can talk to us in the Q&A room later. 669 00:40:51,260 --> 00:40:52,560 Do you have anything else to add? 670 00:40:53,500 --> 00:40:54,380 Any questions? 671 00:40:54,660 --> 00:40:54,840 Yeah. 672 00:40:55,040 --> 00:40:55,640 Thank you. 673 00:40:56,660 --> 00:40:57,420 Thank you. 674 00:40:58,680 --> 00:40:59,560 Thank you. 675 00:40:59,740 --> 00:41:00,180 Thank you. 676 00:41:02,820 --> 00:41:03,040 Thank you. 677 00:41:03,600 --> 00:41:04,080 Cool. 678 00:41:04,200 --> 00:41:06,100 Thanks for your time, and we can see you in the Q&A room. 679 00:41:07,760 --> 00:41:08,240 Yeah. 680 00:41:08,300 --> 00:41:08,560 Okay. 681 00:41:08,660 --> 00:41:08,840 Yeah. 682 00:41:10,820 --> 00:41:12,460 With your war driving rig, 683 00:41:12,580 --> 00:41:16,400 can you talk to the relative power consumption between using that and the laptop? 684 00:41:17,220 --> 00:41:23,340 Well, the question is, what's the power consumption of the war driving rig? 685 00:41:23,920 --> 00:41:27,280 So this was running off four AA batteries, 686 00:41:28,020 --> 00:41:31,700 and that does quite happily for quite a long time. 687 00:41:32,160 --> 00:41:33,040 And so, yeah. 688 00:41:33,040 --> 00:41:36,380 Now, the other thing is that you can also reduce the size of this quite a bit. 689 00:41:36,480 --> 00:41:37,900 These are just using the standard shields. 690 00:41:38,620 --> 00:41:40,780 If you wanted to create a custom PCB, 691 00:41:41,780 --> 00:41:46,880 then you could reduce the size of it probably to maybe, you know, kind of half. 692 00:41:46,900 --> 00:41:47,260 Yeah. 693 00:41:47,520 --> 00:41:47,920 Also. 694 00:41:51,000 --> 00:41:51,400 Cool. 695 00:41:51,600 --> 00:41:52,000 Okay. 696 00:41:52,060 --> 00:41:52,780 Thanks a lot for your time. 697 00:41:53,620 --> 00:41:54,020 Thank you. 698 00:41:54,720 --> 00:41:55,520 Thank you.