 But yeah, so the Raspberry Pi is zero as some of you may know, it's just like a really low cost It's supposed to be $5 but once you end the cost of an SD card, which is required, it's going to be around like $10-$15 I think this project primarily because my car captures video feed and I really wanted it to like save to a device that is smarter than like say a USB thumb drive One problem is that no matter how big of a thumb drive you put it in, it's going to be filled up, you have to empty it yourself So some of you may have heard of an SD card where it has Wi-Fi But I think they stopped producing it for a long time, so it used to be called iFi You know when you put it into your DSLR, you have your mobile hotspot, you keep shooting photos and you just get your rolls to go in your dropbox But they stopped selling those kinds of stuff anymore The second problem is that you can't really program it, it's kind of like a fixed $50 SD card that's limited to purpose So I went about trying to make something better And guys, this is my fifth headwear talk I'm really glad to be here, it's good to see that SOC has improved In other ways, I hope the Wi-Fi improved The facilities improved, back in my days, there was no like this kind of place where you can build stuff I actually have to bring my own tools in the research lab or bag photos, some tools from engineering department So straight to the problem, I have a dashcam in the car, it records videos based on events For example like heart acceleration, deceleration, you would plug a USB thumb drive into it, but it would just get filled up On day one, it works fine, but after like 10 days, the thumb drive is full, you have to plug it out, empty it out, or manually delete stuff from it It's kind of a new feature, it doesn't work very well, but we try to improve on problems So what I thought was that, okay, I could make a fake thumb drive You've probably seen schematics out there which suggests that you can use an Arduino, attach it to an SD card, and you can somehow make a fake thumb drive out of an Arduino But over here, we are looking at primarily a Raspberry Pi Zero Because a Raspberry Pi Zero compared to the other Raspberry Pi is that it is the only model which has OTG Does anyone know why it's a USB OTG? Yeah, so USB OTG is basically host mode, no, client mode, where a port, like attached to a microcontroller, can emulate a slave device For example, you could pretend that your Raspberry Pi is a keyboard And you plug in a computer, and it pretends a keyboard sends commands It can pretend to be a thumb drive, and it can expose itself as a thumb drive to a computer So what I plan to do over here is to have a Raspberry Pi Zero to pretend to be a thumb drive And as videos are loaded into it, I could simply delete the oldest ones The simple thing here is just a round robin system where you are nearly 90% delete the oldest files by timestamp That's supposed to be the simple solution, but the problem is that the internet is so smart The whole world has many smart people, and someone beat me to it, and I found it on Reddit Someone basically built a smart USB drive for the dash cam And he basically put up a whole bunch of source code So yeah, whatever, I'm not going to do it myself, I'm just going to go and get his Git repo and flash my stuff with it So the improvement of what he did over here is that instead of just simply deleting old videos He basically suggested to use the Wi-Fi so that when you are home, you would connect to your home Wi-Fi And upload the videos to let's say your own server, your dropbox, whatever It need not be your home Wi-Fi, it could just be ethering But over here, you're talking about home Wi-Fi because usually you park your car at home And it's within the range of Wi-Fi, and it would upload from there And yeah, I guess this works as well No one actually made this mainstream, everyone who wants this has to build their device themselves So in general, when you break down the flow chart of what's going on, it's really simple If you guys look at the repository, it's really a bunch of batch scripts It's just .sh files all over the place But it works, it's fine If anyone recalls the iFi, I can't remember Bunny Wang made, how would I say, he reverse-engineered some of those SD card firmware And they are basically running batch script in the SD card or smart SD card firmware So I think that's fine So over here, the bunch of script what it does is that it would try to connect to your Wi-Fi access point If it cannot find, it just loops If it finds Wi-Fi access point, it connects to it It checks, can it connect to your choice of archive server Can it connect to your Dropbox, or CIFS share, Samba share If it cannot connect to it, it goes back looking for a Wi-Fi If it can connect to it, then what it does is that First, it unmounts your virtual, how would I say, your virtual download You have to disconnect it first It mounts it as a read locally to the operating system It moves the video files to your choice of archive And then it unmounts it and mounts it back as a virtual download This is kind of a bit weird because when you mount this volume as a fake download It is kind of like dedicated to the OTG It cannot be read and write from other processes in the system It's just a limitation And once it is mounted back as a download, it will just like It will check whether you have disconnected It is no longer within range of your Wi-Fi Because when you leave your Wi-Fi range, it's kind of like Oh, you're driven off And so this just runs in a loop Okay So basically I just get Raspberry Pi 0W So there's one time I was complaining on Facebook It was like, yeah, I tried to do this But I realized my old Raspberry Pi has no Wi-Fi on it So it's kind of pointless This is the problem when you buy first version devices You buy first version devices that are very useful Everyone thinks of trying to buy Raspberry Pi 4 Maybe wait for the, I don't know, 4 plus I don't know Yeah I just got a case for it So this is like a table where you would plug one end into the data port of your Raspberry Pi 0 The end goes into your dash cam system You put in SD card Yeah, there's a heatsink on it, it's usually preferable The Raspberry Pi 0 only has a single core So you can't really do too much with it But also on the other hand, it also uses a lot less power I think some friends have tried to run it off like 200mA Also a power source So any week, even if your power source is weak You could possibly run the Pi 0 I think the Pi 4 draws like 20W Or 10W About 10W They were stating some higher requirements on it Plug it into the car, it detects So that's great When you drive around and when I drive home After a while, it starts appearing on my file server So yeah, I'm glad it worked out of the box I think some of the learning points after you go through the code Is for people who are not familiar By using Linux in an embedded use case Where very often you kill the power And maybe it falls on your SD card Like many of you use Raspberry Pi for systems And you'll often find that you have data corruption You have to run FSCK so often So it basically shows some examples of how to mount your boot partition As read only To avoid corruption, you also disable swap I mean, who needs swap, right? You have 500 child nights of RAM And basically There are some, I think you use a K-Mod Where it mounts your USB OTG as a mass storage device By default, if anyone has tried the Pi Zero When you plug it into your desktop or laptop They actually mount as an Ethernet An Ethernet port, yeah I think in future work Potentially it still has like spare capacity You could run a Spotify, Spotify music player I think there's some script online that helps you synchronize music files With Spotify Pi Zero W has a camera connector port So you could potentially connect a camera to it And run some image processing For example, if a driver is falling asleep Yeah, you could beep I tend to fall asleep sometimes The repo is over here Just a quick demo, I can show the Pi Zero Working as a drive Yeah, so if anyone has not seen the Pi Zero It's really small It still has a full 40 pins of GPIO over here SPI, I2C and all the other stuff Let's see if we can use USB port Yeah, we can Oh yeah, just plug it in now Yeah, so potentially some of you may think Yes, this is like a rather smart device So it could have information, expel purposes You could just plug it in It could enumerate a keyboard and mouse You can run commands, you can enumerate Even that, right? You could just do local host transfer of data So yeah, it could potentially do a lot of things So in plug-in to USB port Then hopefully Windows This is Windows 1 Okay, it should work It takes a while because first the Pi has to boot up It has to boot up, it has to get into linux It has to run all your scripts And then finally, it pretends to be a download Just one more question Yeah If this is connecting to your car Is it in your car? So you mean that your Wi-Fi Your Wi-Fi at home can actually reach all the way to the parking Yeah, you have to be within range Wait a while, you usually boot some in another board And when the script kicks in to mount it as a file share No, mount it as a virtual drive So one of the downsides is that this is kind of slow Yeah, you have to wait for the Pi to boot up And that's the downside Well, if it ever goes to sleep Then it won't have to reboot Yeah, sometimes if the whole system goes to sleep Then the Pi will shut down as well In the launcher, it's a virtual drive Oh, it detects you Oh, it's pretty decent by part of the mouse We really need to open that one at this point Oh, yeah, yeah, yeah These are people They also make a point of playing Usually I was blinking to the right I have to type that in Oh my, you've done it You think I can see it? Yeah, you've done it You think you've seen his prank? He goes around the subtly And you fall open from something You burn to them This is funny Like sitting in the background Wow, no children No, I'm your boy Please calm until you know last time I ran people That was hilarious The famous name of Zina Perbils Zina Perbils Zina Perbils But I stopped reading What's that? She was the first one Perbils Perbils He made a name for you He made a name for you Okay, I don't want to Are you going to burn others? Oh yeah They will take yours and burn others Yeah And they select The product you want The product you want The product you want The product you want The product you want The product you want Athletic Okay Actually the brand Is that Yes I think I saw a post Yeah But together I know but I'm proud to see every single I am not sure the sun tribes like up there are usually So Yeah, I don't know, it's not, I don't think it's that thing over here, but... I think it's okay, but you guys can kind of get the idea of that. It's not where we are. Wait a minute. In the VM or outside of the UI? It's just the experience. You have so much more to use. This? Or no need to. Oh, okay. Yeah, I only tested this on like Windows 10 also. Yeah. Yeah, I don't think it's detected here, but so far I only used it on like Windows 10 laptop. Okay, yeah. Yeah, anyone has any questions? So I want to suggest that this mass storage thing, you can change PID and PID to match any brand of site. Can it be done? Potentially. Potentially. I'm not dark too much into, because this is one of the modules in G mass storage. Yeah. Or you use this as stock. Yeah, it's just a default driver in the Raspberry Pi ecosystem. Yeah. Because we have interest in emulating a certain brand and model. So you want this to respond faster, usually if you put a battery inside so the Pi is fully powered up, and you plug it in, you'll probably enumerate much quicker when you're going through the whole Boda process. Yeah. No tension. Okay, thanks a lot. Thank you.