Episode 15
Nervestendo
August 2nd, 2018
45 mins 46 secs
Tags
About this Episode
This week Anna and Amos are joined by Nerves core team member Connor Rigby. They discuss nintendo hacking, robotic farming and how to get started with nerves development.
Support Elixir OutlawsTranscript
ANNA
How's it going?
AMOS
Good. How are you doing today, Anna?
ANNA
I am doing good.
AMOS
Staying busy?
ANNA
Yeah. Sorry. I was running a little behind just because my meeting this morning ran a little long.
AMOS
Well, if we weren't always so early in the morning for you folks out in California.
ANNA
Yeah. Thanks Connor for joining us so early in the morning
CONNOR
I'm usually about this early, it's not super early for me. I have co-workers all over us in the world. So I'm usually up early for them.
AMOS
We have, we have Connor here. I was going to, usually I compliment Connor on his shirts and today he's got kind of a plain one, but normally Connor gives, gives Eric Meyer a run for his money on shirts.
Read Full Transcript Hide Full Transcript
CONNOR
I should have picked a better one, I guess it doesn't matter since audio instead of video. You're the only one who gets to see it.
AMOS
That's true. I like your shirt though. That's pretty cool. Uh, so, so Connor is, uh, I can introduce you or you can introduce yourself. It doesn't matter.
CONNOR
Why don't you go ahead?
AMOS
Connor is a member of the nerves core team and uh, all around great shirt guy. And I don't know if you've ever got to spend much time with Connor, Anna, but, uh, uh, Connor, Connor has always got some cool stuff going on and I watch all the time, Twitter messages come across saying, I just put nerves on insert random Nintendo device here.
ANNA
That is so rad!
AMOS
Uh, yeah. And so like, I guess that's what I kind of wanted to talk to Connor about today is like first, like what drives you to, to do this? And then how do you get it done? And, and, uh, what does the future nerves devices hold?
CONNOR
Um, so yeah, why is, I don't know. I wouldn't have any valid reason to tell you why, because it's usually not like a, uh, like fruitful endeavor. Usually it's not, uh, something useful at all. Um, it's more of a just cause you can situation. So most recently, I think probably the most recent that I've shared is on, uh, on Twitter. I shared Nintendo switch running nerves, and that one actually wasn't that difficult at all because someone else did a lot of the hard work of getting most of Linux running on it.
AMOS
So that's kind of the secret - get Linux running on it.
CONNOR
So a lot of it, the Nintendo switch is kind of cool cause it's Nintendo's, you know, newest, latest, greatest thing. Usually Nintendo, uh, builds a lot of like custom proprietary hardware. And this time they, uh, pretty much just bought a, uh, uh, Tegra jettison X1. Basically the reference implementation and made it really small. And that was about all they did to it. So most of the Linux ports was done for them because Tegra releases Nvidia releases a Linux image when you're developing. So basically the upstream Nvidia image worked on the Nintendo switch with some white modifications and that, so getting nerves running on that was, you know, fairly straightforward because most of the work's already done. I helped, I helped the guys who are maintaining the Linux port for it, with a couple of weird little things like a USB and stuff like that. But for the most part, it works. Um, I actually do plan on using the Linux switch port for some stuff. It's just not quite stable enough. And I haven't had time to put a lot of work into it other than making posts on Twitter about it. That's really the important part is just making sure everyone else knows about it.
AMOS
Are, are these secret plans or...?
Speaker 3
Yeah, they're not really a secret plan. It's just, I haven't decided on which one I'm going to pursue. First. One of the other things I've been working on with the not necessarily nerves is, uh, just elixir as I've been writing a, uh, there's a little open source quad copter called the crazy fly. And, uh, I think, uh, by a company named bit craze and it's pretty cool. It's like 200 bucks and it's like a fully open sourced, uh, hardware and software design, uh, for quad copters. And, uh, I've got a few of them in the original like controller software's written in Python and I'm not a huge fan of Python. And so being open source is cool and all, but I just don't like writing Python. So I started porting the library to make it work to, uh, some C and elixir. And so I've got that going now. I've got a little Phoenix app for controlling a little quad copter that works pretty well. Um, but my end goal is to have that it's controlled by a little USB device, a little USB radio. And my end goal is to have that running on the switch so I can control my quad-copter with the switch
AMOS
That. That is pretty cool. So are, are these, uh, the crazy flood quad copter? So they, do you have to build them when they show up or are they already pre-built
CONNOR
Build mine, but I think they're to a point where I'm like, they can ship them to you mostly assembled. Like, all you have to do is like, like pop some plastic parts together.
AMOS
When, when you build it, did you need to have soldering iron and stuff like that? Or is it,
CONNOR
Yeah, it was a huge pain. Um, I think I only, um, so I've gotten a few of them and the very first one, I got required a lot of assembly. Like you had to solder a lot of little things. You had to solder like a pin header on the battery. Terminal is the motor terminals, all that stuff. Um, the batch that I bought, I've got like four of them. I think I bought them in batches of two. The second set I bought, I only had to solder like the pin header to hold the battery on. And then I think the most recent ones that they sell actually kind of like pretty much fully assembled. You just have to like snap it together.
AMOS
So I met Connor at elixir com last year. Uh, we were both helping out with nerves trading and we're in the back and Connor pulls out his DS and he's like, check this out. I got IEX running on my DS.
CONNOR
Man. I wanted that to be useful. It's just not, I had such great plans for it when I first got it running. But then like after getting it all running, there's just too many places where it's lacking in features. And like, so the DS is the 3d S and it's got wifi on it and I don't want to write the wifi driver for it. And no one else has gotten around to it. So without networking, it's not that great. Um, and then without a physical keyboard is not that great either. Like there is like someone made a little, uh, a little app or like a, uh, a touchscreen keyboard on the bottom screen. Cause you know, it's two dual screens and the top one or the bottom, one's a touch screen. And so, you know, you can type things into IEX, it's just, there's not really that much you can do with it without having networking or USB support. But that was, I got that running before the switch was even announced. And that was like, I was like, this is how I'm going to control my quad-copter. And that didn't pan out.
AMOS
Was that your first Nintendo device that you put nerves on?
CONNOR
Uh, probably, yeah, I think I've only, I've only, I think it's just the switch and the 3DS that I've got nerves running on. I've also started working on the PlayStation Vita that recently, like within the last couple of months, the PlayStation Vita is kind of like hacked or whatever. So now you can run whatever you want on it. And, uh, that's usually like the first part of, you know, that whole system is someone has to make it so you can run your own code on it. And I think someone's started porting Lennox to it. I've got like, I've got like a proof of concept of it running, but it's not very great. And I haven't really got to like anything useful yet, but I was hoping to get that done before this elixir cough, but I don't think I'll have time.
ANNA
What motivated the initial, like, I want a nice copter with my switch or what prompted that?
CONNOR
I just have nothing else to do. I wake up in the morning and I'm like, man, how can I make my life a little bit worse for the next month? No, I don't know. Um, I have, I have like a tendency to just tinker with things that have no business being tinkered with. They're like, I control my house with random things that I built, just because there's no reason to it's just to say that you can, I to post about it on Twitter. Gets lots of likes. Right.
ANNA
So it's all about Twitter.
CONNOR
Basically. That's the summary of, most of my life is how can I make Twitter? Like me a little bit more.
AMOS
I just need retweets. Oh yeah. I, well, and I you're always tinkering with stuff. I know that at one point you messaged me and we started looking at like a tape deck for your car.
CONNOR
Oh yeah. I don't remember what that problem. I think I solved that problem differently, but, uh, I don't remember what the problem was, but my girlfriend's car, we are moving and, uh, we were moving in. My girlfriend didn't have like, her stereo is broken or something. And so I, uh, I didn't want to rip out the, like the deck that was in it. His like, I don't like the look of modern, uh, like stereos and cars. I think they look ridiculous, like flashing lights and like, why does my stereo need all this? It doesn't, but I wanted Bluetooth cause it's a 2003 vehicle. And so they make these little adapter or these little like doodads, they take, you know, 2.5 mil audio Jack and turn it into a Bluetooth thing that you can use. And so, um, I'd hacked the heck out of the tape deck to make that work. And I was messaging Amos about it. I don't remember why I thought you would have my solution.
AMOS
Well, I used to do communications for the military and that's what I fixed radios and satellites, but without, without a wiring diagram, I, I was quite a bit lost of what was going on.
CONNOR
But yeah, that's a interesting piece of equipment that I ended up, uh, hacking a lot out of. Oh, it works now, so that's cool. Nice. That's pretty cool. I think there was an Arduino involved or a raspberry PI or something. I'm fairly certain, it's an Arduino. Most of my life is just ran by random Arduino products.
AMOS
So, uh, what what's, uh, what's your favorite project that you've ever done? I mean, other than you do work on farm bot, so that's pretty stinking. Cool. And everybody gets to see that.
ANNA
Do you want to, do you mind sharing a little bit about what farm bot is for folks that might not be?
CONNOR
Yeah, sure. Um, farmbot is a fully open source, uh, CNC, gardening product. So very much like a CNC router or a 3d printer, but bigger. And it grows food instead of cutting wood or printing plastic.
AMOS
My favorite part is that it kills weeds.
CONNOR
And it kills weeds.
AMOS
By stabbing them.
CONNOR
Yeah. Stabbing the heck out of them.
ANNA
Wait, how can it, how can it detect some thing is a weed,
CONNOR
So it's not as advanced as you might think, basically you take a picture or many pictures and pharma knows exactly where it has planted plants. So anywhere that it sees a plant that isn't where it's planted one or where it knows about one, it must be a weed.
AMOS
So it definitely wouldn't work with a plant that has runners. That would be bad.
CONNOR
Yeah. Um, it's got some limitations. We're still developing a lot of that functionality, but it works, uh, better than you would think.
ANNA
That's pretty well, how long has farm bot been around?
CONNOR
I think the project was started in 2014, the initial product launch to where you can like go out, it's always been open source. And so like people and myself, like built them before that you could actually buy the farm bot just based on the white paper and the schematics and all the open source documentation. So I built one, I think in 2015, um, just based on like documentation and stuff, uh, you could buy them. I think we launched in 2016 is when we launched the product that you could actually purchase and put together yourself.
AMOS
That's awesome. And Connor got to go to NASA,
CONNOR
Yeah. Yeah. NASA is trying to put a farm bots on ISS or Mars or something and that's cool. Yeah. It's pretty neat. Um, there's another, there's a group at MIT, MIT media labs. They have a project called the food computer or something like that. And, uh, NASA is trying to get us to put a small version of farm bot inside of their food computer. Both of the projects have like kind of the same goal, like farm bots, you know, mechanically, you know, grows your food or whatever. And then MIT's thing. They kind of control the environment in which your plant is growing. And so the idea is to have the mechanical part from farm bots, with MIT's food computer thing that controls the environment around it to make it like fully a hundred percent automated
ANNA
That's and like, um, I'm sure like to optimize for good production depending on where you are in the world or whatever,
CONNOR
Or where you are in space. Yeah.
ANNA
Where you are in space actually. Yeah.
AMOS
So get some people, you know, drop a few of these off on the moon and come back to earth and then go back up there in six months and have food to eat while they spend some time there.
CONNOR
Yeah. I think that's like one of the ideas, um, they were pretty vague on the whole, like what they wanted, like what their end goal was. They threw out like a lot of ideas, but I think it was mostly just like, they just wanted a bunch of - because it wasn't just MIT and Farmbot. There was like, uh, like there's a number of like agriculture and farming based, uh, companies there. And the idea is just to kind of get them together. And these many companies do all the work and then NASA puts it somewhere when the work is complete or something to that extent.
ANNA
That's pretty cool.
CONNOR
Yeah.
ANNA
How did NASA find Farmbot?
Speaker 3
Wouldn't, I don't know. I know NASA is building a farm bot or built one. They have one in there in like the lobby of the, um, like the visitor center at, uh, in Florida. I don't remember the name of the...
AMOS
Cape Canaveral.
CONNOR
Oh yeah. There you go,
AMOS
Man. I think I need to get in the car. Just drive.
CONNOR
Yeah. It's a little bit closer to you than it is to me,
AMOS
Not much. Florida's a very big state.
ANNA
Are you in Kansas City yet?
AMOS
I am not quite in Kansas city yet be, uh, next month, sometime at it where we're still waiting to close on the house, but inspections done. Everything's going well,
ANNA
Connor what's the most like what's the hardest project you've worked on or what's been the most like frustrating or challenging?
CONNOR
Um, probably farm bought is the most challenging because it like has customers. It's not just me, like when something breaks on my end and the, you know, it takes two minutes to fix and like, Oh man, that was stupid. But uh, at farm bot, when something breaks, it's usually a bigger deal because like someone's plants don't grow that day. And so, you know, that has to be fixed. Um, farm bots. I don't know if we said this or not fond bar is based on nerves. Probably. I think it's the only like out there open source, like full production nerves application. I don't want to take away from, Oh, actually Noah. Um, sorry. Uh, I don't remember the other one, Chris. Uh, Chris Corte's project is open source also. I can't remember what it's called.
AMOS
It's it's the, uh, weather station thing, right? Yeah.
CONNOR
Something like that. He, uh, doesn't post about it as much as I do on Twitter. So I don't remember. See How I brought that to the circle.
AMOS
So, so Chris, Chris needs to get out there and get some retweets.
CONNOR
Yeah, that's what I'm saying. Um, no, his project is really cool. It's um, his is it's fully open source also it's by the national association of realtors and, uh, it's a really neat project also, but anyways, so farm bots runs on, uh, nerves also. And so like nerves is still pretty new. So like a lot of the tooling and stuff for like managing releases and that kind of thing. Like that was probably one of the hardest things to set up for me was the whole, like getting a release to people's devices without breaking them kind of situation.
AMOS
So how did, how did you solve that? I know that, um, Oh, uh, Garth's company I can't remember was, was pushing over HDP, uh, but like they're open cause they had a closed network, so they're obviously not on a closed network. So how do you, how do you push out?
CONNOR
Um, it was not incredibly difficult. I just made circle CI. I do pretty much all of the work. Um, basically have, since it's all open source, anyone can contribute. So you don't want to always be deploying the latest commit as you would like, and maybe a private network where you just push to a particular branch or like, you know, you pushed our Heroku and it deploys your app. So we have, I've set it up with like two or three branches and basically whenever something gets merged into master circle, Circle CI I builds the latest firmware and then makes a Github release. And then the bots just, uh, get a message about that from our web API. And so it wasn't all that difficult to set up like the orchestration on like, you know, overbuilding the release and pushing it out. But the orchestration of like actually managing, upgrading on the device is a little bit more difficult. It's not like, you know, you push an update to heroku or something and you just run the migrations real quick. And if your app's kind of down for a couple of minutes, it's not a big deal. Um, we don't have that luxury when pushing to, you know, an embedded system.
ANNA
How do you handle that?
CONNOR
Just very carefully ends up like, um, like, so I run Ecto on the, on the device, um, for managing like a lot of the resources and configuration data and stuff like that. And so that I just, you know, that's a pretty standard just run migrations, but there are other things like, you know, when the bot is booting in, you know, in a normal, uh, quotes or on normal elixir app, you would like if something fails during boot up, like it's not that big of a deal, cause it'll probably fix itself. But in the case of an embedded system, like there are a lot of things that just can't fail. And if they do, it's sort of a bigger deal because you end up with a device that just doesn't do anything and now it can't download. It's like a fix for whatever problem happened. And so there's a lot of things like that you have to take into account that's are less than trivial, but not super difficult. And it's all stuff that like, it's just stuff that you don't think of when you're like doing a web application, just cause it's, you know, like if you ever made a new Phoenix happen, you forgot to set your database up and like you forgot to do a mix ecto dot set up or something.
And then like IEX just sits there and sends log warning or error logs to the shell, like stuff like that just causes farm bot or an nerves device embedded system to not boot. And so, you know, you just have to be very careful about what you do and don't set up initially, right?
AMOS
You, you don't have to break a server.
CONNOR
You don't often break whatever. I mean, you pretty frequently like worst case scenario, you just SSH back into it or, you know, remote, uh, remash to it. And it's not a big deal. I can't remash into everyone's farm bot. It'd be a large, large undertaking, probably a security concern.
ANNA
That too. Are there any kind of general, like folks that are maybe starting to think about hardware stuff or whatever, with something like this, are there any kind of general things that you do? Like you mentioned, there's a couple of things you do have to think about that are different from, you know, web web applications, et cetera. Are there any that are always, that are always present? There was a couple of things that you always have to keep in mind?
CONNOR
Yeah. I helped out, um, Chris Freeze, I believe is his name. Um, I helped him out with a blog post, not that long ago, cause he was just starting to do a, a Nerves device of some sort. And uh, one thing that comes up, probably the thing that comes up the most when I'm helping people I'll get their nerves. Devices started is when you boot your device up, it doesn't have network and it doesn't have time. So it thinks, you know, there's no internet and it thinks it's January 1st, 1970. And that's just what it thinks the time is. So you can set up network, but time doesn't automatically get set. And, um, SSL is based on time and expirations. So when you try to make an HTTP request, it will fail with a pretty cryptic error or something like certificate is expired when you're just trying to get an HTTP request like Google or something. And so that's probably like one thing it's just like orchestrating getting your device up and running. When you have a web server, you, as soon as your app is up, you can just start making HTTP requests, connecting to servers, doing whatever you want with, uh, not just nerves, but any, here we go.
I'm going to say ~~~~internet of things~~~~ - put sparkles around that. If you edit the video, edit edited, um, you don't automatically get internet and internet, internet is intermittent and like right. You could, your wifi could be down. The network could be down. So those are just things you have to handle. And there's no like global way of handling them. It's going to be different per application. And then, so when you asked a minute ago, what's the hardest thing I'm changing my answer. It's actually a NOx getting updates. It's just managing networking.
AMOS
Yeah. I think, uh, nerves networking is been gone through a couple of names and a couple of big changes.
CONNOR
Um, I won't talk about networking. I supposedly maintain it. And man, I've just not been good to that repository. I've been not good to that project.
AMOS
So my, my big thing when I've tried to work on, on the networking stuff is that it's, it's extremely difficult to test yeah. And require there's so many situations that your networking can get into that, that testing it thoroughly is, is really hard. I like the people who right. Network drivers at, for companies. I I'm guessing they have some crazy big test rig that, that just
CONNOR
Or you're the raspberry PI foundation. And you don't test it at all. You just ship your product broken Colonel driver.
AMOS
They're keeping costs down.
CONNOR
Yeah. I like to complain about the raspberry PI, but this is a $35 computer. Can you imagine telling someone 20 years ago that you bought a computer with like four cores and a gig of Ram for $35? Yeah. That's pretty crazy.
AMOS
The, the things that have gone on with, with embedded devices and, and the fact that you can even run low Linux entirely on a computer that that is fits in the Palm of your hand is kind of amazing from, where I grew up. Yeah. If somebody would have told me that heck even when I, when I started college, which I guess that was a while ago, it doesn't feel that long ago. But, uh, but I felt like we were pretty advanced than compared to, you know, by, in four megs of, or four gigs of Ram for a a hundred dollars.
CONNOR
When I moved, I threw away like 10 sticks of two gigs of Ram, just cause like, I didn't know what to do with it. There was no good use for it. Can you imagine telling someone that however long, think I just throw this away. This is trash to me. Whenever I cook a raw, like I, you know, working with raspberry pies and doing stuff like that, I cook them pretty frequently. I've killed my fair share of poor, helpless computers. And I just throw it away. There's no nothing good for it. Like disposable it's, it's insane. It is really insane.
AMOS
You don't want to throw a whole lot of $35 away, but no, I mean, you're not crying at the end of the day if you had to.
CONNOR
Can you imagine, like, you know, when computers were first becoming a thing, telling someone that you're, you know, when you're gig one gigahertz, one gig Ram four core machine died, you just throw it away. Like that would be someone's job. If they killed their machine,
ANNA
Connor. And maybe people know this, but how did you get into doing embedded stuff or hardware stuff? Is this something you've always been...?
CONNOR
Yeah. I had really slow internet as a kid and I had a lot of computers as a kid just because it was what I was into. So when you don't have internet, you have to do something to keep your time. I guess. Um, I had dial up until I was, I don't know, nine or 10. And so, um, I had varying amounts of like electronics projects. And so like one, um, you know, one of my first projects as a kid was like, get Linux on your 20 year old computer that your family has had for a hundred years because windows Vista doesn't run on it or whatever. And, uh, that's kind of, I don't know. I guess that's kind of where it all started. I started doing like embedded stuff with, uh, Android. Android is fully open source. And so when a new version of Android comes out, all of its source is Android is Linux-based for anyone who didn't know that. Um, so I had like some really random, cheap, like Chinese knockoff phones that, you know, once the manufacturer pushes them out, they don't push updates to Android.
And so like one of the first things that I like data as a kid was, or not as a kid, but like as a young, younger person, uh, was get like later versions of Android on my old phones that had no business running them, which usually involves like Linux kernel, like driver backed boards or riding drivers, stuff like that. So that's kind of where it all started. And I got to say that was way harder than it is to get Nerves running on a device that you just come so far.
AMOS
So nerves tools are very
CONNOR
Helpful. Yeah. Nerves is based on build route and Android open source project is based on some Google engineer with nothing better to do.
AMOS
So. Uh, one of the things that I found when working with nerves and deploying it was really nice is the, uh, the AB partition thing that happens so that you, it makes it really hard to break a device.
CONNOR
Yeah. I was just about to say, do you know how many phones I've bricked as compared to how many raspberry pies I've bricked? It's like a lot of phones and zero raspberry pies. You can always just fix your raspberry pie by popping in a new SD card.
AMOS
That's true. When you can just replace the, the system
CONNOR
Like the AB partition back and forth things. Super nice.
AMOS
So what about, um, some of the devices that, that nurse works with that don't have an SD card?
CONNOR
Um, I, well, I mean the am three, three, the BeagleBone black platform, uh, you can get one without SD cards or like, you know, their reference. I don't know what the reference implementation, but like the beetle on black itself has an EMMC, which is basically just like they took a four gig SD card and soldered it to the board. It's it works the same as an SD card, but, um, that's like you would ship your product on that rather than having your product on an SD card. If you're on like a, a closed source situation where you don't want to have people just pulling the SD card and dumping the contents of it, et cetera. Um, it's not terribly different from an SD card. You have to do things like getting the initial firmware onto the device is a little difficult. Um, Frank Hunleth is actually working with, uh, Justin on, uh, nerves hub, which is kind of tying into that a bit. So, um, basically you have to have the manufacturer or something to that extent, put your initial firmware on the device. But after that, it's essentially the same from nerves point of view. However you end up getting your firmware to your device after the initial ones on there.
And as long as you don't get it in a situation where it can't get back to the AB partitioning situation or something similar, like some similar fallback manner, um, it's not terribly difficult.
AMOS
Yeah. I don't know if we really explained the AB partition, but, um, kind of correct me if I, if I mess anything up here, but you have a system that's up and running your initial system and you push new content to it. It loads everything into a separate partition from itself and then tells the system to restart. And there's some code that when it restarts it restarts on the new partition, the B partition, and if it doesn't actually boot up, it will restart again, back to the, to the a partition. Correct? Yeah,
CONNOR
That is correct. Um, I want to throw like an asterisk on there, but, um, doesn't boot up, like put an asterisk on there is you get to decide what doesn't boot up is because it does well. Okay. So for like the BeagleBone black based devices, there's some stuff in UBU that can magically make it happen. So, um, you boot being the bootloader for that's the thing that actually boots Linux, um, there's some magic stuff that Frank has set up. So if it doesn't actually boot to Linux, it'll revert to the other side or to the other partition, but for the most part, you're kind of in charge of what counts as being fully booted or not. And usually it's something to do with able to get another firmware updates. Like you just want to get it up to the point of getting another update in case something went wrong and then you can continue the cycle of pushing bad for more updates, et cetera, or you could fix your problem. Whatever that may be.
ANNA
What's the most fun project you've worked on Connor? Is there one that stands out?
CONNOR
Is there a one that stand out? Um, I work on a lot of projects. I have this tendency to start really stupid things and then never finished them. Um, if you look at my GitHub accounts, like I just have, like, I think I have like 87 repositories and almost none of them are forks. Like they're all projects that I started and like made really good progress on like over the course of one weekend and then just forgot about, and, uh, one day I'll finish them if you ask me. But for the most part, I probably won't finish them. And so picking one as the most fun, I don't know. I do, I do a lot of stuff. I do a lot of GameBoy, like original GameBoy developments. Like the one that came, I think it came out in like 80 something like the very original one. And so, um, I've got like, I've started a few games on the original game boy, which is pretty interesting. I'd say I make the most progress on those ones.
AMOS
So, so what, what's the process of making a game for the GameBoy
CONNOR
Uh, learns the 80 assembly and then, um, that's pretty much most of the hard part. Um,
AMOS
So do you have to buy something that writes a cartridge or do they have like a cartridge that you can plug a USB into the back of and load stuff on?
CONNOR
Yeah. There's a number of different ways to load, uh, load stuff onto the GameBoy itself. Um, they make like cartridges that you can flash with whatever you want, or I think there's a few of them that you can just put ROMs on an SD card. Now. Um, the SD card runs at 3.3 volts all the time though. And so you don't think of an SD card as being like a huge power drain, but for the game, whether it runs on like a double blade to a AA batteries, it actually ends up being like a pretty big power drain. So I don't use those ones. I think I have one, but I don't use it very often because you only get like an hour and a half of playtime out of something that originally had 20 hours. Wow. Um, for the most part I do most of the developments in, uh, like an emulator. It's pretty easily. That way you just, you know, you that way, you don't have to worry about like waiting for the cartridge to flash. Cause it takes like a minute to flash the cartridge. And that's something that like nerves does really well is like iterating your code is super fast. And that's something that like now I can't, I can't get away from that. Now.
I like every time I work with some embedded device, whether it be like a game boy or some other like, like Arduino project or something like having to wait to push your code to the device sucks with nerves, you know, it takes 30 seconds to be up and running. You don't have to, you know, pull the SD card out of the device. You don't have to do anything. And like, that's just something that now I'm spoiled with. I'd never be able to go back to doing like regular C plus plus C embedded system development, just because it takes so long to get the device up and running, just to see that you, you know, made a typo and you have to do it again.
ANNA
How was nerves able to get it to that point. Like what were the optimizations or something that collisions made you able to actually get it?
CONNOR
Uh, Frank Hunleth never sleeps, I think is probably the real, no, uh, there's like most of like the really cool stuff that happened or like the really useful stuff with nerves is in like the tooling. So integration with mix and elixir is super nice. But even below that as like, um, Frank built this project called FW up and that's kind of like the backbone of a nerves, uh, uh, nerves image for anyone who doesn't, or hasn't done nerves, it's basically like the package that your elixir app is. So you can think of it kind of like a, uh, like you would have a distillery or an OTP release, but it also has like the Linux file system and the Linux kernel and stuff like that, all built into it. And so Frank's FWF project. You can, it writes like Lee's images it and it also packages them. And so one is really fast at it. Like, you know, I don't know if you've ever set up Raspbian or something on a raspberry PI, but it takes like 10 minutes to write the entire operating system to an SD card. Okay. Um, FW uprights the image in like 10 seconds on a slot machine. So it won't write Raspbian of course, but, um, you know, it'll write the nerves image or the FWF image in a matter of seconds.
So, you know, even, so even if you are pulling your SD card and writing data to it every time, I mean it, worst case you got like a minute to get your code up and running. If you were doing the same thing with say Raspbian or something to that extent, you know, 10 minutes between each SD card, right. Don't make yourself a cup of coffee waiting for one of those like that XKCD comic, because they're fighting or something and waiting for the compiler.
ANNA
Yeah. That's fair. That's pretty rad that that's possible.
AMOS
And th the great thing about nerves that I've seen too is that, that, that all sounds semi complicated. If somebody is not, not dealt with making firmware and, and building systems, but there's a lot of that there too already for you. You don't actually have to know that fwup is under the covers or
CONNOR
Exactly. You make it so easy. Yeah.
AMOS
And it'll find your SD card for you. Yeah. Okay.
CONNOR
And basically, I mean, like, you can get started with nerves with like a $5 device that you get on Amazon or whatever shipped to your door. It'll be here tomorrow. You need an SD card and an SD card writer and boom. You've got elixir running on your device. Super nice.
AMOS
Yeah. Most raspberry Pak, raspberry PI packages come with SD cards and writers too. So you have everything in like a one-stop click. Yeah.
CONNOR
Yeah. Shopping so nice. Or you can even get them from like target or, um, what's that place to, um, micro center. Is that what it was called? Yeah. Is that a place? Yeah, I think, uh, I don't, we don't have that in California or at least not one here.
ANNA
What is that?
CONNOR
We have fries. It's very similar to fries. Except fries is expensive. Yeah, that's true. Um, I think you can actually get them from fries. We don't have one here in San Luis Obispo, but, uh, there's probably one in Ventura.
AMOS
I, I hear that fries has. Everything now.
CONNOR
Uh, fries is like one of my favorite places on this planet. It's basically like you, like, if you ever wanted to walk to new egg, basically, that's what it is.
AMOS
Sweet. I've been there. Fries
CONNOR
Really? I think they're, I think they're mostly a California thing. You should, uh, stop by one, one time. If you ever are in California, they're all themed. It's very interesting.
AMOS
Wait, what?
CONNOR
They're themed? They're like a theme park. Oh, they have like, so there's the one in Sacramento is, um, like it's all based on like trains and stuff. There's one in, um, I think in like Escondido or something and it's all the, um, wizard of Oz or something like that. I can't, I think it is, but they all have like these wild themes and they all have like cafes and they were like you to go there and you just spend a whole day and you spend way too much money on stuff that you didn't really need.
AMOS
It's like the Ikea of electronics.
CONNOR
Yeah. Pretty much. I mean, I love Ikea too.
AMOS
You can live at Ikea for the day. Yeah. Go take a nap on a bed.
CONNOR
Go back downstairs. Stores need to have more food courts.
AMOS
Yeah. That's where it gets you .
CONNOR
Stores should have a food court, no matter how small it is. That'd be cool.
ANNA
Is there anything Like up and coming in the nerves project that you're excited about or any changes that are being made or is anything that you can share? I don't know. Um, so yeah,
CONNOR
We have nerves hub coming, which will be really cool. It's um, it's going to be similar to like Docker hub with like one click installed. So you can like, so the idea is that, like, if you see a cool project, you can just one-click install it to your SD card. And, you know, you have that project running on your raspberry PI or whatever device that it was made for. So that's kind of like a really cool thing. I haven't been super involved with the development of nerves hub, but I know Justin has basically been nonstop on it. Justin snacky is another core team member. Um, I haven't seen much of him at all over the course of the last like month or two, because that's just all he's been doing. And Frank is kind of leading that project also. But other than that, for nerves, I'm hoping that we can get, uh, uh, Justin demo nerves, reactor. I think we're changing the name of it, but basically it's the hot code reloader for nerves. And, uh, I'm hoping we can get that going. I've been trying to pressure him into it or the better part of a year. Yeah.
AMOS
It'd be really cool. Like for systems that you can't let go down.
CONNOR
Yeah. Or just like rapid developments is, I mean, because like I was saying, I've been spoiled with pushing a firmware update and it takes 20 seconds. Can you imagine it taking zero seconds? Like you just hit save and it's there that's, that's what I'm waiting for.
AMOS
So, so reactor with, uh, file system watch support that will just load that, that module.
CONNOR
Yeah. I'm not, um, a hundred percent sure how it works. Um, Justin has it working, so part of it's already deployed to nerves devices is that shoe horn. Um, that's kind of the initial, as I extend of the airline VM for nerves devices, it's, um, both a distillery plugin and like what initializes your app and what makes sure it doesn't go down. Um, part of the functionality built into that is also going to work for nerves reactor and it, uh, kind of overlays a remote file system or a remote OTP release onto your device. It's really cool how it works. We just need some tooling on the nerve side or on the host side to get it working.
AMOS
Are you still going to be able to, I think you, you said it, but I, I might've missed it. Are you still going to be able to do the like AB
CONNOR
I, I, okay. Yeah. Regular updates will still work just as if they were, um,
AMOS
I mean, in the hot code reloading, could you end up breaking a device?
CONNOR
Oh yeah. So that's with hot code reloading. It won't use the AB partition things. So that's kind of like the first part of shoe horn is make sure networking doesn't go down. Like, you know, that's an option for it. So as long as networking is up, or as long as the applicant, the OTP application that handles running your code updates, you shouldn't be able to break it unless of course your hot code reloading that module itself, which, you know, there's a bit of a chicken egg problem to get your, like, um, one of the big projects that people start with is nerves in it, gadget and developing that one's an interesting project because you can't use nerves in it yet to load nerves in it gadget. And so you have to kind of, it's a chicken and egg, like you actually have to write code that doesn't break at first.
AMOS
There's a lot of, lot of that that I run into when developing hardware. But
CONNOR
Yeah, it's a, it's an interesting thing to deal with because to test your updates, your update system, you have to have a working update system. Yep.
AMOS
I, and the nerves nit gadget, I think is important just to mention that if you, if you do go out today and order your raspberry pie on Amazon, have it shipped to you. Yes, you should. Uh, and you're gonna load a nerves project, talk to it that you should also do. Um, but include into that, the nerves in it. Uh, well, I just blanked out on the nerves
Speaker 3
And it gadget isn't.
AMOS
Started to say nerves knit project, but that pep thing has so many good little tools that if you're just, if you want to play around, just load that up and then start going from there.
CONNOR
Yes. It's all stuff that you end up. Like if you decide to build a, um, like a production nerves application, it's all stuff you have to end up implementing custom yourself, but to get like, to get going off the ground, it's super nice. Like every single time I create a new nerves project for some dumb idea, I had, it always starts with nerves and, and gadget just cause, um, Frank, Frank is the one who built and maintains it. And it originally wasn't even like a nerves project repository. Like it was originally just something that Frank had. I mean, it's all pretty much like it's all just really simple stuff that you wouldn't think of initially when you're just trying to, you know, hit some API or do some tiny project, it's just all stuff that you wouldn't think of. And that's, you know, it's all been done for you and it's very nice.
AMOS
Well, I know that, uh, Anna can as a stop coming up here, so we probably need to wrap up for the day, but Connor, thanks for coming out.
CONNOR
Yeah.
ANNA
Thank you so much. It was awesome.
AMOS
Anybody have any, uh, any words of wisdom, closing statements they want to give out
ANNA
Connor? What are some words of wisdom for folks that are new to nerves that are just starting out,
CONNOR
Um, embedded systems isn't as hard as you think it is. Just do it - it's especially with nerves. I mean, just come hang out with us. We're in Slack. I don't do anything.
AMOS
They are always so helpful in Slack too.
CONNOR
Yeah. I try to keep that one open as much as possible because the more people I'm responding to in Slack, the less real work I have to do.
Speaker 1
Awesome.
AMOS
Real work involves building a farming robot that kills weeds.
Speaker 3
Yeah. I mean, that's pretty fun too, but
Speaker 1
Well, thank you. This was awesome. Cool. Thanks guys. We'll see you guys later. Yeah.