 Hello, everybody. Thank you for joining. I'm super excited to be here. My name is Lonon of it This is not my first time on false them, but I'm in love in false them. So every time I'm on stage it falls them I'm super super excited First of all, thank you very much to Philip who has been running the embedded dev room for 15 years in a row There was a gap last year and now thanks to this wonderful team Thanks to which we have the embedded dev room again. They're a great team and they deserve it So my name is Lonon of it. I'm working for a Consolidancy company called consulco group the company specialized in embedded development in various open source software and today I'll be showing you some of the technologies that I Use in my everyday work like the yokto project and open embedded to build a maker's project and this project is home bridge This is the agenda for today. I have the ambitious goal to Go through 30 slides in approximately 20 to 23 minutes. I have a few minutes for questions We'll see if it work out or maybe not First we're gonna talk about home bridge Home bridge is an open source software that enables various third-party devices to Apple home kit How many of you are using iPhone Apple iPhone? I'm not using an iPhone. That's why I'm not raising my hand. All right Just a few of you don't worry guys The focus is actually on the open source side of things and building a custom new Linux distribution that incorporates home bridge Using the yokto project and open embedded We'll explore certain features of the distribution that I built a Lot of ideas for improvements because this is a hobby project that I have been doing in the past few months And there is a room for a lot of improvements and finally there will be some conclusions so Why why I'm doing this obviously the first answer to anyone on stage at Fosnum is that we're doing these things because Because we can and because it's cool and it's open source However, the story in this case has another aspect I have a very good friend from high school who is an electrical engineer and as part of his job He did a very complex setup with very expensive proprietary tool for a customer of his And the customer asked him hey, can I do this and that from From my iPhone and the answer was that actually this expensive proprietary tool at that moment according to my friend was not able to do it So he called me for help to do something with free and open-source software Which is obviously better in this case and the answer was home bridge That's how we started He bought a Raspberry Pi of course. This is one of my favorite single-bore computers and And He asked me at his office at night to set it up We spent a couple of hours to install Raspbian to enable and everything on Raspbian Raspbian is I'm sure you know This is the default Linux distribution recommended by the Raspberry Pi foundation after that we've installed no GS home bridge or plug-in. So all dependencies so Honestly, this is a little bit annoying in time-consuming process it's pretty much going through a list of steps that you install things and you are spending some time just Waiting for the downloads and the installation to complete and For me, it's a little bit annoying, but for non user non Linux users. It could be even a little bit tricky so After doing this I proposed. Hey, let's do Distribution that kind of works out of the box or at least try to make it work out of the box I wanted to to have something similar for other Complimentary open-source project that I for home automation that I wanted to run at home. I Have numerous years of professional experience at consulco group working with the yachter project and open embedded So this was my choice to build distribution so In this case, I wanted to test the yachter project and open embedded in the aspect of a maker A few few words about home bridge. It's a lightweight server that emulates Apple iOS Homekit API it's written in Node.js and it supports numerous plugins with this plugins You can attach various third-party Devices Internet of Things or your do-it-yourself devices that are not officially supported by Apple Nowadays the Apple ecosystem is becoming more open. However, home bridge has been a while for a For several years. It can be installed by macOS Windows and of course glue Linux distributions in our case. We're gonna build a custom glue Linux distribution It's entirely open source. It's available at github and Our Apache license and this is the web page of home bridge where you can get started Over these years home bridge has Has established a huge community it was started by Nick Farina who is based in the US. I have never Personally met this developer, but he seems extremely skillful and very helpful. He's in Twitter So we can find him follow him and say thanks for this great project that he has done there are thousands of plugins developed by various contributors and and There are a lot of contributors to the core home bridge Node.js implementation and This is based on the work of a lot of people through the years This is a short list of some of the home bridge plugins, which I think are useful to to have of course each plugin depends on the type of device that you have and The way you want to set it up this is very user-friendly plug-in because this is a web interface which allows you to modify home bridge from your web browser and This is just the list of List of other plugins. I'm listing in QtD here because in our Linux distribution that we're gonna build I've included an in QtD broker So Let's build an embedded Linux distribution how to do it. How many of you have built a Linux distribution from scratch? All right, that's fantastic Pretty much the whole room There's a lot of different ways how to approach this One of the ways is the yokto project and open embedded which I'll be using For the rest of the slides here, of course other popular projects are build route PDX that's which is having a talk later on today open WRT, which is more for Wi-Fi routers, but can be used for other projects as well and the most popular in my opinion maker approach is to grab a Debian derivative and to you know change the root FS. This is a fast way to do it. However, it has some disadvantages and Chris who's over there had an excellent talk that I would like to recommend you It was for at the embedded Linux conference in Leon He was comparing what are the advantages and the disadvantages when you proceed with the yokto project or use a Debian distribution so What to include in our distribution? When you start building an embedded Linux distribution you need a board support package in general the board support package As the name suggests is provided by the vendor the people that are Manufacturing the boards. However, in reality, it's not always like this But often there are community supported board support packages that are pretty good The board support package includes a bootloader for example you boot a Linux kernel device tree drivers After Having the BSP ready. We need an init system system the was my choice I personally like it. I know that a lot of people don't like it, but yeah, that's my choice We we needed something to for connectivity and Interfacing the board one of the problems that I've experienced setting up a russ bien with my friend for a very first time is that Russ bien is not intended for the things out of the box We wanted to do so we had to go to raspy config and manually enable SSH VNC serial communication and so on and In in my distribution, I wanted everything All those interfaces to be enabled by default out of the box. We need no GS and NPM Because homebridge is written in Node.js. I Wanted to add a mosquito broker. This is for my personal use But I'm sure that a lot of you are over already familiar with the machine to machine protocol and QTD It's a really cool thing to have in anything related to home automation We needed an x11 window links. We needed a windowing system and I decided to use x11 Although I'm a huge fan of way one, but for this project. I said, okay x11 is okay I put the open box as a compositor and a few Basic applications. So even if there is a user without experiencing Linux if he starts the The distribution he has the basic things already installed there um One of the things that is interesting is the surf Web browser very minimalistic web browser that is controlled only by keyboard shortcuts and as soon as the distribution turns on Surf presents the web UI provided by the plug-in for homebridge and I wanted to add low-cost All at display for some basic information because the idea of this thing is that you're gonna use in most Of the cases the strip distribution without a proper HDMI monitor So let's get started now with the yachter project and open embedded How many of you have been using the yachter project and open embedded are and are familiar with this? All right, that's good. So now comes the really hard part yachter is great thing But it's very hard to explain the terminology without messing the words. So forgive me if I make a mistake So the yachter project is an open-source collaborative project of the linux foundation It is it is designed to build custom GNU linux distribution used in variety of industries The yachter project has chosen the open embedded build system Which includes bid-bake and open embedded core? Pocky is the reference distribution Of the yachter project it provides metadata So you don't actually start from scratch But you already have a list of recipes and layers on which you can you know have a quick start and after that You can continue customizing pocky The yachter project has releases twice per year the these are the recent releases The yachter project and open embedded have a lot of Contributors working on those project there is so there are wiki pages with a lot of information also mailing lists So for the releases the current stable release is Zeus which was released in October and In April we are expecting the nice the next release As of today It's recommended to use the latest table. That's why I've based what I do on a version 30 Zeus And if you follow the steps that you're going to see on the next slide You'll get an image based on this yachter project release in long term. I plan to keep updating the Diversions of the project and to keep up to date with the latest releases of the yachter project so In general the yachter project way of doing things is that you have various meta layers and Often when you are starting as a developer to make something you need to put a list of And to to download the list of layers after that to set up some configurations To avoid doing this over and over again. I have used the Google repo tool, which is a software tool for managing a collection of git repositories and With this command you can Get the manifest of the Of the rep or that I have created after that to run rep or sync and Using a template you can initialize the build environment The build environment setup includes BB layers file Which is a description a list of all meta layers Used for building the project and local.com is another file where you set the machine Because the yachter project and open embedded allow you with the same meta metadata and Various board support packages to have the same image built for various hardware in this case For the moment this distribution is supporting only raspberry pi by default We are building a 64-bit version of for raspberry pi 4. However, since we have the meta raspberry pi Layer included you can manually switch the machine ID To raspberry pi 3 or previous model After that you have to type in bit bake. It will take a while. So please be passionate Have some Spend some time drinking a cup of coffee or tea and in a few hours you have the image Alternatively if you don't have a Linux machine don't want to build the source from scratch Or and if you want to act like a regular user. Yes, there is a binary release in github. You can just go there download the image Flash it on a micro SD card and use it to flash it on a micro SD card The recommended way for people that are feeling more comfortable with graphical user interfaces is Balena etcher Balena etcher is free and open source software. You select the the image to drive and just flash it that that's all Alternatively for those of you who are more Who are feeling more comfortable in a Linux terminal? You can do it with DD from the Linux terminal as well So let's have a look a quick look at what's Inside the the image. This is home bridge config UI X Open in a surf web browser. I have taken these screenshots This is what you want to what you get as a user interface when you start these are QR codes Do you secure due to security reasons? I've just wiped out parts of the code? So hopefully I'm secure now but this is what it what it gonna get when you turn on the Distribution for very first time it's a web browser that shows you this this if you have an HDMI monitor attached This is what you're gonna see or if you connect via VNC you will see again this thing There are various connectivity and interfacing options enabled by default as a sage For the moment there is no password. You just log in as route and it's up to you to change the password to Something secure. There's also VNC running so you can you see you can Use VNC viewer to remotely connect to to the device and of course serial console So if you have a USB to your debug cable, you can get some output One of the things that it's really cool about home automation projects is the ability to put them in a nice case and box and this is some This is some dinner rail case. There are several dinner rail cases available for Raspberry Pi I bought both of those. I ended up using more this joy it cases. They're available as well as for Raspberry Pi 3 and 4 I designed a Raspberry Pi Hardware attached on top. This is an out on board that you plug on top of the Raspberry Pi Several years ago. I had a talk explaining how to design these these boards. It's a very straightforward process Actually, it's quite easy I'm doing it with a free and open-source software keycuts and this is open-source hardware because it's available at github Super simple board with three buttons and a few slots for attaching chi-squared C devices one of which is the display and Here is the mini display. Those are low-cost super cheap mini OLED displays that I've attached on top of the Raspberry Pi Put it in the case So if you mount this case on a dinner rail, you have some basic information like what is the IP address of this of this box and Statuses of the system the services that are more interesting home bridge and impunity. This is the impunity broker mosquito So how does it work? When you turn on the image for very first time system This service is stars a home bridge and its plug-ins open box, which is Compositor on top of X 11 stars serve This is the web browser and serve automatically what holds the web interface of the plug-in provided for home bridge Also, there is a python script which is showing information on the mini OLED display, which is attached over i-squared C These are the layers that we are using in this distribution as I told you it's based on pocky Meta Raspberry Pi is the board support package layer. Those are standard layers That you can find in every In meta open embedded like meta open embedded meta python Metagnome and meta networking when we're using recipes from all those layers That's why they're included and this is meta home bridge layer that I have created and I put there some new New recipes. This is the surf web browser. How many of you are familiar with surf? All right, it's pretty cool. Give it a try. It's just keyboard shortcuts Web browser that opens in full screen and you only have full Keyboard shortcuts pretty pretty cool and pretty convenient. So this is what you get when when it starts If you press out plus f4 it will just close and you have Open box So open box is highly configurable and very simple windowing manager for X 11 There are a few just a few configuration files and with those configuration files You can make a lot of customizations So on the next slide you see how I have customized it and what you get if you turn off surf This is this is the screen that you get in the in the distribution that I've explained you how to build As you can see, it's just a black dark screen with a few icons I believe these are the minimal viable Applications needed for even non-linux experienced user to configure home bridge and to feel comfortable with this distribution I've promised you to show you how to build home bridge with the yokto project and open embedded. This is a recipe It's a standard recipe. That's inheriting MPM So in yokto there there's There there there are a lot of classes that you can reuse this is just a cold-slipped note the whole recipe So we are inheriting MPM here This is the name of the recipe which is in green. This is the version of the recipe and After that bitbakes takes care of the rest to build it This is home bridge at MPM GS So if you if you want to install it manually, this is how to proceed for those of you who are familiar with no GS and I'm using the same URL to build it This is the home bridge system this service which takes care of Starting home bridge when the application starts. I'm not going to too much details The slides are available at slide share as well as on the Fossilum page. I'll make sure to update them right after the after this presentation so What's next? Obviously what I did for over a couple of weekends. It's not enough and there's plenty of things to be done One of the things that I would like to have is continuous integration and Support future releases of the yokto project to build a few images binary images So eventually people can start using what I have been done. I have done For the moment. There are just a few of us using it. Of course, it's a very new product I want to support more hardware platforms, especially SDM 32 MP 1 which I think is very interesting new system on a chip and Would fit well for more, you know industrial Environment where there is this and so on Raspberry Pi is not the perfect hardware for this For this environment software updates over the year either with Mender or OS 3 both have advantages and disadvantages Both are great. Actually, and this is something that is so might to do list to integrate both of those Open source software solutions support yokto project and open embedded integration of more home bridge plugins out of the box once you start this image you can Install manually various home bridge plugins. However, I would like to integrate more more of them so Hopefully you've enjoyed this talk, but even if you haven't enjoyed it. There are some benefits for the ecosystem because During the way during my work. I was able to upstream some contributions to meta open embedded which are for surf recipe as the long tray and Update mosquito and open box And at the end of this talk, I would like to share some conclusions so first of all It's something that I knew and I'm sure you also knew before the start of this talk home bridge It's a great open source platform if you are iOS Apple iOS User and want to integrate various devices With the Apple ecosystem and it's an open source solution for various third-party devices the yokto project and open embedded are a Great way to build custom embedded Linux Distributions is de facto an industry standard used in automotive in medical industries in in networking in various internet of things However, the last conclusion is about makers the yokto project and open embedded still have a steep learning curve you have to learn a lot of things to get started and When you build an image from scratch it's take a significant amount of time even if you have a powerful hardware So still for maker projects It will take some time for you to get started with the yokto project and open embedded Especially if you don't have previous knowledge, but the yokto project has wonderful documentation and I encourage you to give it a try Thank you very much And we have like one or two minutes for questions Any questions? Yeah, why should someone choose yokto over something like build route Excellent question. So I also have some upstream contributions to build route and I like build route. However, I personally use The yokto project as on a daily basis at my work at Kansuku group. So I'm feeling more comfortable with the yokto. I think Just a personal opinion. It's a very sensitive topic. I think it's more customizable and More powerful in certain ways. However, build route is a great choice as well Thank you for your talk and You said that you first did did it on Raspbian then did your Distribution using yokto and you have an estimation of how long it took you to do it on Raspbian versus How long it took to do it on yokto? All right, thank you. That's an excellent question. So The initial setup with Raspbian was a matter of like couple of hours, which included a quick crash course to my friend Who was known Linux user for my distribution? It takes a significant amount of time to build this distribution from scratch But once you have it to get started is a matter of like 15 minutes to download the image flash it and get started So from user perspective, this is a very fast way to approach because it's a distribution made for this time is up So thank you very much for joining. I hope you've enjoyed it