WEBVTT

00:00.420 --> 00:06.740
So one of the things that we did after Defcon was we went through and cut up all the talks that were given at NixVegas.

00:06.740 --> 00:13.440
And this one has the audio missing for the first five or so minutes, so just bear with me while I narrate over it a little bit.

00:13.580 --> 00:16.480
But this is reproduce this build, how we built the Nix badge.

00:17.880 --> 00:21.240
And because this is Nix, we can just provide repos up front.

00:21.260 --> 00:24.140
So NixVegas slash badge, that's the firmware for the badge.

00:24.140 --> 00:26.180
It uses the ESP32 SDK.

00:26.180 --> 00:31.040
And NixVegas slash PCB is the reproducible hardware pipeline that we built for the badge.

00:31.080 --> 00:44.540
And that uses KiCad as the CAD software with a mix of plugins that are actually packaged reproducibly so they can spit out the correct Gerber file that JLCPCB needs in a bill of materials.

00:44.540 --> 00:52.260
And it's called a centroid file that basically is everything that JLCPCB needs to fabricate the PCB.

00:52.260 --> 00:57.320
And having a reproducible PCB pipeline is actually really useful.

00:57.400 --> 01:10.300
As it turns out, you can run the electrical rules checks and the design rules checks in your build pipeline to make sure you're always getting the exact same PCB every time you upload it.

01:10.840 --> 01:24.060
And also, it's very useful if you're repeatedly uploading things to test JLCPCB's preview feature so you can make sure that your board that you're previewing is the one that you built and ultimately the one you're going to get printed.

01:25.080 --> 01:28.680
Speaking of getting things printed, so this is what JLCPCB ships you.

01:28.680 --> 01:31.140
This was kind of after our prototyping phase.

01:31.840 --> 01:46.180
They kind of are notorious for shipping you a lot of cardboard, a lot of red bubble wrap, and each one of those red bubble wrap things has like, I think, six PCBs in it.

01:46.220 --> 01:55.180
We had to go through every one and pull it out, pop the mouse bytes off, which are basically these little snaps that secure the board frame in.

01:55.660 --> 02:02.580
We had a couple prototype badges that we passed around for people to take a peek at.

02:04.440 --> 02:17.140
And yeah, so we had all these things arrive and Tristan and I basically spent the better part of five or six hours the Tuesday before DefCon soldering all those things.

02:17.140 --> 02:18.400
So this is the first one that worked.

02:18.400 --> 02:26.540
We plugged it into USB and flashed the firmware on it and, you know, thankfully all the LEDs lit up.

02:27.540 --> 02:31.860
And from what it seems like, most of the badges were pretty much like this.

02:32.680 --> 02:36.680
Maybe like a couple defects here and there, but most of them just came up.

02:36.720 --> 02:40.680
They're actually pretty consistent, which was good.

02:42.640 --> 02:57.380
Another interesting thing about the programming process is that the ESP32 uses the clear-to-send pin of the serial line as a reset line.

02:57.920 --> 03:05.680
And that's really useful because regardless of what state the badge is in, you don't actually need to hold down any reset buttons or any bootloader buttons to get into the bootloader.

03:05.680 --> 03:13.500
So you just plug it in and immediately bootload it and it will reset and basically get going.

03:13.500 --> 03:18.720
So yeah, here you can see I'm kind of going over the KiCad PCB just at a very high level.

03:19.440 --> 03:23.260
So this is the PCB editor as opposed to the schematic editor.

03:23.560 --> 03:30.020
There's normally a schematic editor and you define the basically electrical schematic there.

03:30.020 --> 03:38.140
And then you basically tell KiCad that I want all those components on a physical PCB and it will copy all of them there.

03:39.020 --> 03:52.040
And then you get to spend hours and hours arranging them and routing them and putting silkscreen on and doing solder mask knockouts and all sorts of good stuff.

03:52.420 --> 03:55.280
You can see that there are zones drawn.

03:55.280 --> 03:59.420
Those are those red outlines around each lambda.

03:59.420 --> 04:06.120
Basically what those are for are those are different copper fill kind of designations.

