Welcome back to another episode of the 21st century anarchist Thanks so much for your guys's patience and understanding as I've mentioned before. I am in the middle of Very big transition in my life. We just finished moving our business We are in the process of moving out of state. So in the meantime, we're actually living in my parents home so making the time and space to Create as many episodes as I want is has been very very challenging. So I appreciate you guys hanging in there Today I want to bring to you an episode on intellectual property and probably the foremost Libertarian that deals with this topic is Stefan Concella Many of you have probably heard of him a very interesting conversation. I think everyone's going to learn something from this So I hope you enjoy All right on the phone. I have Stefan Concella. He is the author of Against Intellectual Property He's a intellectual property attorney Stefan, thanks for joining us today Glad to be your Herman so you know as a libertarian libertarian for most of my adult life and you know anarchist probably for a lot less than that but even so I've noticed that Intellectual property is one of those things that not a lot of people Have thought about they don't sit around ruminating about intellectual property Have you found that to be the case or do you usually have to start from scratch when you come across? You know your regular run of the mill libertarian to some degree a little bit less though in recent years and a lot of the the Libertarian groups I attend and associate with IP and ultra property or IP has gotten More and more attention people have been debating it more and more over the last 10 years. So A lot of people had kind of assumed Things about it. They didn't know much about it, but they took it for granted that it was Some type of law that was roughly some type of capitalist or free market type of law And when it started being challenged by a lot of libertarians like people like me and others Then people started getting worked up and trying to defend it Especially people that thought that think their lives and their livelihoods depend upon it So you started getting a lot of authors and people that are creator types and inventors and Certain types of libertarians like objectivists and randians started Trying to marshal defenses of it more and more but by and large. I find that almost no one even people that argue for it Really understand IP. I am an IP attorney I've been doing it for over 20 years and it is an extremely complicated and arcane and narrow body of law and it's very boring and In my experience almost no one really understands The details of patent law and copyright law Pretty much except for patent attorneys and copyright attorneys Well, that's just good news for them, right? That means a lot of business there that the only ones that can You know translate it Correct and surprisingly 99 of them support IP law because it pays the bills and they have a lock on this narrow specialty area of law and But the interesting thing is, you know, I'll often get a libertarian And I am opposed to IP and I can explain why I am a patent attorney and You know, I used to be in favor of it as a young libertarian But about 20 years ago. I changed my mind after learning more about it And I've been sort of fighting against it ever since in the libertarian Area, but what's interesting to me is I'll often encounter libertarians who will argue vigorously with me and with others and they'll defend this system And I will just point out one abuse or one outrageous application of patent or copyright law after the other and almost every single example you point to they will agree with you They'll say well, I agree, but I don't support that So every routine application of these laws that you can point to they will agree that they don't support that And when you ask them, well, you seem like you don't support current patent and copyright law as they're legislated by the congress So what exactly do you support and they'll say something like well, I'm not an expert. So I don't know So I never know exactly what to argue against with them All right, so let's kind of set the stage here and I know this question would probably require an entire semester Um, you know in law school, but how did we get here? So if you can give us a brief Synopsis or or history of how at least in the united states because I'm sure it varies But how you know, what is IP law based on? I'll be happy to and and you're right about the the time it would take to cover in detail I did a five or six part mesas academy course a couple years ago Which is all my website for free stefanconcella.com where I go into IP theory and all this The common conception of intellectual property is that it's just another type of property right That's how it's sold today patent and copyright are the two main types trademark and trade secret law or other types patent protects in It gives the inventor of a of a new invention. That's a practical device or process A monopoly over that for about 17 years only they can sell it basically or make it And copyrights give the creator of an original work of authorship like a novel or a painting or software or a movie or a song Um, a monopoly over that for about 120 years roughly. Okay life of the author plus 70 years it origin and so everyone thinks of this as a They think of it as a property right now because it's called an intellectual property, right? It's called intellectual property because Unlike other property rights and land and things like that. It's said to Cover objects or things that are created by the intellect by the mind right inventions and Songs and things like that. So it's given that label by its defenders To make it sound like a type of property right Uh, but honestly these things originated Uh patents originated in the practice of governments, you know hundreds of years ago The king's basically selling monopoly rights Selling protectionism to favored court cronies in exchange for favors or money or tax collection duties something like that. So they would say You're the only guy that can sell playing cards in this town Okay, they just gave them a monopoly. It was called a patent a patent means Like an open it's called a letter patent It means it's an open instruction from the king to the community that only this guy can sell playing cards So he was basically just selling monopolies to people Um, this got to be so abusive that the the parliament in england in 1623 passed something called the statute of monopolies to try to reign in the king's power But they were they left in place the ability of the king to grant monopolies for inventions That is, you know unique technical advances and that is the origin of modern Patent law in the u.s. Constitution followed from that So patents basically originated in the practice of the government granting protectionist monopoly protection to Certain people in certain regions of their of their domain copyrights originated when the printing press started emerging and the ability of of people to Publish books started threatening the monopoly that the court of the church and the government had Or what books the scribes would hand copy before that right and what information could be given to the public and so this started threatening their control of information and so the uh the government Established regulations on who could be the official publishers and things like that That eventually morphed into the statute of in and 1710 Which is the origin of modern copyright? So copyright basically originated in the attempt of the church and the state to control thought Basically, it was a type of censorship And it is morphed into a system now where the authors have the right to prevent publication of their works But until recently with the advent of amazon and the internet That right still went back to the publishers and the publishers really were the only way the authors could make things published So they had to sign their rights back over to the publishers or the music industry Etc and so you had the same situation as existed before Around the statute of in time Until until modern times. So basically it's it's like an alliance between the government And certain established interests like the publishing interest, etc That allows them to basically prohibit the publication Of certain ideas or the copying of certain works or the use of certain information For the benefit of certain people And so how do law schools approach this? Do they just start off from the assumption that this is just the way it is or do they even You know analyze any of it the way that you have is it just you just start off from okay? This is ip this is it's necessary and you know, these are the laws and this is how how it works Well, I'd say there's two kind of dominant strands in law school now law school is extremely pragmatic and a practical discipline and therefore law school is heavily imbued with what you can call legal positivism That is the idea that we just take the given law that the government announces as the existing law and we We learn that we learn how to work within it. We take it for granted We don't really criticize it normatively or from the outside. We just take it for granted So they do that so there's a statute The copyright act and there's a patent act and we just take that for granted. Okay, we just learn how that works Then you do talk you have policy issues you talk about whether it makes sense and Nowadays the natural law sort of idea the idea that you come up the reasons For like a higher law justification or criticism of some laws It's sort of lost among lawyers because they're so legal positivistic now so the predominant second idea of law school is this sort of Utilitarian approach or wealth maximization approach It's the idea that we just have to kind of look at all the effects of all these laws And we kind of weigh them in a balancing kind of thing And that's how we decide what laws we should have And they just go with the traditional rationale that was given in favor of these laws What happened was these laws were seen early on By defenders of the free market like let's say in the 1800s early 1800s in america and in europe They were widely seen by free market economists and others as monopolies granted by the state and they were encroachments on the free market And they were heavily criticized Especially patents came under a lot of criticism And there was a movement to abolish them. So the defenders and the interests that had grown up around them and depended upon them Mounted a defense and one of the defenses was well, this is just a natural right as a type of property right So they started calling it intellectual property No one really has ever quite bought that because these rights expire after a certain number of years You know 17 years for patents 120 years for copyright and regular natural rights don't expire So everyone sort of senses that these rights aren't really natural rights So the second argument that they came up with was that well These are necessary to stimulate innovation So it's a utilitarian idea the government can come in and sense that there is a problem with the regular free market That we would have an underproduction of innovation inventions and creative works Because that's a market failure basically that's what their argument effectively is in fact That's in the words in the constitution Which grants congress the power to enact copyright and patent laws which says that Congress has this power You know to promote the progress of science and the arts. So the idea is to promote it. We're going to let People have a temporary monopoly Even though that monopoly is in derogation of the free market So in law schools this rationale is repeated just over and over like we need to have some copyright and patent It can't go too far because that would actually You know Reduce the amount of innovation it would cause disincentives But if you don't have any you don't have enough incentives So we need to fine-tune this and get exactly the right amount of stimulus from the government system to stimulate extra innovation extra creativity and Then they just announce well at 17 years for patents and 120 for copyrights But the funny thing is there are simply no econometric or other studies That prove this whatsoever They don't have any objective basis for the for the numbers. In fact, the number of copyright term was originally 14 years at the founding of the of the country 1790 And it's since been expanded over and over and over again at the at the behest of lobbyists like disney who every time Mickey Mouse is about to go into the public domain They lobby congress like sunny bono copyright act extension, right and they get another 20 years of reprieve for Mickey Mouse To the point now where it's going from 14 to 28 to 56 Now to then to life of the author plus 50 years now life of the author plus 70 And now there's lobbying right now for even more term another 20 years to be tacked on So there's no way you could argue these terms are objective. They're simply the result of basically bribes of The legislature by special interests to keep their monopolies going longer and longer But in law school and among the patent bar and the copyright bar And among the advocates of these systems They repeat this rationale that you need this incentive effect It's a utilitarian argument But they never provide any studies that prove this all the studies in fact that i've seen and i've seen dozens Either or inconclusive they say we just can't figure this out because this is not how human life works We can't know what the effects of these policies are we see some good some bad Or they conclude it looks like copyright is is uh suppressing free speech It looks like patents are suppressing innovation overall They're both costing us in freedom and in creative works and in innovation and inventions and in money right and one need to only Need to look at just the cost involved in a lot of this stuff and it's very clear to see that it's um That these regulations essentially are barriers to entry for a lot of individuals Right, I mean if I want to go out and get a patent Have to hire someone like you and you know pay you a ton of money And who's going to be more likely to be able to to achieve that a large corporation You know crony or or just me you know from inventing something in my garage Well, it's it's uh, yeah the uh the creativeness of the patent bar the special interest is really astounding So they'll come up with natural law arguments natural rights arguments, which make no sense They'll come up with these utilitarian arguments For which they have no empirical Evidence or basis whatsoever and then they will come up with these other things like this the thing that your average person has heard So many times they repeat it like the myth of the small inventor like Without patents the small inventor is at the mercy of these large corporations, right? So everyone sort of believes that the patent system is there to protect the small guy, which is a complete You know, I've been a patent lawyer for since 1993 it's I can tell you it's a complete lie and a complete myth Just like the idea that the minimum wage It's harmful to big corporations. The minimum wage helps the big corporations. They lobby for it. You know walmart Already pays more than the minimum wage. So they're totally in favor of the government raising the minimum wage because it won't Raise their costs at all, but it will raise the cost on some of their competitors, right? So you have these these policies that that are sold like, uh, you know Brewer rabbit going into the briar patch saying oh, please don't do this to me and everyone thinks that Big business is against these laws, but they're not Uh, they actually help them they entrench big big corporations and big big business In their professions in the patent field the way this works is The the cost of acquiring patents is not cheap But big corporations can afford it. They amass very large patent portfolios And they can use these to intimidate Upstarts and newcomers, you know who want to enter into the market and compete with them because they could sue them into oblivion Um, even if none of their patents really apply they could just threaten to do that And the the cost to a small business or a small entrepreneur to defend themselves would be at least a million dollars If not two or three To defend themselves in court and they don't have any money to do that So they they're always afraid to enter the market or they give into pressure They get bought out right away or they get crushed and then they and they get driven into bankruptcy and then the The large company buys up This company absorbs them. So what you have is like in the smartphone area You have a very small number of very large players like uh, samsung and google I'm sorry that google apple voterola And what they do is uh, they sue each other for patent infringement But they have thousands of patents and they have huge law firms and law lawyer arsenals and they spend 50 100 million dollars each on some big law lawsuit. They finally settle with each other One pays one a royalty one pays another royalty. They make a settlement. They agree to go their own merry way One of them is going to have a higher cost They both have a higher cost because they spent money on their attorneys But they just pass it on to the consumer who has no choice but to pay it Because there's no competition because there's no small upstarts that can compete with them because of the patent system So there is no doubt whatsoever that the patent system Helps entrench cartels basically or oligopolies It reduces competition and therefore it reduces innovation because You don't need to innovate as much if you have a comfortable perch with only a few Uh competitors and furthermore if you can rely upon your patent for 17 years That reduces your incentive to innovate because you can just Ride on your on your laurels for a while You know, you can you can ride on this innovation for a while because now you have protection No one can compete with you on that innovation if there were a true free market You would have to keep innovating all the time because every innovation You introduced into the market would very very soon be copied and emulated by other competitors So there'd always be a furious pressure to keep innovating Now let's take a step back real quick just to make sure that people can intellectualize exactly what you're saying um When we're talking about the concept of intellectual property What is what are your you know main arguments against it being? property as we know it so my main argument against it is It comes from an understanding of what the purpose of property rights are in the first place and an understanding how these systems work Um, let me make an analogy. Um The libertarian typically says something like We're in favor of individual rights or natural rights or we call them negative rights A negative right just means the only obligation you have is to refrain from doing something to me That is you have an obligation not to invade my property rights Not to commit a tort against me not to murder me not to steal from me So all rights are in in libertarianism or negative. That's what the non-aggression principle means You have an obligation not to aggress But you don't have an obligation to provide me with food or shelter or education Or sustenance whatever that would be a positive right. The reason is positive rights every right Correlates to an obligation. So a negative right means there's a negative obligation And we're okay with that. We're okay with saying people do have an obligation Not to harm us because all they have to do is mind their own business Stay on their own property And just refuse to enter my property or use my body or my property without my permission but The modern mentality is that well negative rights are all fine, but let's just have some positive rights too, right? Let's have the freedom from fear the freedom from want And so the modern liberal The social democrat mentality is that we can just add to the list of negative rights some positive rights Let's have some positive rights too Why shouldn't we have a rich country and let people have free education and free healthcare? Well, the libertarian typically understands that every time you recognize and set up and grant a positive right It's not free. It comes at the expense of negative rights, right? Because if I have a positive Right to healthcare Someone else has a positive obligation to provide it to me, which means taxpayers have to be taxed to pay for it Basically, right? So we recognize that negative rights are the only type of rights that can exist and if you grant positive rights It always comes at the expense Of genuine negative rights It's the same thing with intellectual property rights if you understand the purpose of property rights is basically To permit humans to cooperate in a world of scarce resources This is the situation we find ourselves in On this earth and in society and in our lives We find ourselves in a world where there is scarcity. There are things that we want to use scarce resources material resources land food objects wood water our bodies animals fur bones, whatever airplanes cars nowadays We need to use these things to control the world. This is how we live our lives But there is a possibility that we could have a conflict over who gets to use these resources because of their nature Their nature is that they're scarce, which means that they're rivalrous which means there can be rivalry or conflict over them And instead of us having an attention an eternal war of all against all we want to live in society with each other We want to live cooperatively and peacefully And instead of fighting physically and doing battle over who's going to be able to use this turf of ground or this whatever We prefer to establish property rules or norms. This says listen, let's just come up with a scheme that says For everything that could be fought over There's going to be a rule that says who the owner is And whoever the owner is gets to use it and he can decide who gets to use it or not He can sell it. He can lend it. He can permit someone to use it or he can tell them They can't use it or he can charge them to use it whatever Right, that is why property rights emerge. That's what property rights are property rights simply are the exclusive Right to control illegally recognized socially recognized Right of exclusive control over a given resource that is like that Now if you start saying well, let's add to that intellectual property rights It's just like adding positive rights to negative rights. It has to take away and the reason is because If you grant to me the right to uh An invention let's say the right to a mousetrap. I come up with a mousetrap the first mousetrap Well, let's say I come up with the first three-legged stool Up until now everyone's made four-legged stools and I come up with if we make a three-legged stool It's more stable. It doesn't rock back and forth. Whatever If I have the property right in a three-legged stool in the idea of it Okay, now an idea is not a scarce resource that people can fight over because you can copy it billions of times A billion people could use the idea of a three-legged stool at the same time They could take their own wood. They could make a three-legged stool with it Without conflicting with each other. They could do that in minding their own business on their own desert islands You could have a million desert islands and a million people All making three-legged stools at the same time that they all learned about from one guy And there would be no conflict So if you so property rules already prevent conflict over their particular stools But if you give someone a property right in the idea of a stool What that means is they automatically now have a property right in basically All the wood in the world. Do you see because What they now have a property right in is they is in the wood owned by you Because they can prevent you from using your wood as you see fit even though you own that wood You can't perform certain motions now with your body and with your wood and with your nails and your hammer and your And your you know carving instruments you can't shape that wood into this particular shape because they own that shape Which means that a property right in an idea Effectively grants the owner of that property right ownership rights in the material resources of everyone else around the world including their bodies So it's basically a type of redistribution of wealth or theft or slavery even in a sense This is the ultimate problem with intellectual property is that it basically undercuts and undermines the basic libertarian Property rules the basic libertarian property rules are very simple It is when there's a resource over which there can be conflict We identify the owner according to three very simple rules Those are number one who first who first owned it. That's that's homesteading or original appropriation According to lock number two Did anyone make a contract giving it to someone else? That's comes that's consent or number three Did someone who owned the property commit some kind of violence or tort against someone else so that they owe them some kind of Restitution or rectification In which case they that victim might have a claim over that person's property But only those are the only three rules you have to consult to determine who the owner of a piece of property is Right who first found it Was there a contract did someone commit a wrong? Right and if you have an intellectual property rule what you're doing is you're saying well, there's a fourth rule now To determine the owner of this resource. So if you have a stool Made of wood that you own that you found from the from the forest that was unowned And you use your own labor and your own body to make this stool But someone else can now claim they own that stool because they have the ownership of the idea of a stool Well, then you're coming up with a fourth rule saying well To determine who owns that stool we have to ask Who first found it? Was there a contract? Was there a tort? Or did someone else think of something first you see? So now we have a fourth rule which undercuts the others But such a rule is nonsense because Just because you think of something and you make that idea public and someone else learns from you You're not really committing a tort and you're not entering into a contract with them If you want to keep your ideas to yourself, you need to keep them to yourself Yeah, and I think that The the problem that a lot of people have with With what you're saying tends to be more emotional in that they want to protect that into individual, right? They might say okay fine. I agree that that ideas aren't scares But great minds are so if someone comes up with something first Then we want to protect that individual and we want them to benefit from those great ideas that they come up with Yes Yes, and so that is a common impulse. Um, well, first of all, there's a bit of an equivocation that goes on there They're using the word scarce in a second sense meaning rare when we say a scarce resource We don't mean rare. We mean it's rival risk. But basically it's the type of thing That particular thing can only be used by one person at a time You wouldn't really say that smart people are Arrival risk you would say they're rare that is and that is true The problem here is the libertarian falls into the type of thinking that we see commonly among standard status and mainstreamers and democrat socialists where For example, if you oppose state subsidy of education or you oppose the state Subsidization of art through the national and down for the arts Then the standard liberal will will accuse you of being a philistine and and being against the arts or against education They can't conceive of Uh education Being provided to the public Without the government doing it. So if you're opposed to the government doing it, they think you're opposed to the thing itself Whereas libertarians usually are smarter to realize that you can be opposed to government Subsidies of something without being opposed to the thing itself Right, but they fall prey to similar logic in the case of Of of intellectual property partly because this idea has been so entrenched by now and so ingrained in In western property systems, which we libertarians have been taught to think of is Some kind of rough approximation of a libertarian order, right the west england america early america the common law These property rules we have are not perfect, but there's some rough approximation of capitalism and the free market that we would favor In a free in a free market system And so we take for granted the legitimacy of what's going on But a whole host of practices has evolved and developed in those centuries Taking these patent copyright laws into account. And so we're so used to it It's very hard for people to imagine Well, how would there be innovation funded and how would novels be written, etc If you just jerk this copyright and patent system away from us, they can't imagine it because It's been snuffed out by the government Just like I imagine in soviet russia in the 60s if you told People we're going to get rid of the government's monopoly on automobiles and toothpaste and bread A lot of people might freak out and say well, what the hell where's the bread going to come from? You know because they just they don't they can't imagine who's going to make it if the government's not doing it They're just not used to these alternative systems The government has not allowed the alternative systems to emerge And so people's imaginations are similarly atrophied And that's what's happened here, especially to the more utilitarian consequentialist type libertarian who wants to know What's going to happen if we Establish a war-free economy, which means getting rid of patent and copyright. They demand to know they want to know Well, who's going to how will how will novels be made? How will movies be funded? How how will this happen? They want to know almost like they're making a demand. They're almost saying like Unless you can prove to my satisfaction that When we get rid of patent and copyright, we're going to have just as much innovation in exactly every area As we have right now. I'm not going to favor freedom. That's really what they're saying. It's the same as a liberal saying well You libertarians tell me that there would be plenty of charity in a free society and we don't really need to have welfare But unless you can guarantee to me that there will be no single poor person ever that will go without food In in your system. I'm going to keep my welfare system. Thank you very much This is exactly the attitude the libertarians have who don't really understand what they're supporting They're basically supporting a system that undermines property Rights that undermines competition undermines learning threatens censorship threatens internet freedom by the way the the This whole idea of a piracy which has all the the big content so upset Um, and so they lobby the american government which lobbies the rest of the world to ramp up copyright laws Uh, it actually putting people in jail for pirating Movies and books things like this erin swartz if you recall committed suicide because he was he was facing decades in prison For copying some journal articles from a university uh It's really really a police state type system That no libertarian has any business supporting whatsoever if they don't understand it I could understand being silent and mute about it and being listening on the sidelines, but for any libertarian to vocally support patent and copyright is either An act of complete irresponsible Ignorance because they don't know what they're talking about and they really should be quiet Or it's an act of evil and completely unlibertarian. They actually know what it is and they're in favor of it. Anyway in either case Look, I've mentioned this before in various talks and in writings um Most of the the the horrible things the state engages in War the federal reserve and you know central banking inflation those things uh state funding education uh taxation All the drug war especially all of these things almost every libertarian recognizes is unlibertarian and And they oppose it because they know it's unlibertarian Most people sense that these things are something wrong with these things, but they're willing to tolerate them for some reason Intellectual property is up there with those other five things But it's the only one that pretends to be a type of property right and they get libertarians to support it Uh under the banner of property rights Libertarians who support taxation do so grudgingly. They know that it's bad Maybe we have to do it to support the government. I don't believe that because I'm an anarchist But I understand some anarchists believing that But they don't pretend that it's a property right issue Right the same thing with the drug war And with government funding of education But with intellectual property it's different It's the one of those big bad things the state does it's insidious because it goes under the banner of property rights And that's why I think it confuses libertarians um so much and it's hard to figure out Yeah, and on the topic of productivity and how much you know the lack of ip Would affect that I think the the thing that cemented it in my brain the most was an example of that Jeff Tucker made and you know, I know nothing and care nothing about fashion But he you know, I don't remember um in the talk that he gave he gave the example of how The fashion industry for the most part there isn't a lot of ip And you know, I thought back to my college days when I used to work at a retail store a clothing store a gap And remembered how dynamic You know that industry was and every three months we had to constantly You know move out the old stuff and bring in the the new season and I never thought about it that way and I said Yeah, I mean you can't patent You know a pants or a t-shirt or whatever So these companies are just always on the go and you can only imagine how much more productive Other industries would be if they also had that incentive instead of just spending so much time in court well, yeah, so um But of course there's a lot of people in the fashion industry that have been lobbying for decades now for a copyright To extend the fashion designs. So you you can never win with these people. They're never stopping But yeah, you have you have examples from all over perfume smells are the same way a restaurant recipe recipes for you know for food and restaurants people Innovate all the time and they count they sometimes emulate each other sometimes they they build on each other, etc The the advocates of intellectual property, especially patents are completely inconsistent because they never come up with a coherent theory explaining Why fashion designs and things like that shouldn't be covered? There's no end to what you could cover With with the idea that anything that has value that's creative should be rewarded by a property right grant There's there's no end to it. Um In fact, there's no there's no reason why they would want to make the terms finite some people like leisander spooner And a few libertarians arguing even today argue that patent and copyright terms should be perpetual now Patent and copyright are bad enough But if you imagine that since the dawn of the 14 1500s or even earlier If there had been perpetual terms to every invention ever Come up with and every work of authorship. We would have no public domain whatsoever We we almost couldn't do anything without permission We we would always we'd all be dead because you couldn't do anything without getting permission of 100 000 errors of someone else We just we died like a like a pit of stasis um The other thing you have to recognize is that um Even the companies that you would think benefit the most from the patent system and the copyright system like the music industry hollywood um The pharmaceutical industry even some of them would be better in a free market because Um, well number one, they would all be free to do whatever they wanted with other people's ideas They would have like a huge recipe box open to them all that would that would liberate them They would untie their own hands So they would benefit even though they suffered by losing some of their monopoly power, right? So In estimates that I have seen and I've done myself If I had to guess okay based upon Some objective estimates and studies I would guess that at least a trillion dollars Is lost In some kind of terms by the patent system Globally every year. I think it's actually more to be honest I think that the amount of innovation that is hampered by the system and the amount of Deadweight cost that's spent on ip enforcement is insane And remember too that these companies will be free. They wouldn't have to spend hundreds of millions of dollars every year on patent attorneys like me They wouldn't have to uh YouTube would be a wholly different type of thing for example right now It wouldn't have to have this whole take down and notice system. They have right now They wouldn't have to have to have been so careful It's hard for us to imagine what would happen without patent copyright, but we know that A lot of things would change netflix is already severely hampered Because of copyright, right? It doesn't have the latest shows and movies The service would be totally different and probably a lot cheaper um absent copyright Uh, I've given examples before about People ask questions about how would movies be made. It's like well Movies used to be remember movies used to be made before digital media Uh, like say in the 50s and 60s when their basic source of income was selling tickets at movie theaters And guess what people still go to movie theaters even today in record numbers And they pay lots of money Even though most of them are savvy enough to go get a torrented free copy of the movie at home So why do they do that because it's a different experience? So there's no reason to believe that Movies wouldn't be made just just for the ticket prices alone It's only in the modern decades where secondary and tertiary sources of income started happening where like for example the um, the the movie studios could make money a second time Uh by playing it on television and a third time by renting it out to hbo and a fourth time by airplanes And a fifth time by hotels and a sixth time by dbd sales Right all these things are great And even if some of those are eroded because of the ability of people to copy Doesn't mean there wouldn't be a way to fund things right and remember their costs would be a lot lower as well uh The whole industry of making sequels is a governed by copyright because Uh, it's easy for a company to make an insipid sequel because they know It's a moneymaker and no one else can make a sequel because of copyright law. So it sort of distorts the entire culture um the uh The uh, I mean think about iron rands novels Libertarians love them. I think atlas struggle was published in what 56 or something Uh, they didn't come out until as movies until about three years ago four years ago They would have certainly come out as movies way before that if there had been no copyright preventing someone from just doing it Maybe there would have been three or four versions of atlas shrugged made already. So what? Uh, you know, everyone freaks out about that idea, but it's it's there's nothing wrong with that I mean people can make a a movie based on romeo and juliette right now if they want to so what? you can make a play based upon uh Play it as republic if you want to right now because it's public domain um One idea i've uh suggested is let's take the example of of a jk rolling the author of uh, harry potter The harry potter novels who's basically like england's first female billionaire. I think because of this And no doubt some of that is because of copyright I don't know if all of it is and I don't I don't think all of it is you could easily imagine a scenario where someone like her Becomes a multi hundred millionaire easily without in a copyright free world So for example, she published her first novel just because she loved writing it. She had no expectation of becoming rich So she would have published harry potter it would have gone on kindle She would have sold it for a dollar each maybe or on kindle Maybe she would have gotten a million readers around the world and they loved her 10 million readers She would have made 10 million dollars right off of that even if there were knockoffs She would have made some money And then she realizes hey, I've got this big fan base 10 million harry potter readers parter readers out there Uh, so she says i'm going to start on book number two and she does an indiegogo campaign Or she just does a gofundme campaign or something a patron account and says I've got book number two ready I'll tell you what i'll release it as soon as I get A million people agree to pay five bucks each for it five million bucks pretty good money for writing a book I guarantee she would have gotten it and then maybe in the meantime two or three pirate movie studios would have You started making movie versions adaptations of her first novel without her permission because there's no copyright But one of them might have went to her and said listen, there's two other companies making harry potter Uh and the sorcerer stone movies right now We want to make one too But we'd like you to consult on it and endorse it And we think that we would get a lot more ticket sales than our competitors because the fans Would much rather go see the authorized version So we'll give you 10 of the royalties if you just do that, you know So now she's got another 50 million in her pocket I mean there's any is any number of ways you could imagine someone like her making money They just have to figure it out. You have to figure out a way to be an entrepreneur Given the property rights system of a free society And that highlights another issue that I think people have trouble with when it comes to this stuff that They feel like then that puts the onus on good marketing over just creating something cool right or something uh novel and And I think that's why a lot of people also have trouble with this because they say well We want people creating but are they going to be punished because they're just not good at business right, well, but uh You know, you know First of all, I guess there's a principal response of that which is that look what's the purpose of Libertarian theory. What's the purpose of property rights? What what are our principles? What are we for we are for a society where people Respect each other's rights. Okay, we are not socialist who think everyone has a right to a job And we shouldn't be Entrepreneurial socialist who thinks everyone or creator socialist who thinks everyone who comes up with something quote unquote valuable or a good idea Is entitled to some kind of monetary return from it because they're not The second answer is that even in today's world where there is patent and copyright That's still the case what you just said, you know, if I'm some lone inventor and I come up with a new mousetrap Even if I come up with the money To apply for a patent that doesn't make money start coming in. I still have to somehow make money off of it you know, I have to Go into business and start making mousetraps or I have to find someone who wants to license this from me You have to be a businessman Or you have to wait sit there and be a patent troll and hope that some other company Comes up with the same idea five years later And starts making the mousetrap. They take the entrepreneurial risk to do it and then you just sue them, right? Like a patent troll I guess that's a money making Type of business model, but even that's a business model. It's a horrible one, but even that's a business model It wouldn't be possible in a free market But there's just no way to make money off of an idea even under a patent and copyright system unless you're kind of a businessman So that criticism makes no sense whatsoever Now how would things like Trademarks and things that identify people or brands or things be Be managed so for instance the real world example if In a free market without ip my wife and I own a business and we have our logo and we have You know the name of the company So How would one go about protecting that or making sure that another company doesn't just you know, they see that you're successful They start using your company's name and your logo Right different from the other thing now now so trademark is like the third big type of ip It's not nearly as big in terms of damage as patent and copyright And it's not nearly as obvious to most people that trademark law should be totally abolished as well Which I believe it should be Let me explain why first of all, um Rothbard has explained Uh in the ethics of liberty Well, he was a little confused on copyright, but he was good on patents But he was also good on defamation law, which is reputation rights, which is basically Trademark is a combination of fraud law And reputation rights. Okay, and I'll explain that in a second. Um and contract law Reputation rights or defamation law says that if you have a reputation Then if someone slanders you or defames you or liables you by Telling a falsehood about you that harms your reputation. You can sue them Rothbard explains what that is an unlibertarian Type of law you don't have a right to your reputation because reputation is just what other people think about Think about you. You don't have a right to their opinion or their brains And I agree with that totally I actually think defamation law should be considered a fifth type of ip But it's not normally considered so by lawyers, but I think it should be and it should be struck down for the same reasons um trademark law is usually justified even by libertarians even by ones that are skeptical of patent and copyright By saying that it's just a way to prevent consumer fraud Um, or they blend it in with this reputation issue like well, you have a right to your reputation So the way I look at that is this. Um, first of all, you have a name. I have a name My name is Stefan Kinsella. You your name is Herman. Um, you know, your son might have a name It might be the same as someone else's name You don't actually need the government a government legal system to That for you to have a name In fact, you have a reputation. I have a reputation in the community I don't need government laws to have a reputation. There will be reputations and there will be names Including business names, right? So that's the first thing you don't need a government system to have a reputation or to have a name um Second of all the threat that you're talking about is almost non-existent. So If mcdonalds had been a popular hamburger chain Well, when burger king or windies started up to compete with them, even if there hadn't been trademark law Usually these companies don't want to Mimic and copy the other company. They want to start their own chain with their own name It just is not going to happen that you're going to have someone come up with a renegade mcdonalds because Sooner or later the word is going to get out that there are renegade mcdonalds, right and Customers will either start suing them for fraud now There's a type of fraud law I support if you go to a restaurant Or to a company and they pretend to sell you something that's not legitimate Then that is a type of fraud Which is why trademark law is not necessary based upon fraud because there's already fraud law or contract breach So to the extent trademark law Duplicates what fraud law already does it's not necessary, but trademark law goes far beyond that. So for example If I make a knockoff Chanel purse Right that normally sells for $500 and I sell it to you for $5 now Chanel can stop Me from making that sale and they can confiscate with the power of the government all the purses in my Warehouse and destroy them, right? That's what trademark law gives them the power to do. Now. There's no way you can justify that based upon um Fraud law because when I sell you the purse for $5 I'm not defrauding you because you well know you're getting a knockoff purse And that's what you want. You can't afford a $500 purse or you don't want to pay for it So there's no fraud in that case I'm not defrauding my customer. My customer is not defrauding being defrauded or complaining Yet Chanel still has the right to come in and step in and stop it. So to the extent trademark law deviates from fraud law It's illegitimate. That's why I would get rid of it um So that's the first thing with with with with trademark. Um, I simply think that And and now and think of the practical ways as operate Let's suppose I go down to the local Kroger grocery store and I want to buy some crest toothpaste Which I do on occasion Now It's possible. There could be a knockoff chinese a chinese company selling knockoff crest Which is inferior in quality To be honest, if it's not inferior in quality, I don't really care if I'm getting knockoff crest But let's suppose I care and let's suppose it is inferior in quality Well, kroger bought that crest fake crest toothpaste from somewhere They had a supplier And as soon as the rep the word gets out that kroger is selling Fake crest and other fake products on their shelves. Guess what's going to happen? They're going to lose customers So kroger has an interest in being a reputable company And giving a guarantee to their customers We guarantee that everything on our shelves is from the original supplier And we have or the original manufacturer and we have suppliers And we we guarantee we make sure that they are legitimate and that they guarantee that they got it from the original Manufacture as well. So there's a there's a certification process that would happen normally in the free market down the chain There's just no need whatsoever for trademark wall any more than we have a need for the For the for the government the fda to inspect meat, right? And for the government to Inspect cars you can have private mechanisms that do this already. I mean maybe yelp would do it You know, it's hard to predict exactly how this would happen in a free market But um, I would say trademark law is completely Completely inappropriate. The only thing that should be prohibited Or considered to be an offense and the law would be outright deception and fraud of consumers. So you know, if I sell you a Chanel purse pretending That it is a genuine Chanel purse that is a type of fraud, but in that case the victim is the customer And he doesn't need trademark law to sue. He can sue based upon contract breach or fraud law right and furthermore Where's he buying this purse? Is the customer buying it from some guy with a van on a corner in the shady's part of town? In which case you should be on notice In fact, if you're buying a Chanel purse for five dollars, you should already be on notice that it's not a real purse Right, um, or are you buying it from a nice glitzy Chanel outlet in the gallery of mall in downtown Houston? Right. Now, what's the likelihood that some Shady priority outfit that's standing to be sued by thousands of defrauded customers is going to be able to get the resources Right and have the reputation to get a lease from the gallery The gallery is not going to accept shady customers like that any more than kroger is going to accept knockoff toothpaste From a chinese company just to save a few bucks Well, they're going to lose all their business as soon as people figure this out So these are problems that just do not exist like at all on the free market Trademark law doesn't solve any real problem that exists on the market Well stuff, and I wanted to provide my listeners a primer on this stuff And I think you've done that and then some so a lot to Digest your chew on but if people want to explore, you know more about this topic and know more about your work Where should they go? On this particular topic. I have a website called c4 the number four Sif.org which stands for center for the study of innovative freedom. So it's c4sif.org and just go to the resources page there I have tons of prime primers and articles and concise guides and And on my personal site stefanconcella.com I have a podcast and I have a media page and publications with lots of articles and Talks on this topic. In fact my mesus academy course was like a five or six part course on ip And if someone wants to drill down into those more deeply they can they can take that for free. It's on it's online at my site Excellent well, thanks so much for your time stefan. I hope to have you again At some point to get a little bit deeper in this stuff, but I really appreciate your time today You're welcome hermit appreciate it All right guys, there you have it. Hope you enjoyed that I'm going to include as many links as I can from stefan where you can find a lot more about him and the work that he does and Just resources on this topic and stay tuned. I am scheduled to speak with walter block soon And i'm hoping to get that episode up within the next few days. So stay tuned for that and as always Remember you are free live accordingly


