1 00:00:00,000 --> 00:00:02,720 Thank you for coming to reverse engineering marine engines. 2 00:00:02,720 --> 00:00:05,520 How to make powerboats do your evil bidding. 3 00:00:05,560 --> 00:00:08,040 Your bidding may not be evil, but that's really up to you. 4 00:00:08,040 --> 00:00:11,840 What we're going to talk about is different types of boats, different type of propulsion systems. 5 00:00:11,840 --> 00:00:13,340 It's going to start with a broad overview. 6 00:00:13,560 --> 00:00:22,420 It may be repetitive for some of you, and then we'll move on to like the best architecture and how to make this work properly, or how I've made it make it work properly. 7 00:00:22,480 --> 00:00:24,540 So a quick overview. 8 00:00:24,560 --> 00:00:29,840 So major outboard OEMs, and that's an outboard motor for those of you who haven't seen them before. 9 00:00:29,840 --> 00:00:31,640 That's actually four of them from Mercury. 10 00:00:31,640 --> 00:00:34,500 The major OEMs are Mercury, who's owned by Brunswick. 11 00:00:34,500 --> 00:00:36,580 We're going to come back to them a bunch. 12 00:00:36,580 --> 00:00:39,680 No specific malice against them, but we're going to come back to them a bunch. 13 00:00:39,860 --> 00:00:43,560 Yamaha, same people who make the pianos, make a lot of jet skis and jet boats. 14 00:00:43,560 --> 00:00:47,180 Honda, Suzuki, those are the outboard manufacturers. 15 00:00:47,180 --> 00:00:49,980 So let's talk outboards for a second. 16 00:00:49,980 --> 00:00:53,380 So there's significant consolidation in the outboard market. 17 00:00:53,380 --> 00:00:59,280 They're really only the four or five manufacturers that I mentioned when you get above about 150 horsepower. 18 00:00:59,280 --> 00:01:03,340 And when you start to see, you know, bigger engines that are more expensive. 19 00:01:04,620 --> 00:01:07,340 Most OEMs are pretty locked down. 20 00:01:07,340 --> 00:01:09,060 And we're going to get into that later. 21 00:01:09,160 --> 00:01:12,060 They do not want you messing with their engines. 22 00:01:12,060 --> 00:01:18,840 The answer that I've had from Mercury when they sent me a nasty letter was, we don't want the legal liability for this. 23 00:01:18,840 --> 00:01:23,020 So, you know, fine, but we're at DEF CON, so all that goes out the window. 24 00:01:24,180 --> 00:01:26,480 As we can see here, that's a Yamaha. 25 00:01:26,480 --> 00:01:29,600 So see that giant sort of thermos looking thing under the motor? 26 00:01:29,700 --> 00:01:33,480 That's the integrated steering motor for Yamaha. 27 00:01:33,480 --> 00:01:43,740 So if you buy this, you have opted out of the significantly standardized steering market that governs most outboards for the last 25, 30 years. 28 00:01:43,880 --> 00:01:48,000 And you now must buy Yamaha's helm, which is kind of annoying. 29 00:01:48,000 --> 00:01:50,380 I mean, it works really well, but it's kind of annoying. 30 00:01:50,540 --> 00:01:51,800 Their helm is force feedback. 31 00:01:51,800 --> 00:01:52,480 It's all CAN bus. 32 00:01:52,480 --> 00:01:56,320 It's kind of cute, but like you're in this for a lot of money now. 33 00:01:56,920 --> 00:02:03,520 So the reason you don't see companies doing autonomy and doing open buses is largely legal exposure. 34 00:02:03,600 --> 00:02:11,140 They both don't want you to warrant, don't want you to make warranty claims on the engines and don't want you killing people, quite frankly, accidentally. 35 00:02:11,400 --> 00:02:15,560 So let's talk more about inboard and IO. 36 00:02:15,560 --> 00:02:18,960 IO is sort of an odd one, but I've spent a bunch of time wrenching on IO. 37 00:02:18,960 --> 00:02:21,280 So I thought they deserved mention here. 38 00:02:21,560 --> 00:02:28,700 So the major manufacturers, they are Yanmar, Mercury, Cummins, Volvo, MTU, CAT. 39 00:02:29,000 --> 00:02:32,600 Caterpillar is notoriously locked down with their protocols. 40 00:02:32,600 --> 00:02:35,160 Like they will charge you out the wazoos. 41 00:02:35,160 --> 00:02:42,720 And a lot of what we're seeing in tractors with John Deere and the general hatred of them is very similarly reflected in Caterpillar. 42 00:02:42,720 --> 00:02:44,640 So here we've got a picture of an IO. 43 00:02:44,640 --> 00:02:47,240 It's basically the worst of both possible worlds. 44 00:02:47,380 --> 00:02:52,260 You have the lower half of an outboard that always stays wet and can't come out of the water and an inboard. 45 00:02:52,780 --> 00:02:55,600 And then you have an inboard engine, which is a straight driveline. 46 00:02:55,600 --> 00:02:57,480 There are a bunch of options there. 47 00:02:57,660 --> 00:02:59,980 So let's talk a little bit more about these. 48 00:02:59,980 --> 00:03:01,500 These are a little bit weirder. 49 00:03:02,520 --> 00:03:06,220 They're a lot less technically sophisticated than most modern outboards. 50 00:03:06,220 --> 00:03:08,060 This is for a variety of reasons. 51 00:03:08,740 --> 00:03:10,800 Manufacturers are way less vertically integrated. 52 00:03:10,800 --> 00:03:16,440 I mean, CAT makes a ton of engines for a ton of people, but their marine market isn't huge. 53 00:03:17,260 --> 00:03:20,640 The legacy control systems is really what people are trying to support. 54 00:03:20,640 --> 00:03:25,460 When I say legacy, I mean cables, like push-pull cables for throttle and shift. 55 00:03:26,820 --> 00:03:29,300 Let's say you bought yourself a nice Nordhavn yacht. 56 00:03:29,300 --> 00:03:30,840 You've really won the lottery. 57 00:03:30,840 --> 00:03:34,060 It's probably gonna come equipped with a helm. 58 00:03:34,060 --> 00:03:36,320 So you push the throttle forward. 59 00:03:36,320 --> 00:03:42,420 It's gonna send an electrical signal, either analog or CAN, to a box that moves a servo that pulls a cable. 60 00:03:42,420 --> 00:03:44,780 And then the engine go faster. 61 00:03:45,040 --> 00:03:49,860 The engine may have stuff like electronic throttle bodies. 62 00:03:49,900 --> 00:03:54,940 And actually, if you come to Maritime Hacking Village and plugs to come by the Maritime Hacking Village, it's super cool. 63 00:03:54,940 --> 00:03:57,180 We've got some great stuff, including boats with outboards. 64 00:03:57,280 --> 00:03:58,860 They didn't let me run them here. 65 00:04:00,180 --> 00:04:06,640 One of those motors is a Honda 150 that has a cable-driven electronic throttle body. 66 00:04:06,640 --> 00:04:10,860 So it's super weird, but it's basically a legacy support for a modern engine. 67 00:04:10,860 --> 00:04:12,560 There's an ECU on the motor. 68 00:04:13,280 --> 00:04:15,880 So these are way less sophisticated. 69 00:04:15,880 --> 00:04:17,460 They're made in way less volume. 70 00:04:17,460 --> 00:04:19,140 They're expecting legacy systems. 71 00:04:19,140 --> 00:04:21,840 So let's dive into those control systems. 72 00:04:22,560 --> 00:04:26,940 But outboards have significantly complex engine management. 73 00:04:27,100 --> 00:04:29,420 This Helm Master is from Yamaha. 74 00:04:29,420 --> 00:04:34,220 And I'm personally less familiar with Yamaha than other brands, but you've got a joystick there. 75 00:04:34,220 --> 00:04:37,980 So when you enable joystick mode, it can do GPS. 76 00:04:38,140 --> 00:04:48,200 So if you have four engines, for instance, it's gonna do some intelligent leader-follower stuff with the engines, because you probably only have two Helms rather than four. 77 00:04:48,200 --> 00:04:50,940 We're getting away from the sort of 747 style. 78 00:04:50,940 --> 00:04:53,160 I have six joysticks, I need to move them forward. 79 00:04:53,180 --> 00:04:55,360 That's all going out the window because digital. 80 00:04:55,660 --> 00:05:06,400 They're moving to CAN bus straight to the Helm, which is where some of my research starts to fall off because I need to go buy a digital Helm and hook it up to a digital motor, which I'll do eventually. 81 00:05:07,000 --> 00:05:21,800 Station keeping, say Virtual Anchor or Skyhook are these proprietary products that we as control systems folks sort of know about already, but they're being packaged and commoditized by Mercury, by Yamaha, and there's a big button that says, keep my boat in one place. 82 00:05:21,800 --> 00:05:28,100 And then it will use GPS, CAN bus, and advanced engine and steering control to try to do that. 83 00:05:28,120 --> 00:05:34,100 But these are all giant black boxes and they will absolutely not tell you how any of this works no matter who you are. 84 00:05:34,760 --> 00:05:37,320 They do not let Garmin do it, for instance. 85 00:05:38,780 --> 00:05:41,080 We talked legacy control systems. 86 00:05:41,080 --> 00:05:44,820 So that is an actual product from Glendinning. 87 00:05:44,940 --> 00:05:46,600 And we can talk more about them later. 88 00:05:46,600 --> 00:05:48,200 That literally pushes and pulls the cables. 89 00:05:48,200 --> 00:05:51,140 It sounds dumb, but that's a servo box that does that. 90 00:05:51,140 --> 00:05:53,660 And I don't know, I think that's like $1,600 or $1,700. 91 00:05:54,000 --> 00:05:55,020 It's very rugged. 92 00:05:55,020 --> 00:05:56,780 They have a bajillion hours on them. 93 00:05:56,780 --> 00:05:57,820 It will work. 94 00:05:57,820 --> 00:06:04,200 We'll also get into how to hack these guys for extra bonus points, because they won't tell you and their docs are terrible. 95 00:06:04,400 --> 00:06:07,080 Sorry, I'm going to actually name names in this presentation. 96 00:06:07,080 --> 00:06:08,700 If you're from Mercury, I apologize. 97 00:06:08,700 --> 00:06:09,920 I'll buy you a drink later. 98 00:06:10,880 --> 00:06:16,560 So a lot of modern ECUs, we talked about the ECUs being on the engine and controlling the actual firing sequence. 99 00:06:16,560 --> 00:06:21,360 Those are getting upgraded due to emissions concern, like tier four emissions, stuff like that. 100 00:06:21,360 --> 00:06:24,640 That's government mandated, but the interface itself is not. 101 00:06:25,160 --> 00:06:27,120 So cable-driven systems, still super common. 102 00:06:27,120 --> 00:06:31,640 If you're going to go out and buy a motor on Craigslist, it's probably going to be cable-driven. 103 00:06:32,480 --> 00:06:38,900 I can speak to a little bit of the Navy, US Navy autonomy looks for cable-driven motors because they use this exact setup. 104 00:06:39,420 --> 00:06:44,840 People that make these systems, Glendinning controls, C-Star is a name we'll come back to. 105 00:06:44,840 --> 00:06:46,540 So that's C-Star Dometic. 106 00:06:46,540 --> 00:06:50,020 They got bought out by, I think they're Danish, Dometic. 107 00:06:50,020 --> 00:06:52,980 They make refrigerators and campers and other stuff too. 108 00:06:53,040 --> 00:06:57,560 ZF micro commander, weird Zeppelin fact, because Zeppelin facts are awesome. 109 00:06:57,560 --> 00:07:01,140 ZF is the only surviving company that made original equipment for Zeppelins. 110 00:07:01,140 --> 00:07:03,060 And that's what the Z stands for. 111 00:07:03,080 --> 00:07:09,240 So NHK, which I haven't personally worked with, but same, same, you move a handle and servos move. 112 00:07:09,700 --> 00:07:11,780 Let's talk about hacking jet skis. 113 00:07:11,780 --> 00:07:17,440 I have a theory about jet skis that whenever anybody gets on them, they immediately become a jerk. 114 00:07:17,520 --> 00:07:19,180 No matter how nice they are. 115 00:07:19,180 --> 00:07:21,320 I have suffered from this myself. 116 00:07:23,200 --> 00:07:26,640 So honestly, the biggest hack I have here is read the manual. 117 00:07:26,640 --> 00:07:27,920 Like, I'm not kidding. 118 00:07:27,920 --> 00:07:30,080 We'll get into the actual manual pages in a second. 119 00:07:30,080 --> 00:07:33,700 And I realized this is an eye chart, but we will dive in deeper. 120 00:07:33,700 --> 00:07:38,300 So this is the master wiring diagram for a 2022 Sea-Doo. 121 00:07:38,320 --> 00:07:40,560 It was just the one I had handy. 122 00:07:40,740 --> 00:07:43,260 Yamaha is similar, similar enough. 123 00:07:43,260 --> 00:07:49,460 What this is showing you is that that's the throttle and it has two hall effects, which are basically digital voltage dividers. 124 00:07:49,600 --> 00:07:52,220 That's an OEM part they're buying from someone. 125 00:07:52,440 --> 00:07:55,680 So that's how to find out what it's looking for. 126 00:07:56,040 --> 00:08:02,320 And then you read the manual and it tells you how to tone it out because this is all designed for depot level maintenance. 127 00:08:02,320 --> 00:08:03,300 Stick a multimeter on it. 128 00:08:03,300 --> 00:08:04,320 How does it work? 129 00:08:04,960 --> 00:08:08,940 So the ECU is doing the digitizing from the command input. 130 00:08:08,940 --> 00:08:10,960 When I squeeze the throttle, I want to go faster. 131 00:08:10,960 --> 00:08:12,940 Two hall effect sensors are outputting voltage. 132 00:08:13,320 --> 00:08:14,120 ECU is reading it. 133 00:08:14,120 --> 00:08:20,340 ECU is then sending either CAN or analog to the throttle bodies and the reverser and the reverse bucket. 134 00:08:20,340 --> 00:08:22,400 And it's managing all that behind the scenes. 135 00:08:22,860 --> 00:08:29,060 So we see from this graph here, and to shout if you can't see, also the slides are available. 136 00:08:30,040 --> 00:08:37,280 We basically see it's just looking for two ratio metric voltages between, you know, what is it? 137 00:08:38,200 --> 00:08:40,780 0.15 and 1.4. 138 00:08:40,780 --> 00:08:43,420 Like making these really isn't that hard. 139 00:08:43,420 --> 00:08:52,440 You like digipots are a thing, but also you can get DACs that will take PWM and output actual honest to God voltages. 140 00:08:53,960 --> 00:08:56,120 Slew rates, you should check beforehand. 141 00:08:56,120 --> 00:08:57,640 Like don't rack these around. 142 00:08:57,940 --> 00:09:01,700 Try to emulate what a human would do as a rate of change. 143 00:09:01,700 --> 00:09:07,480 Now do also keep in mind, jet skis specifically are designed to be driven by the lowest common denominators. 144 00:09:07,480 --> 00:09:11,280 They're expecting somebody to do that and the ECU to not error out. 145 00:09:11,480 --> 00:09:14,680 Honestly, jet skis are really easy to autonomate. 146 00:09:15,440 --> 00:09:16,800 Be careful though, please. 147 00:09:16,800 --> 00:09:19,320 They go fast and they get away from you quickly. 148 00:09:19,360 --> 00:09:24,640 But the TLDR from this slide is, look for the voltages and then make them and just make the voltages. 149 00:09:24,640 --> 00:09:31,220 And we'll get into the right hardware and like the right place in the stack to do that and the appropriate hardware to do it. 150 00:09:31,300 --> 00:09:33,800 But let's talk about Mercury DTS. 151 00:09:33,900 --> 00:09:36,740 So DTS is a significantly more complex architecture. 152 00:09:36,740 --> 00:09:38,080 I know this is another eye chart. 153 00:09:38,080 --> 00:09:40,520 I pulled this out of the Mercury Verado manual. 154 00:09:40,520 --> 00:09:43,040 I think this is a 2020 engine. 155 00:09:43,560 --> 00:09:46,660 DTS-1 is Mercury's architecture pre-2022. 156 00:09:46,740 --> 00:09:52,080 DTS-2, they moved to CAN coming out of the helm itself. 157 00:09:52,420 --> 00:09:55,320 This is the one I need to go by and hack on. 158 00:09:56,240 --> 00:10:07,560 Once you start scaling into multiple motors, multiple helms, so let's say you've got a flybridge, a rear control station, a forward control station, this diagram becomes absolute spaghetti. 159 00:10:07,560 --> 00:10:12,720 The takeaway is you need multiple command modules, which is what Mercury is calling them here. 160 00:10:12,720 --> 00:10:14,100 We're gonna zoom in in a second. 161 00:10:14,100 --> 00:10:16,540 Don't worry if you can't read it. 162 00:10:16,720 --> 00:10:22,300 Mercury has at least two CAN buses that are off engine that are giving these commands. 163 00:10:22,520 --> 00:10:25,700 Honestly, we're not even gonna bother to reverse engineer those. 164 00:10:25,700 --> 00:10:28,280 We don't have to, like why make our lives hard? 165 00:10:28,580 --> 00:10:34,620 So Mercury's philosophy sort of divides into these three abstraction layers. 166 00:10:35,140 --> 00:10:41,780 Engine space, where each engine doesn't know anything about the other engines, and it's a very traditional ECU. 167 00:10:41,820 --> 00:10:46,300 So that's, again, controlling piston firing, dynamic timing, water pumps. 168 00:10:46,300 --> 00:10:48,040 If it gets too hot, it's gonna shut it down. 169 00:10:48,180 --> 00:10:50,920 All of that is contained on each engine. 170 00:10:50,920 --> 00:10:52,040 So that's engine space. 171 00:10:52,040 --> 00:10:56,880 Then you have boat space, which is where these command module thingies come into play. 172 00:10:57,380 --> 00:10:59,520 Boat space knows about the boat. 173 00:10:59,520 --> 00:11:01,020 It knows about how many motors it has. 174 00:11:01,020 --> 00:11:06,860 It knows that the port, starboard, center engines, anything like that. 175 00:11:07,040 --> 00:11:20,920 And that will then translate user space, which is the user intention of, I want to go forward fast now, please, into, okay, you engines need to go fast and you need to not go fast, for instance. 176 00:11:21,100 --> 00:11:24,200 User space is the helm. 177 00:11:24,240 --> 00:11:28,940 If you read the diagram, again, they're really just showing us how it works. 178 00:11:29,100 --> 00:11:33,820 It's looking per throttle handle, it's looking for three voltages that move in tandem. 179 00:11:34,820 --> 00:11:43,540 So those three dotted, those three lines of varying dash types on the chart, tell us what those are. 180 00:11:43,540 --> 00:11:47,360 And in this case, they've abstracted reverse away a little bit too. 181 00:11:47,360 --> 00:11:53,120 So unlike the CDU where you have a separate trigger when like, I need to pull this, then pull that to go backwards. 182 00:11:53,520 --> 00:11:56,620 Mercury just basically says, I have plus 100, which is forward. 183 00:11:56,620 --> 00:11:59,380 I have zero and I have minus 100, which is all back. 184 00:11:59,880 --> 00:12:10,240 If you had a system that had a non zero neutral point, like a bucket, a jet ski bucket, for instance, doesn't go down all the way to keep you still. 185 00:12:10,240 --> 00:12:12,340 It goes down all the way for full reverse. 186 00:12:12,500 --> 00:12:14,380 This is where to abstract it away. 187 00:12:14,660 --> 00:12:18,160 So to replicate these, you just need three decks. 188 00:12:18,160 --> 00:12:19,360 Like this sounds dumb. 189 00:12:19,360 --> 00:12:23,660 And honestly, the hardest part of this is finding the active connector that plugs into this. 190 00:12:23,660 --> 00:12:26,660 I think it's a GTS 150, but don't hold me to that. 191 00:12:26,660 --> 00:12:29,080 We can talk later if you really want the connectors. 192 00:12:29,080 --> 00:12:30,940 I've written up on GitLab somewhere. 193 00:12:31,700 --> 00:12:37,660 DTS two, I'm going to open up a throttle binnacle and just see what, again, it's going to be a hall effect. 194 00:12:37,660 --> 00:12:43,360 Maybe the hall effect is potted under epoxy on the board or something dumb, but I suspect it's not. 195 00:12:43,600 --> 00:12:47,440 And we're going to cut the traces or cut the wires and figure out what we do. 196 00:12:47,500 --> 00:12:49,280 So does this all make sense so far? 197 00:12:49,920 --> 00:12:50,700 Great. 198 00:12:50,860 --> 00:12:52,560 So hacking Glendinning. 199 00:12:52,560 --> 00:12:55,260 This is again, basically the same deal. 200 00:12:55,420 --> 00:13:01,500 So Glendinning uses proprietary CAN and it's not even a standard 1939, which is really annoying. 201 00:13:01,500 --> 00:13:04,600 So the standard decode tools for 1939 don't work for this. 202 00:13:04,640 --> 00:13:05,460 Don't try it. 203 00:13:05,460 --> 00:13:06,680 It's just not even worth it. 204 00:13:07,220 --> 00:13:08,800 You take the helm apart. 205 00:13:09,020 --> 00:13:13,440 Honestly, it's mostly like really nicely machined detents for the handles. 206 00:13:13,440 --> 00:13:16,420 When you move them back and forth, it has a really nice user feel. 207 00:13:16,860 --> 00:13:19,820 And then it's just a hall effect sensor on a magnet. 208 00:13:19,820 --> 00:13:21,840 You're like, wow, that's it? 209 00:13:22,040 --> 00:13:23,880 And it is, it turns out. 210 00:13:24,060 --> 00:13:31,280 There's some other CAN stuff in there, like idle and fast idle, but yeah, the lever is just a magnet and a hall effect. 211 00:13:31,440 --> 00:13:35,380 So take it apart and then you put it on a scope. 212 00:13:35,400 --> 00:13:43,000 Again, the only real advice I have here is because of how this worked, a meter was not high enough impedance to figure out what it was doing. 213 00:13:43,000 --> 00:13:44,480 So you had to put it on a two channel scope. 214 00:13:44,480 --> 00:13:46,360 Like that was as complicated as this was. 215 00:13:46,360 --> 00:13:49,240 This took about, I don't know, an afternoon. 216 00:13:49,240 --> 00:13:50,880 And that was including a lunch break. 217 00:13:51,500 --> 00:13:56,580 They also divide it into user space or user intention, boat space, these command modules. 218 00:13:56,580 --> 00:13:58,640 I think they call them CP modules here. 219 00:13:58,640 --> 00:14:01,700 And again, this is very brand specific. 220 00:14:01,760 --> 00:14:04,080 The CP module can control multiple engines. 221 00:14:04,080 --> 00:14:10,580 It knows what CAN ID engines are which, and you'll just buy it pre-configured from them if you really want to. 222 00:14:10,700 --> 00:14:16,760 So that's how to control or a control strategy for cable driven motors. 223 00:14:17,060 --> 00:14:22,760 So notable exceptions, Torquedo is well understood if finicky. 224 00:14:23,420 --> 00:14:30,600 Their code is now included in mainline ArduPilot which is awesome that the ArduPilot community got that together, like props to them. 225 00:14:30,980 --> 00:14:32,640 It's RS-485. 226 00:14:32,640 --> 00:14:34,300 It involves a whole bunch of handshakes. 227 00:14:34,300 --> 00:14:37,940 It's a giant pain, but like, okay, you can make it work. 228 00:14:39,060 --> 00:14:43,160 I can't really recommend Torquedo if you want electric power plants. 229 00:14:43,160 --> 00:14:45,140 Five years ago, yeah, sure, absolutely. 230 00:14:45,140 --> 00:14:46,600 They were probably your only option. 231 00:14:46,600 --> 00:14:48,340 Now there are other options. 232 00:14:48,480 --> 00:14:49,700 Go find them. 233 00:14:50,060 --> 00:14:55,960 Cox Marine who makes diesel outboards out of the UK just sends you the J1939 ICD. 234 00:14:55,960 --> 00:14:56,920 You just ask them nicely. 235 00:14:56,920 --> 00:14:58,100 You don't even have to sign an NDA. 236 00:14:58,100 --> 00:14:58,880 It's great. 237 00:14:58,880 --> 00:15:01,840 I would happily buy their motors just based on that alone. 238 00:15:01,860 --> 00:15:06,080 Whereas Mercury Brunswick has actually told me to not give this talk at a different venue. 239 00:15:07,080 --> 00:15:10,260 So we're here and this is DEF CON and that's how this works. 240 00:15:11,500 --> 00:15:13,160 Cox is really cool. 241 00:15:13,360 --> 00:15:25,400 And I haven't used their motors, but diesel outboards are a real subset of, subset of outboards that's rapidly becoming more in demand as DoD basically says, like, you must have diesel, we don't care. 242 00:15:25,400 --> 00:15:28,260 Not that it like makes no sense, but okay. 243 00:15:29,600 --> 00:15:32,140 So how do you interface this with an autopilot? 244 00:15:32,140 --> 00:15:37,920 And in this case, we're gonna refer to autopilots, not in the Marine sense of like, you push a button and it tracks a line. 245 00:15:38,060 --> 00:15:42,500 It's gonna be more the sense of a flight controller. 246 00:15:42,500 --> 00:15:48,640 And obviously like our boats aren't taking flight, but the terminology from ArduPilot is flight controller, FMU. 247 00:15:48,780 --> 00:15:52,000 So I messed around with PLCs a bit for this. 248 00:15:52,000 --> 00:15:54,040 And PLCs seem like a really obvious answer. 249 00:15:54,040 --> 00:15:57,160 Like you wanna make voltages, you want them to be ultra reliable. 250 00:15:57,640 --> 00:16:00,060 You know, you want them to be super auditable. 251 00:16:00,120 --> 00:16:01,960 I like PLCs to be clear. 252 00:16:01,960 --> 00:16:05,080 I have some background in Siemens stuff, although it's been a while. 253 00:16:06,300 --> 00:16:08,800 I tried to get this to work over MQTT. 254 00:16:08,800 --> 00:16:22,100 That seemed like a really cool way to do it, of put it on a normal IP network, have something like MavProxy on a Pi, just output MQTT messages from MavLink, just translate MavLink messages. 255 00:16:22,100 --> 00:16:23,920 And this is all MavLink specific. 256 00:16:24,600 --> 00:16:26,160 Your mileage may vary. 257 00:16:26,220 --> 00:16:29,560 So MavLink to MQTT worked great. 258 00:16:29,840 --> 00:16:33,080 Receiving the MQTT messages on the PLC did not. 259 00:16:33,160 --> 00:16:35,720 There were rate limits that were not documented. 260 00:16:35,720 --> 00:16:38,220 There were on-off stuff that just didn't work. 261 00:16:38,240 --> 00:16:40,980 It just, it doesn't work well, at least with AutomationDirect. 262 00:16:40,980 --> 00:16:43,140 And I like AutomationDirect a great deal. 263 00:16:43,140 --> 00:16:44,520 They're a super awesome company. 264 00:16:44,520 --> 00:16:49,340 Props to them for having 3D models, 2D models, ICDs on their website. 265 00:16:49,340 --> 00:16:51,040 So this isn't a them problem. 266 00:16:51,040 --> 00:16:54,260 I mean, it's trying to pack all this onto an STM32 problem. 267 00:16:54,440 --> 00:16:58,680 So could you write one if you were a PLC expert? 268 00:16:58,680 --> 00:16:59,340 Yeah, probably. 269 00:16:59,340 --> 00:17:01,740 If that's your chosen religion, like sure. 270 00:17:02,240 --> 00:17:05,760 You could digitize the PWM signals coming out of your flight controller. 271 00:17:05,760 --> 00:17:09,100 That's sort of the most basic way to do this. 272 00:17:09,140 --> 00:17:15,620 Those are, when I say PWM, it's the PWM hobby servo space. 273 00:17:15,620 --> 00:17:16,840 It's super well understood. 274 00:17:16,840 --> 00:17:19,880 It's basically a time pulse and then a gap and then another time pulse. 275 00:17:20,360 --> 00:17:24,720 And the length of that time pulse is your desired servo output. 276 00:17:25,180 --> 00:17:27,540 Could you have a time counter on a PLC do this? 277 00:17:27,540 --> 00:17:28,740 Yeah, of course you could. 278 00:17:30,200 --> 00:17:33,340 It just wasn't worth it to me to write custom serial stuff, basically. 279 00:17:33,340 --> 00:17:34,720 So I just spun my own boards. 280 00:17:36,000 --> 00:17:37,440 Refresh speed is not a factor. 281 00:17:37,440 --> 00:17:40,060 I used a Teensy, shout out to PJRC. 282 00:17:40,060 --> 00:17:40,820 He's awesome. 283 00:17:40,820 --> 00:17:43,960 I didn't interact with him for this, but like what he brings to the community is amazing. 284 00:17:44,100 --> 00:17:53,440 So I just used a Teensy, added a bunch of peripheral hardware to it and have it either listen to the pulse widths or Mavelink over serial. 285 00:17:53,440 --> 00:17:54,860 Like, honestly, it's not that hard. 286 00:17:54,860 --> 00:17:56,180 It's like 500 lines of code. 287 00:17:56,180 --> 00:17:57,620 I'm not a software developer. 288 00:17:57,620 --> 00:17:58,960 You don't want me writing code. 289 00:17:58,960 --> 00:18:01,840 So the fact I was able to make this work says it's actually pretty easy. 290 00:18:03,060 --> 00:18:06,920 You're gonna spend a bunch of time like with an engine diagnostic tool. 291 00:18:06,920 --> 00:18:21,520 And if you want to get into this, the best device I can give you is buy an engine diagnostic tool, either from the manufacturer or one of the third party ones that plugs into the engine bus and at least sees what the commands are so you can ground truth what your hardware is doing. 292 00:18:21,600 --> 00:18:23,660 That will save you a lot of time. 293 00:18:23,660 --> 00:18:27,080 Otherwise, you're just gonna get strange errors and beeps and you won't be able to reset them. 294 00:18:27,080 --> 00:18:31,720 And the number of Yamaha beeps I've heard in my life is far too many at this point. 295 00:18:31,720 --> 00:18:34,420 So let's talk through that diagram just real quick. 296 00:18:34,420 --> 00:18:36,420 So that's coming out of the flight controller. 297 00:18:37,860 --> 00:18:42,640 Mavelink or PWM or whatever you want, I guess, but those are the two I would recommend. 298 00:18:42,640 --> 00:18:49,480 This engine translator piece of hardware that you all will have designed if this is the way you want to go. 299 00:18:49,740 --> 00:18:54,780 And then you can talk to each ECU over application-specific analogs. 300 00:18:55,000 --> 00:19:02,780 And honestly, the big letdown of this talk is I'm not telling you to reverse engineer Mercury's 12 different CAN buses because also they're gonna change it out from under you. 301 00:19:02,780 --> 00:19:08,180 It's just intervene at the user space level and this will all be fairly easy. 302 00:19:08,440 --> 00:19:12,780 It would make sense if you want to keep your variables to keep signed eight bits. 303 00:19:13,640 --> 00:19:17,380 255 minus 254, zero, the same as Merck was doing. 304 00:19:17,380 --> 00:19:24,600 It basically makes the translation of when you get a command to what you want to do with that command to output a lot simpler in code. 305 00:19:24,840 --> 00:19:31,600 So that's the big reveal here is this isn't that complicated if you just break open stuff and pretend to be the user. 306 00:19:33,100 --> 00:19:34,620 And it works. 307 00:19:34,620 --> 00:19:36,180 It works reliably. 308 00:19:36,420 --> 00:19:38,320 So I've got some time for questions. 309 00:19:38,320 --> 00:19:40,240 I threw a lot out there and it was really fast. 310 00:19:40,240 --> 00:19:45,640 If you want to go back to any areas, please, I'm in the Maritime Hacking Village, which is awesome. 311 00:19:45,640 --> 00:19:46,680 It's my first DEF CON. 312 00:19:46,680 --> 00:19:48,940 So forgive me for talking fast and nervous. 313 00:19:49,300 --> 00:19:50,840 Come to Maritime Hacking Village. 314 00:19:50,840 --> 00:19:53,620 We have some boats, we have some engines. 315 00:19:53,920 --> 00:19:55,540 It's super cool. 316 00:19:55,540 --> 00:19:59,560 So we've got like five minutes for questions, exactly five minutes for questions. 317 00:19:59,560 --> 00:20:06,300 So after that great disappointment of just intervene with analog voltages, fire away. 318 00:20:10,560 --> 00:20:12,960 Someone must have a question here. 319 00:20:14,240 --> 00:20:15,680 Please, thank you. 320 00:20:27,230 --> 00:20:32,850 I do, unfortunately, and I hate it, but like, yeah, let's roll back to Yamaha. 321 00:20:32,990 --> 00:20:39,210 Like this is now the way they're going to, eventually they will stop selling cable driven like legacy support motors. 322 00:20:39,210 --> 00:20:40,510 And like, that's not great. 323 00:20:40,930 --> 00:20:46,370 And the wiring harness alone to rig one of these is over a thousand bucks new. 324 00:20:47,090 --> 00:20:48,450 That is the way it's going to go. 325 00:20:48,450 --> 00:20:53,910 And you're going to have to call your Yamaha rep and say like, I need a new thing and you won't be able to buy it yourself. 326 00:20:53,910 --> 00:20:57,770 And like, that's a world I personally don't want to live in, but yeah, it's going that way. 327 00:20:57,770 --> 00:20:59,810 I don't know what to do about it, but it is. 328 00:21:00,110 --> 00:21:01,470 Great question, thank you. 329 00:21:01,930 --> 00:21:03,030 Yeah, John Deere sucks. 330 00:21:04,770 --> 00:21:07,490 They do unfortunately make marine power plants too. 331 00:21:07,810 --> 00:21:10,450 I just haven't encountered any of them. 332 00:21:10,450 --> 00:21:12,070 Any other questions, please? 333 00:21:12,290 --> 00:21:13,430 Sir, thank you. 334 00:21:26,260 --> 00:21:39,780 Yeah, so that's sort of the whole, like the whole crux of this is, A, I'm not a particularly talented CAN reverse engineer and they're probably doing non-standard binary stuff that's really, really hard to track down. 335 00:21:40,520 --> 00:21:46,000 And this was like, this is sort of the afternoon level hacking and it works. 336 00:21:46,720 --> 00:21:57,740 I would say it's harder, but more hardware elegant to just modify the CAN packets, but you're gonna have to spend a lot of time listening to them and a lot of time with like very known states. 337 00:21:57,780 --> 00:22:01,900 And you're going to have a lot of jumpy data in that, that you're gonna be trying to decode as binaries. 338 00:22:01,900 --> 00:22:08,840 And I'm not saying don't throw an LLM at it cause that might actually work, but it's gonna be hard. 339 00:22:08,840 --> 00:22:10,760 It's not gonna take you an afternoon for sure. 340 00:22:12,000 --> 00:22:15,440 So my thought is just keep the Mercury stuff, Mercury stuff. 341 00:22:15,440 --> 00:22:18,940 And if they want to do engine synchronization in whatever weird way they're doing it, I don't care. 342 00:22:20,580 --> 00:22:21,260 Please. 343 00:22:24,240 --> 00:22:24,960 Cool. 344 00:22:26,760 --> 00:22:29,480 You should all buy a maritime hacking village badge cause it's super cool. 345 00:22:29,480 --> 00:22:34,740 And it can interface on 0183 and 2000 and should have arbitrary voltage outputs. 346 00:22:34,740 --> 00:22:37,080 And I don't know, I flashed a bunch of them, but I don't really know how they work. 347 00:22:37,240 --> 00:22:39,280 So those are super cool badge again. 348 00:22:39,900 --> 00:22:43,820 Thanks to maritime village for hacking, having me and thanks to DEF CON. 349 00:22:43,820 --> 00:22:45,620 Any other questions, please throw it out there. 350 00:22:45,620 --> 00:22:46,600 Those were great questions. 351 00:22:46,600 --> 00:22:47,820 Thank you, sir. 352 00:23:10,070 --> 00:23:11,290 Short answer, yes. 353 00:23:11,510 --> 00:23:13,050 It's easier than it looks. 354 00:23:20,430 --> 00:23:22,790 There is some subtlety to it. 355 00:23:22,790 --> 00:23:28,050 Like outputting PWM directly from microcontroller will probably yield unknown results. 356 00:23:28,050 --> 00:23:29,710 I put it through a DAC. 357 00:23:29,710 --> 00:23:34,710 So a PWM based DAC that has proper like voltage reference ratio metrics. 358 00:23:34,710 --> 00:23:37,430 All of these are like two, $3 hardware. 359 00:23:37,430 --> 00:23:40,710 But yeah, again, that's the terrible disappointment of this talk. 360 00:23:44,750 --> 00:23:45,430 Yeah. 361 00:23:45,970 --> 00:23:48,330 You could do it with analog if you wanted to. 362 00:23:48,330 --> 00:23:50,230 Yeah, sir, please. 363 00:24:00,640 --> 00:24:02,760 Ford has a really impressive system. 364 00:24:02,760 --> 00:24:11,560 Like that uses a whole bunch of cameras and lidars and basically you like, you turn the knob and your F250 will do like the inverse kinematics for the trailer. 365 00:24:11,580 --> 00:24:13,000 It's really sexy. 366 00:24:13,040 --> 00:24:15,920 It's only available in like the super high end Fords. 367 00:24:15,920 --> 00:24:18,180 Other than that, my only suggestion is practice. 368 00:24:20,000 --> 00:24:22,160 All right, we are at time. 369 00:24:22,160 --> 00:24:25,320 If anybody wants to get together at the hacking village, we have booze. 370 00:24:25,400 --> 00:24:26,240 Thank you.