04:06.380 --> 04:12.720
So you can tell KiCad to fill different parts of the PCB differently.

04:12.720 --> 04:24.920
So that's what creates the board's kind of like light versus dark lambda effect as opposed to, you know, something that's printed on it because it's a blue it's a blue PCB.

04:24.920 --> 04:31.720
So because the NixOS logo is just different shades of blue, you can kind of do darker or lighter blue.

04:32.560 --> 04:35.900
So that's, yeah, you can see I'm turning on the silkscreen layer there.

04:35.920 --> 04:40.340
That kind of made the negative space between all the lambdas.

04:41.120 --> 04:46.840
And yeah, by the way, this was made with the new NixOS logo that the marketing team just created.

04:46.880 --> 04:49.220
So the board cuts are all from that.

04:50.180 --> 05:04.900
And yeah, so you can just import, actually, board cuts from an SVG directly into KiCad and then give it a scale factor and it will basically just resize that SVG and that will be your board.

05:05.260 --> 05:11.160
So there's a tool called SVG to Shenzhen that lets you do this for kind of complicated outlines.

05:11.160 --> 05:12.960
I actually didn't even have to use that here.

05:12.960 --> 05:16.560
I mostly use SVG to Shenzhen for that actually.

05:16.720 --> 05:22.860
That is our artwork which was live traced in Inkscape.

05:22.860 --> 05:34.040
And then, yeah, I did use SVG to Shenzhen to basically create a custom footprint with the solder mask knockout for our art.

05:34.720 --> 05:38.880
Anyway, that's kind of this first part of voiceover.

05:38.880 --> 05:43.020
Audio is going to return in a few seconds.

05:43.020 --> 05:44.820
Yeah, enjoy.

05:50.480 --> 05:51.900
It's a little bit counterintuitive.

05:51.900 --> 05:55.620
It's a solder mask knockout layer because it's assumed that there's mask.

05:55.900 --> 05:58.560
The solder mask is basically the blue color.

05:58.560 --> 06:02.880
It's the thing that effectively a coating that goes over the copper so you don't short the copper.

06:03.160 --> 06:08.040
But if you have a solder mask layer, that means that that part of the solder mask is actually removed.

06:08.420 --> 06:11.280
Now, if you remove the solder mask, you expose copper.

06:11.280 --> 06:13.720
So then you have to go and actually add two things.

06:13.720 --> 06:22.620
So if I hide the mask layer, you see there's all that still all this basically, which is actually copper knockout.

06:22.620 --> 06:30.120
So all of these outlines have the copper removed so you can see through to the PCB.

06:31.320 --> 06:36.000
And FR4, it's the type of material that these PCBs are made of.

06:36.000 --> 06:39.820
It's kind of like a fiberglass style material is slightly translucent.

06:39.820 --> 06:46.120
So we cranked up this LED basically to maximum and you can see the kind of RGB effect on the back.

06:46.780 --> 06:49.980
So that's SVG to Shenzhen and KiCad.

06:49.980 --> 07:05.500
What I will note is that there's a nasty Ruby script that we had to write in the repository to convert the SVG to Shenzhen output to an actual copper knockout because it creates a solder mask knockout but not a copper knockout.

07:05.500 --> 07:07.640
And Q and KiCad are different formats.

07:08.100 --> 07:17.800
And there's a lot of manual copy paste of KiCad files that that part is not really that reproducible honestly, just because the tooling is annoying.

07:18.300 --> 07:32.040
So how this all kind of comes together is if I go to the PCB repository, we basically have a Nix package that is actually a couple things.

07:32.040 --> 07:45.980
There's the KiCad text injector, which is if you look on the back of these badges, actually the store path that the badge was rendered to in the Gerber files is actually printed on the back.

07:46.140 --> 07:49.800
So KiCad text injector is a Rust package.

07:49.800 --> 07:54.020
It's actually not upstream to Nix packages, although that's something that I plan to do.

07:54.980 --> 08:01.320
It's just a really simple Rust package that replaces the placeholders in KiCad with environment variables.

08:01.600 --> 08:03.680
So that's how we got the store path on that.

