Transcript from the "Setting Up the Tessel 2" Lesson
[00:00:00]
>> Steve Kinney: All right. So what we do now, is we're actually going to set up our Tessel 2. So attached to my computer right now, I have a brandnew Tessel 2 that I have never set up before. We're going to set it up together. Now tessel.io/start which will actually resolve to this longer URL.
[00:00:19] There are instructions for whatever your operating system is to get up and running. I am going to go through the Mac OS instructions because I am using a Mac. My suspicion is that if I try run the Windows commands on my Mac, it's not going to go well.
[00:00:35] So I'm going to stick with the Mac instructions. But this will kind of get you through to getting this set up either way. The one kind of general purpose command line tool that we're gonna use is the Tessel 2 CLI, which we're gonna saw globally from NPM. One thing that I've noticed, kind of preparing for this is Note 10 recently came out and installing some of the tools on Node 10 is not fully there yet.
[00:01:06] You can try it out if you have Xcode. It'll actually try to compile the modules and everything will be okay. But if you're Node 10 and you don't have Xcode, things can get a little weird. So you're better off using either Node 8 or 9, and you should be totally fine.
[00:01:21] If you have something like NVM installed, you can switch between versions of Node. We'll deal with that if somebody has an issue with it, but I suspect it was only when I cracked open a new computer and took it for a spin. And I put the latest and fanciest version of Node that I had that problem.
[00:01:38] So generally speaking, it shouldn't really be an issue. So we're gonna run this command. I actually already have the command line tool installed but I will run it to be a good sport. So we'll just do this npm install t2-cli. For me, it's gonna go fairly quickly cuz I do have it installed.
[00:01:58] Apparently num num is no longer supported. That's a fun fact but it doesn't actually affect us. So to pull it down, go ahead and install everything. Although, it might take slightly longer for you.
>> Steve Kinney: Not too much longer. So as I run to kind of explain the next few steps is we do need to find our Tessel, which if you don't already have it plugged in via USB.
[00:02:26] Now is a good time to do it, cuz it'll be very hard for you to define Tessel, unless it is plugged in. That seems obvious, but once you set up WiFi, if you bring it home and you're using it there, that's actually not always true, cuz it's connected via WiFi.
[00:02:41] But at this exact moment, it does definitely need to be plugged into your computer. Cool, so I'm gonna give everyone a minute or two just to run that npm install -g t2-cli. And if everyone can just make uncomfortable eye contact with me when that's installed, that's how I'll know that we're good to go.
[00:03:01] Great, so at this point, everyone's got the Tessel 2 command line tool installed. Despite the fact that we did npm install t2-cli, all we have to do from this point forward is type t2 from the command line. So what we'll do is this t2 list which will list all the devices currently connected to our computer.
[00:03:18] So I'll go ahead and try that out. Searching for nearby tessels. You can see I found one with a very cool name right here called Tessel, I'm not saying that out loud. So we found the one connected to my computer, like your numbers will obviously be different. That's the unique identifier, it's about to get a lot more unique because the next thing we can do is rename it to something a little bit more tolerable.
[00:03:44] So you can name it anything you want, their suggestion here is Bulbasaur. When I was kind of putting things together, it was a great father-son bonding experience with my 5-year-old. I'm sorry, he's 5 and a half, and I was like, okay, what do you want to name it?, and so he chose to name it RobotComputer, which I thought was very inspired and original.
[00:04:03] So you can name yours whatever you want. I'm going to take his advice, and name mine RobotComputer. Now, let's say for instance you were building some home automation stuff, it could be like Tessel in the cupboard to make sure no ones stealing my cookies, or something like that.
[00:04:25] That's probably a really long name. But you could, if you had multiple tessels, you could probably name them something very relevant to their purpose in your life. But right now, you can just name it whatever you want. If you are struggling to come up with a name, might I recommend RobotComputer, or RobotComputer2, or some combination thereof.
[00:04:45] Johnny Five, all of these are fair and good options. Cool, so now we have it configured. We have it named. The next part is connecting it to the WiFi. At one point, we're not going to program it over WiFi but at given point, we are going to run a websurfer on it.
[00:05:05] Spoiler alert. It's always great when people say spoiler alert afterwards, right? So we do want to connect it to the WiFi. So, and the way that works is t2 wifi, and you give it the -n for the network name. And that is MJGworkshop, and the password. I hope this wasn't secret.
[00:05:33] We're on the 36th floor, I don't think anyone's sitting outside the building trying to steal WiFi, so I think we should be good. We can try both of those. If you find yourself wanting to use WiFi that doesn't have a password, that's always suspicious. But you can just actually not put that -p and it will only connect to a WiFi network without a password.
[00:05:54] So take that for a spin. And it's gonna look for my Tessel which is still connected via USB. It's connected to RobotComputer. It's basically going to connect it to the WiFi. All right, very cool. One other thing that we're going to need later but I'm just going to show it to you now.
[00:06:12] Is if you just type in t2 wifi, you'll actually get some information about what network it's connected to, as well as the IP address. Which is if we want to hit it as a web server, useful. So that is the local IP address of my RobotComputer connected to my MacBook right now.
[00:06:32] So if I spin up a web server and I need to go visit it, this will be where I go visit. Yours will obviously differ slightly, depending on your IP. Cool, so now we've got it connected to the WiFi, so far so good. Is everyone feeling good? Cool, all right, so now the other thing, we're not gonna program it over WiFi but we're gonna kinda go through these steps for posterity which is if you had a Tessel 2 and you wanna program over WiFi.
[00:07:03] It's probably not great if anyone connected to your WiFi network can go ahead and program your Tessel 2, right? That's probably bad. That means somebody sitting outside your apartment could theoretically reprogram your hardware. So the way this works is that your Tessel 2 uses effectively, key pairs. So we have a public and a private key and you basically say, hey, this computer is allowed to program it over WiFi.
[00:07:29] And the way we do that is teach you provision.
>> Steve Kinney: And it will go ahead and look for it and then basically authenticate it back and forth. So now, go computer is setup with your Tessel if you did need later to program it over WiFi. And we'll just do a t2 list.
[00:07:48] Actually technically, you see like two of them now. Well you'll see more if you have a bunch of friends in the room. [COUGH] You'll actually see more if you have a bunch of friends in the room. So here are all of our Tessels. The fun thing that we got to do together is find out what we all named our Tessels.
[00:08:08] All right, so we've got RobotComputer there, we've got Fred. Very cool, we have JabbaTheBot, I like that one.
>> Group: [LAUGH]
>> Steve Kinney: Pixie dust, very cool. And you can see effectively which one. I can go ahead and provision any of those as well. Cool. So the next thing we're gonna do just to get us all on the same page is just update them all with the latest firmware.
[00:08:34] These are all new, but who knows how long they've been sitting on a shelf. So we'll take that first one.
>> Steve Kinney: Yeah?
>> Speaker 3: So I'm connected to my Tessel via both USB and LAN.
>> Steve Kinney: Yes.
>> Speaker 3: This firmware update, what's it occurring over, does it choose?
>> Steve Kinney: Generally speaking, if USB is available, you can actually when we deploy code, you can do --LAN or --USB if you have like strong feelings in which one you wanna go over.
[00:09:04] I don't have like strong, we were go over the USB generally speaking.
>> Steve Kinney: But for those of you who like doing it at home, if you want to do it over WiFi, that's totally fair. The only reason why we're not doing it over WiFi is because humans in the room together.
[00:09:21] The humans aren't actually the problem, it's the devices, right. It's the, how many laptops connected to how many tessels. The humans actually don't have an impact on the WiFi.
>> Steve Kinney: Cool. So now, we have a new process that will take at least two minutes. I don't like, I like the confidence in that two to four minutes earlier more than I like these two minutes that I'm getting now, but.
[00:09:47]
>> Speaker 4: It definitely doesn't work with ten or something else.
>> Steve Kinney: Yeah, I can confirm that it is not work with Node 10 unless you have like Xcode installed or whole bunch of other stuff. I didn't have Xcode installed and hotel WiFi was not the WiFi to download 5 gigabytes of Xcode.
[00:10:02]
>> Speaker 4: I should have that but I might have accepted that, too. I used NVM to go back at nine.
>> Steve Kinney: Yep.
>> Speaker 4: And that's not working either.
>> Steve Kinney: Nine is not working?
>> Speaker 4: No.
>> Steve Kinney: Do a node -v to make sure actually on nine. I don't trust NVM on the first time.
[00:10:22]
>> Speaker 5: Did you reinstall t2 after you switched to the other version?
>> Speaker 4: Yeah, that was required for the first part. Yeah, so that is still not working.
>> Steve Kinney: What is the error?
>> Speaker 4: There is a whole lot of them. Let me see if it works with the,
>> Speaker 4: It is just update check field user, did that.
[00:10:53] Saying I don't have permission for making a directory of users. Tessel?
>> Steve Kinney: Let me take a look at that in a second. Seems like a file provision issue.
>> Steve Kinney: Sure, I will send crash reports.
>> Steve Kinney: I feel like when I hit the y, that's not what I meant but I also wasn't looking at my screen and had my fingers on the keyboard so I might have hit another.
[00:11:24]
>> Speaker 5: It knew what you really-
>> Steve Kinney: It knew what I really meant.
>> Speaker 5: Yeah.
>> Steve Kinney: Yeah.
>> Steve Kinney: How's everyone else's installation process going? Everyone's a thumbs up except our file directory.
>> Speaker 6: Mine's crashed too.
>> Speaker 4: I also crashed, yes.
>> Steve Kinney: All right, we all crashed.
>> Group: [LAUGH]
>> Steve Kinney: Very cool.
[00:11:45] We're off to a wonderful start. Did anyone not crash? I feel like consistent crashing would be better than, [LAUGH] intermittent crashing.
>> Speaker 7: Mine says update complete, but it's still spinning on the bottom after that. So it says, firmware update complete.
>> Speaker 5: Updated.
>> Steve Kinney: Yeah. I'm at one point gonna control C, and see how it goes, cuz I have like worse case if I fry one I have a second one.
[00:12:17] The rest of you don't have that luxury, so I will go be the sacrificial lamb, [LAUGH] to see how it goes first.
>> Speaker 5: Looks like it reset all the names, too.
>> Steve Kinney: Cool, so just real time followup, and so my CLI crashed. But if I run t2 update, I'm running the latest firmware, so crash is a strong word.
[00:12:57] [LAUGH] I think I can confirm that it looks fairly safe to control C. You might have to do the renaming process again. But it looks like I am on the latest firmware version now. Looks like that part was successful, it's probably some clean up afterwards. More importantly, putting together my awesome name, which I now have to redo.
[00:13:25]
>> Steve Kinney: We'll do a t2 rename,
>> Steve Kinney: RobotComputer.
>> Steve Kinney: Cool. So let's take a quick break while I check on everyone and get everyone kind of like set up cuz there's no more actual steps once this happened. So I'm gonna stop for a second and see what's going on and then once we're all ready to rock and roll, we'll pick back up again.