Thank you. Thank you ever so much. This has been a marvelous journey Thank you, Waipo for opening up your doors in an exceptional show of institutional transparency and public participation unequal by any Institution in the city, I would like to say and I've seen a number of them Thank you to those countries that supported us from the beginning Especially but also thank you to other countries That did not and blocks of countries But that learned to progress forward with flexibility that were able to change course when needed Despite almost unbearable pressure from some special-interest lobbies You have all set an example for international Negotiation that was up and down that went up sometimes to 12 1 o'clock in the morning on Friday evenings and thank you, especially I don't know who it was who ordered the pizzas when we had nothing to eat at 1 o'clock in the morning on a Friday The America's Treaty has set a marvelous precedent in international law Because it uniquely combines disability rights development goals for access to culture in the global south access to knowledge in the digital sphere copyright reform for users recognition of the key intermediary role of librarians and the importance of civil society initiatives for international lawmaking Overall today is the day to express special gratitude to an exceptional group of three or four Key civil society campaigners around the world who have worked brilliantly and tirelessly for a number of years through a roller coaster ride of torturous meetings Political betrayals and alliances high hopes and bitter despairs in order to make this treaty possible Yes, the America's Treaty proves that positive change can be made even in giant global institutions and Against great odds and let me tell you in today's world. That is no small thing Thank you to these people Who are really the salt of the earth all of you here? And I'd like to mention a few people some of which are here and some aren't here physically and some aren't even on the earth anymore It's been a privilege to work with you and fight with you and without you this treaty would not exist people like Jamie Love sitting up there from Knowledge Ecology International his wife Manon Reese Dan Pescott who's not here today was one of the key negotiators of the ABU But also members of delegations of some of the countries who went far beyond their professional role People like Marcos do Sosa of Brazil an incredible person Raga vendor from India Great leadership many of the people sitting up there right now I can't mention all of your names right now people like Michelle Woods Pablo Lucona the late Raul Sherian a leader of disabled people in India Chris friend tireless fighter Marian diamond Scott LaBar over here on my right Fred Schroeder the Italian orado fo cattani Turu Balu Subramian Ruth Ojecki brilliant Jim Frickerman Barbara Martin Francesca Martinez Pranish Pankesh Nermita blind lawyer in India Teresa Hackett Barbara Stratton many lawyers I could go on and on and on and I please forgive me the people whose names I have not said and many of the people here today But you have all made the Marrakesh Express It's been an expressive going up and down into something that's much more than just an old Beatles song. Thank you. Bye. Bye