08:04.140 --> 08:09.880
And then there's this other project called JLCFCTSRE.

08:09.880 --> 08:11.860
It's a reverse engineering project.

08:12.180 --> 08:16.920
So the fab that we used is JLCPCB.

08:16.920 --> 08:20.160
So they're a Chinese fab based in Shenzhen.

08:20.160 --> 08:27.100
And one of the things that we looked into doing was using basically using JLC's like colored silkscreen.

08:27.100 --> 08:34.840
And JLC has kind of a strange thing where their colored silkscreen is a proprietary like encrypted format.

08:34.840 --> 08:37.200
But someone's gone and reverse engineered it.

08:37.200 --> 08:44.140
It seemingly like only exists to like vendor lock UN basically because it's just encrypting an SVG basically.

08:44.240 --> 08:48.120
There's interestingly no tooling that really supports this.

08:48.180 --> 08:56.600
So we were looking into like originally making these white using like doing a white PCB and then actually printing the NixOS colors on it.

08:56.600 --> 09:01.840
But seeing there's no tooling from KiCad that actually works with JLCPCB.

09:02.960 --> 09:07.240
We ended up using the copper and stuff.

09:07.240 --> 09:09.340
And honestly, that was it was cheaper.

09:09.340 --> 09:11.100
It turned out better, I think.

09:11.320 --> 09:15.020
Although I'd still like to see a white version with color silkscreen.

09:17.100 --> 09:20.140
So those are just some support packages that we made.

09:20.300 --> 09:22.440
Then our default.nix.

09:25.300 --> 09:28.860
So this is where we actually start locking down KiCad libraries.

09:28.860 --> 09:34.620
So we have the JLCPCB KiCad library from GitHub that we locked the exact version.

09:35.120 --> 09:41.160
So if you want to, you know, reproduce this hardware, then you can you can literally reproduce the build basically.

09:42.000 --> 09:54.220
There's also this fabrication toolkit for KiCad, which is a collection of Python scripts that are kind of annoying to use, that correctly export the Gerbers and get them into a format that JLCPCB can read.

09:55.580 --> 10:02.500
So I've got a derivation that basically takes those two things together and creates KiCad's third party directory, which is all of the plugins.

10:02.720 --> 10:09.900
And it's this kind of nasty JQ script basically that adds a bunch of JSON in the sandbox to KiCad's plugins directory.

10:10.180 --> 10:11.940
But all this is in the packages.

10:13.240 --> 10:18.320
And then yeah, the actual build, we define all the layers that we want to render.

10:18.560 --> 10:31.300
We actually do a couple renderings, including like a 3D render and then a render of the Gerber, so you can open that in the Gerber editor, and then a actual fab copy, which uses fabrication toolkits.

10:31.360 --> 10:40.860
And so we run KiCad Text Injector to basically inject the environment variables which are relevant, which are mostly just the store path.

10:41.160 --> 10:48.580
And then the build phase basically exports the Gerbers, exports the drill, so you can render or load those into a Gerber viewer.

10:49.160 --> 11:07.380
And then the check phase runs the ERC and DRC, so you can get assurance that your electrical rules aren't being violated and your design rules aren't being violated, although that wasn't 100% assurance if you define the electrical rules wrong, such as swapping a 3v3 and ground.

11:07.560 --> 11:17.580
It will just make sure that you're not connecting 3v3 to ground, but if you're going through a component then you're still going to violate, or you're not going to violate ERC, but it's also just not going to work.

11:19.140 --> 11:25.200
So then we also, the post check, once we know that the check phase is good, we render it to another output.

11:25.200 --> 11:28.780
So this is using a feature of Nix called split output derivations.

11:28.860 --> 11:33.400
So you can actually define in Nix derivations this outputs variable.

11:33.720 --> 11:51.080
So we have out, which is the Gerbers, and then check, which is basically the ERC and DRC reports, and then fab and render, fab being the JLC output, and then render being just 3D renders if you want to look at the badge in a photo viewer or something.

11:51.560 --> 11:59.220
So then the renders are all using KiCad's render ray tracer, using the KiCad CLI, and that was pretty easy.

