Every year, more than 30,000 people are killed in motor vehicle accidents in the US, and many many more are injured. Humans, in general, aren’t great drivers. Until dependable self-driving cars make their way into garages and driveways across the country, there is still a great amount of work that can be done to improve the safety of automobiles, and the best hope on the horizon is Vehicle to Vehicle communications (V2V). We keep hearing this technology mentioned in news stories, but the underlying technology is almost never discussed. So I decided to take a look at what hardware we can expect in early V2V, and the features you can expect to see when your car begins to build a social network with the others around it.
With the summer’s big security conferences over, now is a good time to take a look back on automotive security. With talks about attacks on Chrysler, GM and Tesla, and a whole new Car Hacking village at DEF CON, it’s becoming clear that autosec is a theme that isn’t going away.
Up until this year, the main theme of autosec has been the in-vehicle network. This is the connection between the controllers that run your engine, pulse your anti-lock brakes, fire your airbags, and play your tunes. In most vehicles, they communicate over a protocol called Controller Area Network (CAN).
An early paper on this research [PDF] was published back in 2010 by The Center for Automotive Embedded Systems Security,a joint research effort between University of California San Diego and the University of Washington. They showed a number of vulnerabilities that could be exploited with physical access to a vehicle’s networks.
A number of talks were given on in-vehicle network security, which revealed a common theme: access to the internal network gives control of the vehicle. We even had a series about it here on Hackaday.
The response from the automotive industry was a collective “yeah, we already knew that.” These networks were never designed to be secure, but focused on providing reliable, real-time data transfer between controllers. With data transfer as the main design goal, it was inevitable there would be a few interesting exploits.
During the early 1900’s, [Einstein] was virtually at war with quantum theory. Its unofficial leader, [Niels Bohr], was constantly rebutting Einstein’s elaborate thought experiments aimed at shooting down quantum theory as a description of reality. It is important to note that [Einstein] did not disagree with the theory entirely, but that he was a realist. And he simply would not believe that reality was statistical in nature, as quantum theory states. He would not deny, for example, that quantum mechanics (QM) could be used to give a probable location of an electron. His beef was with the idea that the electron doesn’t actually have a location until you try to measure it. QM says the electron is in a sort of “superposition” of states, and that asking what this state is without measurement is a meaningless question.
So [Einstein] would dream up these incredibly complex hypothetical thought experiments with the goal of showing that a superposition could not exist. Now, there is something to be said about [Einstein] and his thought experiments. He virtually dreamed up his relativity theory while working as a patent clerk at the ripe old age of 26 years using them. So when he had a “thought” about something, the whole of the scientific world stopped talking and listened. And such was the case on the 4th of May, 1935.
For many hardware enthusiasts, it’s hard to stop imagining the possibilities of an almighty fablab in our garage — a glorious suite of machines that can make the widgets of our dreams. Over the years, many of us start to build just that, assembling marvelous workbenches for the rest of us to drool over. The question is: “how do we get there?”
Ok, let’s say we’ve got a blank garage. We might be able to pick up a couple of tools and just “roll with it,” teaching ourselves the basics as we go and learning from our mistakes. With enough endurance, we’ll wake up ten years later and realize that, among the CNC mill, lathe, o-scope, logic analyzer, and the graveyard of projects on the shelves–we’ve made it!
Image Credit: [Rupunzell] on EEVBlog
“Just rolling with it,” though, can squeeze the last bits of change out of our wallets–not to mention ten years being a long journey while flying solo the whole time. Hardware costs money. Aimless experimentation, without understanding the space of “what expectations are realistic,” can cost lots of money when things break.
These days, the internet might do a great job of bringing people together with the same interest. But how does it fare in exchanging the technical know-how that’s tied directly to tools of the trade? Can we get the same experience from a chatroom as we might from a few minutes with the local ‘CNC Whisperer’ who can tell us the ins-and-outs about tuning the machine’s PID controllers?
I’d say that we just can’t. “Getting started” in any subject often seems daunting, but we’re at a compounded disadvantage in that the gurus on the forum have some shared implicit knowledge and jargon on the subject that we wont have if we truly are taking our first steps. (Not to fear, though; none of us were born with this stuff!)
Ruling out forums for taking our first baby steps, where can we find the “seasoned gurus” to give us that founding knowledge? It’s unlikely that any coffee shop would house the local hardware guru sippin’ a joe and taking questions. Fear not, though; there are places for hackers to get their sustenance.
When you are a hardware guy and you live in a time of crisis, sooner or later you find yourself working for some casino equipment company. You become an insider and learn a lot about their tricks. I’ve been in touch with that business for about 30 years. I made a lot of projects for gambling machines which are currently in use, and I had a lot of contact with casino people, both owners and gamblers.
Now I’m sure you expect of me to tell you about the tricks they use to make you spend your money. And I will: there are no technical tricks. This isn’t because they are honest people, but because they don’t need it. Mathematics and Psychology do all the work.
Does the risk of gambling pay off? Mathematically speaking, no – but it’s up to you to decide for yourself. One thing is for certain – whether you decide to gamble or not, it’s good to know how those casino machines work. Know thy enemy.
Working with embedded systems usually involves writing code which will interface with hardware. This often means working on the register level. It doesn’t matter if we’re talking about a UART, an analog to digital converter, an LCD controller, or some other gizmo. Sooner or later, you’re going to have to break out the datasheets and figure out how to talk to an external device. To succeed at this you must become a master of bit manipulation.
Hardware designers don’t like wasting space, so modes, settings and other small pieces of information are often stored as packed bits. Our processors usually access things a byte (or a word) at a time, so what is the best way to handle this? Like so many other topics in software engineering, there are multiple ways to skin this cat. In C (and its derivatives) there are two major options: shift and mask, and bit fields.
Microcontrollers existed before the Arduino, and a device that anyone could program and blink an LED existed before the first Maker Faire. This might come as a surprise to some, but for others PICs and 68HC11s will remain as the first popular microcontrollers, found in everything from toys to microwave ovens.
Arduino can’t even claim its prominence as the first user-friendly microcontroller development board. This title goes to the humble Basic Stamp, a four-component board that was introduced in the early 1990s. I recently managed to get my hands on an original Basic Stamp kit. This is the teardown and introduction to the first user friendly microcontroller development boards. Consider it a walk down memory lane, showing us how far the hobbyist electronics market has come in the past twenty year, and also an insight in how far we have left to go.