all my career, so I mostly live and see in C++, I connect devices, and I really, so start working on the NERVS project, and when, so recently NERVS has become a little bit more popular and it's gotten a few more people involved with working with hardware in the Elixir community, and I really wanted to make a talk, or give a talk on how to get start with hardware in Elixir, because I think Elixir has some really interesting pieces to it. I came to the, so from my point of view, I came to the Erlang community because I was very interested in some aspects of OTP, but Elixir has many great things and certainly builds on what's there, and I wanted to share some ways that you can avoid some pain, and to that effect, this is what we're gonna talk about. There are really three parts of, there are three ways of interacting, or three main ways of interacting with hardware when you're using Elixir, and one, of course, is NERVS, so of course a favorite one, I'll give a little blurb about that if you haven't seen that yet. The other one is using these desktop Linux, so I guess the term in my field is single board computer, so this is Raspberry Pi, Beaglebone. Talk a little bit more about that, about how you can actually get pretty far on these boards, and then the other thing that I think is completely underrated is interacting with hardware on your laptop, but you need to know where to look. I think you need to know the trick to for how to get started on that route. So I'll talk about those and give a couple examples of projects that have gone these routes. So NERVS, so NERVS, this is, this is a project that I started three, or a little bit over three years ago, and the idea was just to combine OTP releases with a small Linux-based system, so that I could do what our technical line says is craft and deploy bulletproof embedded software, and as things have picked up, especially, I'd like to thank this community because you guys have been unbelievably good and welcoming to me in this project, and certainly Justin and Garth really helped me get back into it with the, and bring Elixir to the forefront with the project, and they've certainly contributed an insane amount, so I don't want to take anything away from that. But so NERVS, so what are some of the key things in NERVS? If you haven't used it before, you might have this nebulous feel for what's NERVS, what's not, well NERVS is actually basically the tooling, and there's some basic common infrastructure for embedded systems projects that's included within the main part of NERVS. Now there's certainly a lot of other things that people do with NERVS, but you can kind of think about it as like Phoenix and all the ecosystem that Phoenix has. NERVS has the core part, and there are many ways of extending in projects that build upon it. So it's a tooling. When you start to use it, you'll get a different feel. It's not really batteries included, it's kind of the opposite, it starts small, and then you add on the pieces you need. This is something that has appealed to me quite a bit in my career because it's the projects that I tend to work on. It's good for me to know what the ingredients are, and I think the downside of starting big with batteries included is that it's kind of hard to figure out where all the moving parts are and where they're going. Now on the opposite side, starting small and building up, you need to know what to add. So I'll briefly mention a couple ways of dealing with that and making that part a little bit easier. It's cross-compiled, we've always been cross-compiled, and the main reason has been that we've been targeting hardware that is really not fun at all to do development on.  Now, another part that may have been more controversial will surprise people if there are any embedded Linux people here is that the embedded Linux ecosystem overlaps with the Erlang OTP ecosystem of componentry in various ways. We tend to choose the Erlang Elixir ways, which probably don't find surprising, but sometimes it has ramifications because you'll go look things up on the web for like, how do I do this thing with DNS and find out that, well, we don't use some of the embedded Linux tools for doing basic operations, either with DNS, we use Erlang's route, or with a couple other pieces. So this is the, let me just move on to the big diagram. So if there's one thing to remember about nerves, this is it. All you have to do is remember this picture and you'll never be lost. And there are two sides of this picture. So there's the bottom side and the top side. The bottom side describes what happens. The parts that we put together, mostly on our side, and then if you get to be an advanced user, you may dig into this yourself. But it basically includes Linux, C, the C libraries, all that stuff gets compiled and then built into something called a system image. And we distribute system images, so you get one for your platform. And then they can build download if you have in your mixed file. You can reference these and they'll be downloaded to your system automatically. So it's all really nice. And then on the other part of it, the top side, this is where most of your development hopefully lives if it doesn't live there and you're probably not using Elixir that much. But the idea is you set up Elixir, your Elixir projects the normal ways. We have a helper called mixnerves.new which will template things out to get you started. But you set it up, use the standard Elixir tools to build things. And now we go to an OTP release. So once you get to the release, there's some additional steps with Nerf. So the release, for those of you who aren't familiar, contains all the beam files that are compiled and some initialization scripts, mostly to handle the Elixir and Erlang side. Those need to be married with the system component tree, the Linux kernel. And that gets created in a firmware image which for those of you with Raspberry Pis, that gets converted into, you'd write that onto an SD card which you could then plug in. For those of you who might be doing something professionally with this, where you're not using SD card, you have built-in memory, that would be programmed either in production or manufacturing step, and then there'd be upgrades that you could ship out to your device using whatever method you have for communicating with your device that could apply new firmware images. So that's about the extent which I'm gonna get to go into Nerf. If you want to know more about it, you can follow our website or there have been several other talks that you can watch on it. The main part I wanna get to are the underserved parts of interacting with hardware. And this is just, why not get a Raspberry Pi and install Erlang and Elixir on it and just run from it. So you can get these, you're not stuck with the Raspberry Pi, there are hundreds of them. And the neat thing about this is that if your project needs some IOs that the Raspberry Pi doesn't have, maybe you need an FPGA or, which FPGA is a really low-level hardware way of performing some hard real-time action. So you can get these fancy ones, you can, a lot of them come with Debian. So with the Raspberry Pi, you get Raspbian, which is really Debian repackaged. And they work like real computers. So if you're new to this, it's really easy to interoperate because it's just like a really slow PC. I do have to say one thing on this, and I learned this the hard way. Actually a couple of times, which is kind of embarrassing, which is just like you wouldn't pick your laptop, based solely on hardware specs, don't just pick these boards based solely on hardware specs. And sometimes these boards look so cool that you just want to pick them up and just play with it and then you find out that the software's really, really bad. Or really old and ancient and un-being tamed. So that's just a note there, just when you're looking for boards. The ones I mentioned here are very good. They're outstanding. They're Raspberry Pi and Beaglebone. There's several others there, they're good. All right, so Debian, what's great about it? Well, everyone uses it. So if you actually want to get help, which we're a small community, we're kind of new on the hardware side, so it's not like Stack Overflow has tons and tons of how you do this in Elixir, how you talk to this device. Most often you're gonna find out how you work with a device with Python or some other language. So the good news is that when you're on this board, you can always try it out in one of those other languages or post your questions and you'll get some response. The bad part is that you're building Erlang from scratch, almost always, because for whatever reason, a lot of these boards have Erlang 17 or earlier, which doesn't have maps, so it's less useful. And I guess if anyone happens to be here who knows how to work with Debian in ways to update their packages for Erlang, please let me know, I'd really love it if I didn't have to rebuild these as often. I guess one note here, if you're working on the Raspberry Pi, Erlang Solutions has that totally fixed. You can just get their package off their website. All right, so now, those are two of the routes. So the Nerds and Desktop Linux, they have similar capabilities in what you can do with them. So I wanted to go over a particular application which has gotten more, has come up a few times on the Nerd Support List, which is monitoring your garden. So I don't know why this year it's monitoring your garden. Other years it was making beer, but this year seems to be the garden one. So here's what comes up. So what you do, apparently people can't remember to water their plants. I have this problem too, but you have a Raspberry Pi and you wanna actually do something with it. So you want to connect some sort of moisture sensor to the Pi and use it to monitor the soil, so you know into water. So nothing super complicated, but when we get into the details, you'll see it can be a little tricky and it actually turns out to be more interesting than I thought when people first started asking about this and I changed my presentation to include it and you'll see why. So here's the setup. So you get a moisture sensor, although probably some of you have seen this where it has two prongs and the idea of these sensors is that you apply a voltage, goes down one prong and then you basically see how much it comes out the other side to see how conductive the soil is. So that's analog and for those of you with Raspberry Pi's, you'll know they don't have any analog inputs. They can't, the analog input and you can't give it like three volts and it will tell you that's three volts that it got. So you need to have some chip in between to do the translation. So they're analog to digital converters. They're like millions of these, but a very inexpensive one and easy to solder one is this MCP3008 and if you go to a lot of websites, they'll point you to this one. So anyway, it takes analog in on one pin and then converts it to something called spy. So spy is a particular digital interface. It's one of a couple that are very popular in embedded systems and hardware. So the pins, those pins on the upper left corner of that pie, there's some that are spy inputs. So we take that and then the other piece of information that you need to know is how do you access it in software and there's, if you search Hex.pm for spy, you should get Elixir Ale and that's a library that's been around quite a while but it has interfaces to what you talk to spy peripherals. So what does that look like? So the first thing, you know, most of us do is like, all right, we have these inputs and outputs. So let's match all of the APIs together and see how, see what we need to, our programs do to glue them all together. So you look at the Hex docs for Elixir Ale and for spy, there's one function. So, all right, so this ought to be good because how hard can it be with one function? So the neat thing about the spy bus is that since you transmit and receive simultaneously, so it's not like I send a byte and then I get a byte back, it's like I send and receive a byte at the same time and this is kind of strange but in a couple slides, you'll see why this makes sense and it's actually quite a simple way to implement hardware. One thing, I guess the other thing when you deal with hardware and the APIs for hardware, you'll find out that things are a lot simpler than you may expect them to and sometimes simpler or nothing, you just can't believe that it actually just works that way. So sometimes you have to just take a step back and just look at it fresh while like, what would be the simplest thing for turning wires on and off? So we got this function. So now what we need to do and we need to find API to this chip. So in hardware speak, API is data sheet and there should, so those of you who have looked up data sheets before, it has a lot of scary stuff in it but the good stuff isn't here. This is the real API, this is the document that you need to go to to find these and Google will get you there. So in this case, here's the webpage for the MCP 3008 and at the bottom there's a link to download the data sheet. Then you have to take the step of searching for the most important diagram which is, which looks like this and I'll explain this and so if you're totally new, you might wanna just, and you're working this, you might wanna read up on spy but I can tell you real quick how spy works. So spy, there are three wires. Actually this shows four wires, this diagram but the top wire, we can ignore that for now that fourth wire is used to tell the chip that you're actually talking to it and the way these things are hooked up quite often is you're always talking to the chip. So the three next wires, the one cell called CLK that stands for clock and then DN that's data in and data out. So data in, this is chip centric since this is the doc from the chip. So data in would be coming from the Raspberry Pi to that analog to digital converter. So the way this works is when you send and receive over the spy bus, the Raspberry Pi twiddles since one sets it to zero volts and then sets it to three volts. So zero one, zero one, so that's the clock twiddles. So every twiddle is a bit that goes through. So here's how it works. It's the first bit, that one, it's called the start bit and if you read the doc, the sections I didn't copy, it says set that to one, okay. Then there's a mode bit and well, there's a little paragraph that sets it, but that tells you how to set that right above that. So that's good. There's address bits. We went back to the picture of that chip, you notice the head a whole lot of pins. You can take input from a whole bunch of Moisture sensors if you were interested in it. So they have an address. So that's probably not too hard. Then there are 10 bits in the result. So 10 bits, zero to 1,023 is what you get back and 1,023 means you're getting a lot of volts. You're getting close to three volts or five volts depending on how you run the chip and then zero, get back zero, it's zero volts.  So let's just complete this. You get a couple more bits in there because you count the twiddles and then this is what happened. So it came to 17 bits and then this actually prompted the post to the list in which it was, I don't know what to do with 17 bits. So those of you who've done bit strings with Elixir, you're like, oh, I can do 17 bits but that's not really good enough. The spy interface takes bytes.  Did I count it right? And I actually counted this an embarrassing number of times to make sure it was actually 17 bits because who makes an interface that gives you numbers in fractions of bytes? And actually, if any of you work with hardware people, you start finding out that this is not uncommon. I don't know why they do that to us, but they do. So then what do you do when you don't know how to use an API? Well, you look for examples. So the word for example in hardware speak is application note. So all right, so you start Googling app note. They often shorten it.  And it actually turns out to be helpful. It wasn't immediately obvious, but if you look at the bottom two rows, they're groups of eight bits, so you have bytes. So they said, okay, here's what you do. If you can only send and receive bytes, well, just make the first byte, just put one bit, the start bit in it. So you send a one, and then 17 minus one is 16 bits. So if we were to go back to the previous diagram, then you'd see that the first, the start bit, and then the rest are the 16 other bits. So what we need to do on the top is send a one and then send the mode and the address. And then the X's mean don't care. So we can just send zeros, because that's easy enough. And then on the receive side, they're basically saying, question mark, we don't know what we're gonna give you, so don't look at it. So we just have to ignore, I think that's like, what, 14 things or 13 things that we have to ignore and then we get a zero. We definitely get a zero. And then we get the good stuff, the value. So three bytes, yes. So what does that look like in Elixir? And this is actually one of the coolest things to me. So if you look at the, so spy transfer, if you look at that second parameter, the pass of one, and then the mode, size, and so size of one, so one bit, the sensor, which is the address, so it has a size of three, so three bits. And then we're gonna send 12 bits of zeros. So we do that spy transfer and then on the receive inside, that with the pattern match, we just ignore the first 14 bits and use the 10. And this is, I actually almost can't imagine a more concise way of expressing this. And so I want to impress upon everyone here that with so many, with our interactions with hardware, so many times you have to go through a library, right? So there's a lot of stuff encapsulated in libraries. And going through a library is great. We need this abstraction, but the problem is, is if anything goes wrong, what are we doing? We have to look at the, see how things are implemented in the library and we eventually have to look at the data sheet. Well, this matches almost directly with what the data sheet says, except in possibly more friendly terms. So if anything goes wrong, well, we have the data sheet here. You can just compare and look. And more often than not, you want to do something that your library doesn't support and you just want to tweak it a little bit. And because you know you've read the data sheet that the device can definitely view this, but then you have to cut through all these layers of abstractions. And Lixar makes this so nice and simple that you just have just what you need right there. And this is not some isolated example of a device. There are so many devices that are just as simple as this. It ended up with code like this. You're almost questioning, do I even bundle this in a module? Because it's so easy. All right, so that's the first part. And this next part of the talk is going to be about what you do when you want to work with hardware on your laptop. And so obviously the laptop is really nice, right? Most of you, all of you probably are very comfortable working with your laptop already. And maybe you haven't done anything with hardware, so changing as little as possible to do stuff is highly desirable. There's actually quite a bit that you can do, but of course the drawback is it's on your laptop and if you're building something and want to have it monitor something 24 seven or do something, I mean you're not buying laptops all the time, right, that'd be silly. But the other problem is despite how fast your laptop is, the interface is to connect the hardware from your laptop are a little slower than what you can get on a Raspberry Pi and Deaglebone. So here's the thing. Often someone who'd present this would say, okay, use a serial port, so I'm gonna call it a UART and because that's what it's called in pretty much everything that I use. So there are differences, so those of you who know this know that there are details here that I'm skipping, but you will see this term frequently in some of the, in the data sheets and other documents for these devices. So UART, briefly universal asynchronous receiver transmitter, three wires is what these things normally have. So receive, transmit, ground. They do kind of the obvious things, ground. Of course that has to be connected to everything that you work with and then receive and transmit. They toggle the line to send bits or you look at the line to see how it's toggled if you want to receive something.  So why do we stick around with this kind of technology? Well, it's dirt simple and it's everywhere, everywhere and embedded. I mean, you can think of any number of ways to communicate between chips, but this UART has hung around there and I think what it comes down to is it's really easy to debug, right? If you want to just test to see if the wires work, right? You can stick a paper clip and tie together receive and transmit and then on your computer have a terminal and say, you know, type AAA and it doesn't come back. No, there's probably a break in the wire. But if it comes back, then at least that part works. So there's a lot of aspects that are pretty easy to debug. It's of course wired, a wired technology. There's lots of options to make this go wireless. Of course, once you start talking about wireless, there are other options that you may want to consider. All right, the key thing that you need is USB to serial cable. So all of you that came to the workshop, we gave these out at the workshop, but this is like the best piece of equipment that you can get and they're not that expensive. There are some details to this. So I wanted to post this up here so that anyone, when you go to buy one, just to keep some of these attributes in mind. So logic, it will have a spec that says logic voltage level. So that's the receive and transmit wires. So the idea is that if you're talking to something that only likes three volts, don't give it five volts, right? So, I mean, nice thing. So logic voltage level is that almost always you're gonna be working the three volt for probably most of what you do with elixir. I think most of the five volt things are at least much less common now. The other part is they sell them with, see how the wires are apart. The other way they sell them is with the wires stuck together in one line. So that's called a six pin header. That is actually convenient. If you really like the Beaglebone Black and there are a couple other things, they have the six pin headers so you can just plug it on. When you have the wires apart, what happens is you plug in one wire into the wire that you think is received or the place that's received, another one in the transmit and then you find out that you got them backwards and things don't work. So it's kind of like USB, you know how you plug it in one way then turn it over and plug it in the other way and then keep on doing that. Though it's the same idea when you have them apart. But it doesn't matter. You actually don't hurt anything if you make that mistake. Then the convenience is some of these come with five volt power supplies. The red wire on there, that will supply five volts. So you can actually power the thing that you're talking to as well, which is very convenient. Some names look for FTDI, prolific. I only put this, so if you go to a reputable place, you don't have to worry about this, but there are clone chips out there and I got duped a couple times, I think by being cheap when I needed a few more and if you're on Linux, no problem, you're fine. It seems like the clone chips always work on Linux, but Mac and Windows, they give you unknown pain that it's kind of the last thing that you need when you're getting into hardware. Okay, so let's do something with this and a fun thing to do is just to find out where you are with GPS and the GPS modules, there are actually tons of these. Most of them work the same, a similar way and they have a UART interface, so this is one that's actually pretty easy to plug into, so I took a picture of it, but if you look at the holes on the left side, the bottom four, so the VIN that's voltage in, so you give it five volts or the next one's ground and then receive transmit. So if you actually had that USB to serial connector that I showed before on the previous page, you just connect those wires to those four ports and you're good and you can use GPS on your project and so we're gonna connect it up to your computer, your laptop so you can do some development with the GPS chip and I guess from the software side, these GPS chips come with little documentation that says how they report things and there's a spec called NMEA 0183 and it tells you the format and I'm not even gonna show this spec because I actually think that most people will kind of glean the basics just from seeing it. So you get this chip, you connect it to the computer, then you need some software in Elixir to talk to it and one of these is this library called NervzUART. So NervzUART has the C code that knows how to talk to the serial ports. So there's actually another one called Serial, so both of them work. So I'm gonna demo, well not exactly demo, I'm just gonna show you some slides of how this looks when you connect it up. So the way I normally, when I get a new device, I just wanna play around with it so I bring it up in IAX session with NervzUART. First thing is where is the device connected to your computer? So this is on Linux, so you call NervzUART a numerator and you get that one UART connected on TTY USB zero and it gives a couple descriptions on it. If you're on Windows then you'll get like com five or com six and Mac, this is really helpful because you get some TTYCU dot blah, blah, blah, blah and it's really long and easy to make a mistake to type in, but you can enumerate them, figure out which one is the right one. If you actually go into producing devices you can set a lot of those fields so that your program can look through and pick the right one. So that's kind of neat. So the next thing is we're gonna open it up. So the first thing to do is to start the NervzUART gen server and then open. So there are a couple parameters open. Well, what are you gonna open? TTY USB zero is just like we showed in the last slide. Serial ports all have speeds. So those of you from the modem days, we're back at 9600 bot and we're okay with that because GPS only updates so quickly, so it's not a problem. Last parameter is called is whether you want active mode or not. So active mode is a NervzUART feature. There are two ways of working with devices. So one's passive mode. So passive mode you write out and then you call read to get more data. And the reason why passive mode is interesting is sometimes you just want to set a configuration on the serial port and be done with it so it's kind of nice to have that inline code to where you write read directly. The other interesting part is when you get into flow control, if you don't call read, the serial port eventually turns on flow control and stops the sender from sending you new stuff. The alternative mode is active mode, which you still send the same way, but when you receive stuff, you receive it in messages. So let's just see what happens. So connect it up to GPS, call read, and we'll get back a big string of all the stuff that the GPS chip sent. And I fully didn't take it apart, but if you stare at it long enough, you can kind of glean some slash r slash ns.  So I think if you're thinking that this is CSV, that's pretty close to it. So anyway, start there, start seeing stuff, and you're like, okay, well, let me try to integrate this into my app. So I know in my app, I'm gonna make some gen server and I wanna receive events whenever the GPS reports a new position. So this passive mode stuff, this was one mile, but let's switch to active mode. So let's just see what happens there. So you switch to active mode, and then all of a sudden, you look at what messages you get, and then you're like, oh shoot, I got a message for each character. And first time you see this, it might not be obvious what happened, but at 9,600 bars, your computer's doing a lot of waiting. So it gets a bite in, then a few billion cycles go by, then it gets the next bite. So you end up getting messages one at a time, which is kind of annoying, since you kind of have to accumulate things, but it's actually worse than that because you're not guaranteed to get one by the time, you could get two, you could get any number. So there's a process with Nerf UART, so it can accumulate things and give you the messages from the device in nice little chunks that are easy to parse so you don't have to aggregate the data on your end.  So that's actually where I stopped with this because I thought that for most of you unbundling CSV data was sort of bread and butter, but getting the actual data was perhaps the harder part. So if you're interested in hooking GPS's up, maybe if you're working with them on a project, this will get you started. There is a library out there that someone wrote that decodes these messages that you get into nice little latitude, longitude, velocity, and all the other nice things that you can get from the GPS satellites and chips. It's called XGPS and it's on hex. So what else, what else can you do? I think this is an age test. So by the last, I hope some of you saw this, so otherwise I'm feeling kind of old. Good, good. So ATTT, so those of us who lived before internet days, the way we would connect to other computers is through modem and we type in ATTT, so that was dial and we had seven digit phone numbers back in the old days, so we type that in. And actually if you, so this is digital, I had to do pulse, so even more embarrassing. So the reason, why do I say this? It's because the whole AT command set is in tons and tons of chips. And you will see this if you want to use any of these. So Bluetooth cellular cell light. So if you have a project where you want to communicate with my locally or even if you're on a boat or something, you have to go to a cell light because you don't, or you're someplace where you're really remote or if you just have some data collection app where you wanted to report in via cellular. Well, you can use Nerf UR to connect to that device over your base connection and you type, well, your program type, AT, and then you can look at the specs for that or what commands you might want to send. It's very useful, so, and it's very easy to use. And the reason why I point this out is even if you're not going to deploy this on your laptop, you can do all the development on your laptop. And I think that's very important, especially if you're new to the field, is to stay on your laptop as long as you can, get some of the kinks worked out or maybe feel a little bit more comfortable and then move on to nerves or move on to a Raspberry Pi so that you're incrementally getting more familiar with this kind of business. So the next thing I want to point out was just the gym that's out there that you can do, which sometimes I feel it's a little silly but I wanted to explain why it's not. So that's connecting to an Arduino. So you can just get any Arduino, plug in USB to your computer, and it can talk over the serial port. It actually makes a virtual serial port, so it's accessible and there's your art. If you install, if you go through the Arduino IDE, there's this thing called Formata. And Formata is just a simple protocol to let you remote control your Arduino. What's neat about that is that when you can remote control your Arduino from Elixir, you can access all these IOs and shields and everything in the Arduino ecosystem on your laptop. So if you're interested in doing this, we actually have a Formata library in Elixir. It's there, it's kind of sad right now because it's looking for a maintainer, but it's actually quite convenient to use this and I would encourage anyone to step in and help out with this. I know I certainly will be helping out a little bit in the near term to get to a place so it's more convenient to others, but it would be nice to get this going more. And I need to mention this because I have another talk that I give on how do you architect nerve space systems or actually any embedded Linux system. And this is one of the takeaway slides that's for a lot of embedded. So these are special purpose devices. You have a bigger, fancier processor, an ARM chip or MIPS or x86 that handles all your web, you know, the web page, the GUI, command and control. There's all this other infrastructure that handles. So you have it right here and you're running on Elixir so it's all software real-time. And then you have a micro controller off to the side that handles the hard real-time pieces. And the reason you do that is because developing hard real-time pieces, even though they're very simple, maybe they have these short deadlines and they need to work predictably, it's a lot easier to think about their correctness and test their performance out in the context of a nice little chip where it's unencumbered by all these other pieces of software running right next to it. And I mean, you're not worrying about Linux interrupts somehow making this thing go, you know, get delayed by a fraction of a microsecond would end up causing a hiccup on your device. So you have this setup where you have the two processors and you communicate between them via like a UR connection. Actually, there are a lot of other buses that you can use but since we're talking about URs, I put that one there and it's not uncommon to see that. So that hooking up that Arduino to your laptop is totally a real thing. It's that has analogs in professional embed devices. All right, so we've gone through the main routes. So how do they compare? What's the summary here for when you should use one or the other? Now the, so if you're using, so the first step is where are you doing your development?  If you're on Nerfs or the desktop Linux, the target's involved. So Nerfs has a hybrid approach where there's both you're doing some work on your laptop and the tipping over firmware to the target and then the desktop Linux one is basically, you work directly on the target like it's your own little computer. Other things to consider, so really the performance and the amount of this space really matters when you're developing on the device. So the desktop, the Raspberry Pi's, you kinda wanna make sure that they're fast enough for those of you who have worked on them.  And if you're compiling Erlang or Elixir on some of these devices that I've used, the compile times are like half a day or a day. So it's kind of painful. So get one that's fast and don't put yourself in this pain. And if you want to work on a Raspberry or if you eventually want to use a Raspberry Pi zero, maybe do some early work on Raspberry Pi three, right? So this, it's a little faster. Support devices, this is where it gets into what you can hook up. So obviously on, if you're using your laptop, it's whatever goes over your, but the other two nerves in desktop Linux are pretty much just limited by what's on the board, whereas if you start out with the desktop Linux or Raspbian, all the drivers are included. So often I start out there. And I, you know, if I don't know what I'm doing, I start out there, then I kind of see like, what are the pieces that I didn't know existed that I'm using? And when I get that list, then I add them to my nerves configuration. That makes things a lot easier because you can do everything on nerves, you just need to know what you need to add. Let's see. A couple other things, the tools, well, you can read as well as I can. Deployment, I think deployment's interesting when you get into production, or you want to start sharing this with a lot of people and the things get easier as you get to, as you get to nerves. I think this is one area where we focus a lot on. Fortunately, not everything's open sourced yet, but being able to send around small packages that have the code that runs on the device is quite nice and things update a lot more quickly and that you can do things like sign the packages and that's so that if you're concerned about someone mucking with your firmware, midstream, you can do stuff like that, whereas the others, it's not quite as obvious how you do it and things are a little bit slower. So I guess the key thing is when do I use this? And I use all three, like I said in the beginning and I highly encourage all of you not to think that I want to do Elixir and I want to connect the hardware. No matter how much I want you to go to NERS because this is really a fun project for me, that's not always the right answer. So check with yourself. If you can do something on your laptop through a UART, if I wanted to use USB to serial cables, it's actually quite nice experience. I actually find myself when I can, when I have some setup that's similar to that, doing a lot of development there. The desktop Linux one, if you have a lot of confusion with NERVS, go there, see how Dubbian or Raspbian or whatever the operating system or the board vendor did, how they solved the problem. Usually it's a lot simpler than you think, but when you don't know what you're doing, it's nice to check in. And so then the last one, NERVS when you want to do this for real, or there are actually quite a few cases where NERVS actually makes some things easier, so you might go to the laptop, you might skip over the middle one and go straight to NERVS. But that's a gist, that's how I look at it. And if you want to find out more about the two projects that I talked mostly about, the NERVS UART and NLXRL, those are, they're on GitHub, of course, and they're also on Hex, so you can find them there. On Twitter, you can find me there at FunLift and at, I'm at NERVS Project too, so NERVS Project, of course, is central to NERVS, but we certainly cover a lot of other things that are of interest in general. The Lixerlang Slack has, I think, become the de facto channel to go to on Slack if you want to do anything embedded. There are other channels, but there are actually quite a few people that answer questions, embedded questions, so it's really cool that if you need a little bit of help there, you can go there. And of course, if you're doing something professionally and you get stuck or just want to have a little bit of help, feel free to contact me. This is what I do to keep this hobby and this project going, so it always makes me happy to help someone else put this into production, so you can email me there. So that's what I got, and I think we're out of time, but I'll take questions afterwards, I'll be around.