11:59.420 --> 12:05.020
Then the install phase, just moving all the things to their outpats.

12:06.580 --> 12:27.860
So if you go and build this, actually, well, one thing of note is that because we have so many polygons in the copper layer, the design rule check actually takes quite a long time to run.

12:29.980 --> 12:46.080
So because I think if you do this sort of PCB art, you hit pathological cases with KiCad, where it will basically try to compare every single polygon in your copper layer against every single other polygon, and so it effectively becomes like an N-squared,

12:46.080 --> 12:50.200
and you just end up taking a lot of time, but it eventually finishes.

12:50.400 --> 12:54.020
So it'll at least get partially through the build.

12:55.120 --> 13:02.470
And while it's doing that, let's talk firmware.

13:15.820 --> 13:22.760
So basically, I got started on the firmware and got a couple demos working of the various hardware features.

13:23.940 --> 13:28.360
And then Tristan has been working pretty hard on it pretty recently.

13:29.960 --> 13:34.200
So the firmware is in the NixVegas slash badge repo.

13:37.840 --> 13:44.020
And if I do a NixFlake show, effectively, there's

13:49.520 --> 13:53.620
just one output, there's default, and it's the same as the output called NixBadge.

13:54.300 --> 13:59.060
And the result that it produces by, say, NixBuild,

14:03.040 --> 14:06.720
this dot caret star actually produces all the outputs.

14:06.780 --> 14:14.220
You don't have to do that, it'll just build the firmware by default, but if you want to do dot caret star, it will give you a flasher script too.

14:17.220 --> 14:25.860
Alternatively, if you want to develop on it, you can basically just NixDevelop, and it will automatically set the ESP IDF framework up for you.

14:25.860 --> 14:31.480
There's actually a Nix packaged version of ESP's IDF.

14:31.540 --> 14:35.540
I think it's the IoT development framework is what that's called.

14:36.400 --> 14:38.720
Oh boy , keypad's freezing.

14:41.320 --> 14:42.680
Come on .

14:45.270 --> 14:48.190
It's probably doing the design rule check right now.

15:03.140 --> 15:04.760
Oh, there it goes.

15:19.860 --> 15:22.780
I think I'm going to just kill that.

15:43.860 --> 15:45.280
Oh, there we go.

15:46.060 --> 15:47.120
Come on.

15:54.980 --> 15:59.300
This laptop is not a powerful laptop for doing any sort of CAD work.

16:03.640 --> 16:05.360
Now, during my talk?

16:13.810 --> 16:16.270
That is true, they could probably build it pretty quickly.

16:24.720 --> 16:25.960
All right.

16:25.960 --> 16:27.700
Well, my laptop reboots.

16:27.700 --> 16:29.960
Any questions?

16:39.740 --> 16:44.600
So, probably manually routing all the traces was really frustrating.

16:47.020 --> 16:52.660
The auto-router had a lot of hard time with the shape of the badge.

16:52.660 --> 16:59.620
It frequently just could not route anything at all, and I had to just manually draw a bunch of traces.

17:00.020 --> 17:04.380
Changing the layout of a bunch of traces and having to re-route them was also pretty frustrating.

17:13.610 --> 17:16.050
I'm going to unlock my data sets and get in here.

18:12.290 --> 18:14.570
All right, now let's start playing with the firmware.

18:19.410 --> 18:23.370
So, to actually start playing with the firmware, there's a USB port on the badge.

18:23.370 --> 18:24.970
Just plug your USB-C in.

18:26.110 --> 18:27.670
And run Nix Develop.

18:40.120 --> 18:49.960
And part of the Nix Develop, or the build, it will actually patch the ESP IDF, because there's a plugin that we use that requires patches to it.

18:50.020 --> 18:51.600
So, it will just do that for you.

18:52.500 --> 18:56.320
But it takes a second, because it has to copy the entire ESP IDF.

18:57.220 --> 18:58.240
All right, there we go.

18:59.500 --> 19:06.320
But it drops you directly in source, and your friend is going to be... and this is in the readme, so if you check out the readme...

19:09.620 --> 19:16.680
The hardware feature is also, loudly, kind of the known issue about the SD card and how to build it.

19:16.700 --> 19:22.340
But yeah, for develop, your friend is idf.py, which is conveniently in your path.

19:29.750 --> 19:36.820
So, if I copy this, it will build it.

19:40.300 --> 19:43.460
And mostly, it shouldn't have to rebuild too much.

19:48.750 --> 19:50.030
Yeah, there we go.

19:51.210 --> 19:53.170
I kind of just built it.

19:54.870 --> 20:02.130
And ESP IDF has a monitor command that lets you basically break into a serial monitor that's very similar to something like screen.

20:02.790 --> 20:10.200
So, it's going to flash it, and then it will start monitoring.

20:10.920 --> 20:18.820
And so, yeah, by default, the badges come up in a configuration that's kind of the most battery saving configuration, so it just lights up the LEDs, basically.

20:19.120 --> 20:27.580
The ESP32, which is a RISC-V core, actually supports a bunch of things that we're not necessarily using.

20:28.640 --> 20:30.800
And by default, we don't use the Wi-Fi.

20:30.800 --> 20:40.560
But if we turn, if we unplug it, and if you hold the button down at boot, and plug it back in,

20:45.000 --> 20:47.800
run the monitor again,

20:52.430 --> 20:54.170
oh , it switches the port.

20:54.170 --> 20:54.770
Okay.

21:01.280 --> 21:03.620
All right, let's try this again.

21:04.300 --> 21:05.760
That's still ACN0.

21:05.880 --> 21:07.380
I'm just going to go monitor.

21:11.440 --> 21:15.220
And I'm going to hold the button down and hit reset.

21:21.380 --> 21:22.520
Oh, until it's fully up.

21:22.520 --> 21:23.000
Okay.

21:27.950 --> 21:29.150
All right, there we go.

21:29.210 --> 21:31.330
So, this actually started up Wi-Fi.

21:32.750 --> 21:42.810
And what these badges are doing when Wi-Fi is started up, basically, is they use ESP's mesh light library to basically automatically create a mesh topology.

21:42.870 --> 21:48.450
So, it spawns a Wi-Fi network, and it tries to connect to other badges' Wi-Fi networks.

21:49.070 --> 21:52.830
And let me try to connect to it.

22:00.120 --> 22:03.240
Is that an NVS config option?

22:19.830 --> 22:21.490
It is not working.

22:32.480 --> 22:33.560
Oh, what's that?

22:36.460 --> 22:37.460
You hold the button.

22:37.460 --> 22:39.660
So, if you hold boot, that puts it to the boot loader.

22:43.900 --> 22:44.480
Okay.

22:44.480 --> 22:48.220
I think, yeah, the issue, basically, is that the USB also resets it.

22:48.220 --> 22:50.200
So, I just have to hold the button until it comes up.

22:52.040 --> 22:54.520
If I want to just show the console.

23:10.280 --> 23:12.120
I think it's whatever the latest is.

23:13.100 --> 23:18.660
So, we can, yeah, probably we're going to probably not going to be able to do this demo live, at least.

23:19.860 --> 23:20.760
But, yeah.

23:22.840 --> 23:23.460
Oh, really?

23:23.460 --> 23:25.080
Do I have the old version?

23:25.120 --> 23:26.360
That's entirely possible.

23:26.360 --> 23:27.640
Can I try your badge?

23:27.960 --> 23:28.720
No.

23:30.640 --> 23:40.840
Well, we'll come around and, yeah, if you guys are curious about doing binary substitution over this, it basically connects to our Wi-Fi network and talks to our servers.

23:41.720 --> 23:49.220
It's not that fast, and because the SD card is not working, it's, you know, especially slow because the ESP32 has to Wi-Fi schedule a lot.

23:49.480 --> 23:51.060
But the firmware is open source.

23:51.060 --> 23:52.320
Y'all can hack on it.

23:52.360 --> 23:59.240
We're definitely willing to help you all get going with it, especially if it's your first foray into Nix and you want to hack the badge.

23:59.340 --> 24:00.280
I mean, yeah.

24:00.720 --> 24:04.900
You guys, you guys have the tools, so.

24:05.040 --> 24:06.280
Any more questions?

24:18.440 --> 24:29.080
So, yeah, the getting KiCad plugins to work in the Nix sandbox, basically it was reconstructing the entire KiCad, like, plugins directory every build.

24:29.120 --> 24:33.780
Which, I mean, it's useful if you want to get the same output every time because it was very reliable.

24:33.780 --> 24:48.800
I think I had, like, probably, like, 15 different uploads to JLCPCB that were all, like, slightly different because they have... So, JLCPCB has a great, like, Gerber file viewer, and I wanted to make sure that, like, when I uploaded it, it was kind of what I expected.

24:48.800 --> 24:53.800
So, I'd do something and then, like, I'd make a little change and then I'd just upload the same zip.

24:53.800 --> 24:56.160
But getting it there, it was just a lot of scripting.

24:56.200 --> 24:59.640
But that actually gave me a pretty good iteration process with JLC.

24:59.640 --> 25:07.300
Because, I mean, I knew it was going to produce the correct thing every time and that it was going to change in just the way I intended.

25:07.300 --> 25:10.960
So, it actually gave me pretty fine-grained control of that process.

25:11.140 --> 25:15.720
JLC still had trouble with the orientation of some of the components.

25:16.000 --> 25:22.280
So, I think that's kind of a classic one, like, the diode was, like, flipped around or something despite the footprint being correct.

25:22.280 --> 25:26.860
And there's always a couple things with JLC that you have to mess with manually.

25:27.040 --> 25:30.420
But, I mean, at least Nix made some of the stuff work pretty well.

25:31.480 --> 25:32.840
Any more questions?

25:34.740 --> 25:37.960
And to the question of will you guys get a badge, we've got a bunch.

25:37.960 --> 25:38.960
So, probably.

25:43.600 --> 25:45.360
That's more of a Tristan question.

25:45.860 --> 25:47.680
What parts did we use Zik for?

25:53.800 --> 25:54.980
So, GPIO.

25:54.980 --> 25:55.660
Yeah, that's right.

25:55.660 --> 26:01.820
So, we used it to do some GPIO initialization and also we're still using the ASN1 stuff.

26:02.240 --> 26:11.160
So, yeah, the mesh communication... Zik has a great ASN1 library and it's a memory-safe ASN1 parser, which is super cool.

26:11.160 --> 26:15.720
So, we were playing with it on the mesh communication side of things.

26:15.780 --> 26:22.420
Of course, ESP-IDF still has a bunch of that framework that's written in C.

26:22.420 --> 26:29.040
I'm aware that there's a safe Rust version that's, like, a community-supported version of the ESP.

26:29.040 --> 26:34.300
It's, like, a kind of a Rust version of the ESP-IDF that's more, like, community-driven, basically.

26:34.300 --> 26:36.480
Although it doesn't support all the things, like, Wi-Fi.

26:36.480 --> 26:49.600
It still has to probably use unsafe to connect to some of that stuff, especially considering that the Wi-Fi chipset on the ESP32 is, like, locked down and has vendor blobs everywhere, basically, and Expressive ships you, basically, .a files to link into your project.

26:50.500 --> 26:56.640
But, yeah, I mean, it was pretty easy to link ZIG with it.

26:56.640 --> 27:04.160
It was, like, just some CMake file modifications, pretty much, and integration with ESP's, like, existing build system.

27:04.160 --> 27:05.960
So, actually, that wasn't that bad.

27:06.380 --> 27:17.980
I think the main issues that we had with it were, like, calling convention issues, like, where we would accidentally use the wrong calling convention for something, and then we'd just corrupt some memory, and it would cause problems, like, down the line.

27:17.980 --> 27:28.100
But once we were, like, once we had, like, the translation layer between C and ZIG, like, working, it was pretty easy to write ZIG that would, you know, just work.

27:28.100 --> 27:31.840
Unless we, well, unless we exhausted the stack, then things would get corrupted as well.

27:32.220 --> 27:34.740
So, obviously, not perfect.

27:35.500 --> 27:36.780
Yeah, any other questions?

27:43.300 --> 27:44.560
Any what issues?

27:47.320 --> 27:49.240
Feature size, like, what?

27:59.530 --> 28:00.750
Oh, I see.

28:00.750 --> 28:01.210
Okay.

28:01.210 --> 28:04.750
So, I copied the design rule.

28:05.390 --> 28:17.210
Basically, all the design rules, they're pretty well documented for JLCPCB, and someone actually implemented a KiCad rule set that basically automatically does the design rule checks for you.

28:17.290 --> 28:21.370
Those were, like, a little bit hard to dig up, but once I found them, it was all fine.

28:21.410 --> 28:26.450
And JLCPCB is also pretty good at running, like, design rule checks for you after the fact, too.

28:26.450 --> 28:34.190
So, like, you have a couple layers of, I guess, like, safety with the design rules on JLCPCB.

28:34.190 --> 28:39.650
So, I didn't really have any feature size issues because KiCad caught them first.

28:39.650 --> 28:44.970
It was mostly just, like, mistakes that I made, like, the 3.3 volt and ground swap on the SD card.

28:44.970 --> 28:53.090
What we really wanted to do with that is we really wanted to actually cache packages to the SD card, but, I mean, that'll just be in a future hardware revision of the badge, so.

28:54.090 --> 29:01.890
Or if people are enterprising enough to, you know, exacto things and bodge wire it, that also works, too.

29:01.890 --> 29:03.710
The hardware hacking village is down the corner.

29:03.970 --> 29:09.630
I was, like, 95% sure I'd have to say that because I'd make some mistake that would warrant it, and here we are, so.

29:10.410 --> 29:11.090
But, yeah.

29:11.850 --> 29:12.910
Any other questions?

29:20.750 --> 29:21.890
Oh, yeah.

29:22.530 --> 29:41.170
So, also, when you're getting PCBs fabbed with JLCPCB, and they have a lot of polygons in the copper layer, or solder, probably most of the copper layer, JLCPCB will kind of choke when you upload them and act like it's not going to render any of the, you know,

29:41.170 --> 29:42.750
any of the art that you added.

29:42.830 --> 29:48.110
But in, like, a half hour, the preview will magically appear and they'll be able to fab the boards.

29:48.110 --> 29:50.150
So, none of this was documented.

29:50.170 --> 29:55.130
It was just all stuff that we figured out just through trial and error.

29:56.430 --> 30:03.190
And, obviously, I mean, you know, you can reproduce this build, but sometimes you can't reproduce JLCPCB errors, so.

30:04.170 --> 30:05.510
All right, anything else?

30:06.670 --> 30:07.690
All right.

30:08.770 --> 30:10.430
Well, that's all I got.

30:11.230 --> 30:13.530
It's, that's our last talk for the day.

30:13.530 --> 30:15.390
We're going to go into the unconference.

30:15.390 --> 30:19.950
So, the unconference is an idea that we borrowed from Scale, actually.

30:19.950 --> 30:28.130
It is just the mess around with hardware in front of you, talk to people, chill out, maybe do some lightning talks, too.

30:28.410 --> 30:34.030
So, if you want to do lightning talks, come to me or Tristan and let us know.

30:34.430 --> 30:37.550
And, Firefox is messed up.

30:38.270 --> 30:40.770
And, yeah, we can get you slotted in.

30:41.350 --> 30:45.450
Lightning talks are, like, five to ten minutes, basically, if you want to go over.

30:46.190 --> 30:48.790
I mean, I'm not going to complain, so.

30:49.250 --> 30:50.490
But, yeah, thank you, guys.

30:58.400 --> 31:02.340
So, the badge actually generically acts as a router.

31:02.620 --> 31:04.760
So, I'm actually connected to it right now.

31:04.760 --> 31:08.040
We pushed some firmware that fixes some stuff.

31:08.120 --> 31:11.940
Also includes the default credentials for the Nix Vegas Wi-Fi network.

31:12.340 --> 31:14.380
So, I was able to actually get push over the badge.

31:14.380 --> 31:16.140
But, let's substitute over the badge.

31:16.140 --> 31:16.880
How does that work?

31:16.880 --> 31:18.980
Well, it's in the readme.

31:20.780 --> 31:37.820
So, if you connect to the badge, so, these badges, if you hold the reset button at the boot, or rather, not the reset button, the button at boot, and hit the reset button, they come up as this Nix badge and then, effectively, the last few digits of the MAC address.

31:38.100 --> 31:41.000
And so, you connect to that, gives you an IP address over DHCP.

31:42.500 --> 31:46.060
So, you can generically, like, ping over this.

31:46.260 --> 31:47.460
It's kind of slow.

31:47.780 --> 31:53.740
But if you want to use it as a substitutor, let's pick... I already have hello.

31:53.840 --> 31:54.820
Give me a package .

31:54.820 --> 31:56.480
Something that's small, ideally.

31:57.320 --> 31:57.880
Links?

31:57.880 --> 31:59.200
All right, let's go links.

32:01.600 --> 32:04.720
So , you pick port 1008 on the badge.

32:04.980 --> 32:14.620
It's a TCP port that we're kind of trying to think of as, this is, like, kind of a link local Nix cache port, basically.

32:14.680 --> 32:19.940
It's actually a free port in the IANA registry, which is interesting, because it's less than 1024.

32:19.940 --> 32:23.420
It was previously only used by Solaris, actually, for UDP.

32:23.420 --> 32:25.140
So, there's nothing registered to this port.

32:25.140 --> 32:27.820
So, it could be one that Nix uses if you registered it.

32:28.060 --> 32:31.500
But it will then go and download.

32:32.080 --> 32:33.500
And if you have the...

32:33.500 --> 32:44.500
If you have the ESP console open, you'll see that it's basically chunking the response from cache.nixos.lv, because it's connected to our network.

32:44.500 --> 32:46.640
So, it's actually substituting over this network.

32:47.320 --> 32:49.380
And it will take a while.

32:51.200 --> 32:52.780
It's not fast.

32:53.060 --> 33:00.460
The ESP IDF HTTP server is... I don't think we're using it right, first of all.

33:00.460 --> 33:04.080
And second of all... Oh, there... Well, actually, that didn't work earlier.

33:04.080 --> 33:04.240
All right.

33:04.240 --> 33:05.860
Let's try Cowsay.

33:09.880 --> 33:12.260
Let's see what Cowsay's dependencies are.

33:26.510 --> 33:28.090
Is the badge even still up?

33:28.330 --> 33:29.390
Yeah, it's still up.

33:32.390 --> 33:33.590
Oh, there we go.

33:36.920 --> 33:37.680
Oh, there we go.

33:37.680 --> 33:38.600
We got Cowsay.

33:48.270 --> 33:50.190
And we got Cowsay over the badge.

33:50.310 --> 33:53.710
Now, there's not an SD card, so it doesn't actually cache anything.

33:54.570 --> 33:56.650
But you can do that if you want.

33:56.650 --> 33:57.630
It's a nice party trick.

33:58.670 --> 33:59.770
And yeah, that's it.

33:59.770 --> 34:01.670
That's all documented in the README, by the way.

34:02.270 --> 34:04.190
So, this comes up as...

34:05.130 --> 34:05.950
Yeah, here we go.

34:05.950 --> 34:07.170
So, you just hold the button, we'll boot it.

34:07.170 --> 34:09.850
And yeah, you connect to the Wi-Fi network, basically.

34:10.250 --> 34:13.250
And just set the last octet to one.

34:14.110 --> 34:15.550
It can be a router, too.

34:15.550 --> 34:18.090
The password, by the way, it's all 1234578.

34:18.090 --> 34:23.570
Apparently, in the default ESP mesh configuration, you can't, like, change this for some reason.

34:23.830 --> 34:26.790
But it's there in case you want to mess with it.

34:27.390 --> 34:28.090
And that's it.

34:28.090 --> 34:29.190
Which button?

34:29.430 --> 34:34.450
So, the button is the one that's actually labeled button in the top right of the badge.

34:34.470 --> 34:36.990
So, it is the button.

34:38.350 --> 34:40.750
But yeah, have fun.

