{"version":"https://jsonfeed.org/version/1","title":"UserCTL.xyz","home_page_url":"https://blog.userctl.xyz/","feed_url":"https://blog.userctl.xyz/feed.json","description":"Recent content on UserCTL.xyz","icon":"https://blog.userctl.xyz/images/logo.svg","favicon":"https://blog.userctl.xyz/images/favicon.png","items":[{"id":"https://blog.userctl.xyz/posts/2022/06/adding-power-button-status-leds-raspberry-pi/","url":"https://blog.userctl.xyz/posts/2022/06/adding-power-button-status-leds-raspberry-pi/","title":"Adding a power button and status LEDs to you Raspberry Pi","date_published":"2022-06-24T12:00:00Z","date_modified":"2022-10-03T00:48:07+02:00","summary":"How I added a power button, a power status LED and an activity LED to the MP-1 Rack Raspberry Pi module without running any software on it.","content_html":"\u003cp\u003eFollowing the release of my \u003ca href=\"/posts/2022/06/building-mp1-rack-collection-modular-racking-system/\"\u003eMP-1 Rack collection\u003c/a\u003e, I wanted to share some more details about how I added a power button, a power status LED, and an activity LED to my Raspberry Pi module.\u003c/p\u003e\n\u003cp\u003eFinding the right configuration was not as easy as it seems, and as I wasn\u0026rsquo;t able to find a single source where both a power button and some status LED were added together, I ended up testing quite a lot of different setup. The ultimate goal being to be able to handle as much as possible without using important buses, having to solder extra pins or requiring any software on the Pi itself.\u003c/p\u003e\n\u003cp\u003e\n\u003ca href=\"/posts/2022/06/adding-power-button-status-leds-raspberry-pi/images/rpi-power-activity-led-components.jpg\" target=\"_blank\" rel=\"noopener noreferrer\"\u003e\n  \u003cimg src=\"/posts/2022/06/adding-power-button-status-leds-raspberry-pi/images/rpi-power-activity-led-components.jpg\"\n    srcset=\"/posts/2022/06/adding-power-button-status-leds-raspberry-pi/images/rpi-power-activity-led-components_hu75964322e7711b88939357edb5790982_752221_720x0_resize_q100_h2_mitchellnetravali.webp 720w\"\n    alt=\"Raspberry Pi power Button and status LEDs components\" width=\"720\"\n  /\u003e\n\u003c/a\u003e\n\u003c/p\u003e\n\u003ch2 id=\"adding-a-power-button\"\u003eAdding a power button\u003c/h2\u003e\n\u003cp\u003eAdding a power button to my Raspberry Pi was relatively straight forward once I understood how the \u003ca href=\"https://github.com/raspberrypi/firmware/blob/329af8a59d91ea023ce3e2566e2ccd4ec0624438/boot/overlays/README#L1232-L1295\" target=\"_blank\" rel=\"noopener\"\u003e\u003ccode\u003egpio-shutdown\u003c/code\u003e overlay\u003c/a\u003e worked and which pin to use to restart the Pi once it was powered off.\u003c/p\u003e\n\u003cp\u003eThe important part here is to know that, starting with the Raspberry Pi 1 B+, you can restart a powered off board by bridging the \u003ca href=\"https://pinout.xyz/pinout/pin5_gpio3\" target=\"_blank\" rel=\"noopener\"\u003eGPIO3 pin (Pin 5)\u003c/a\u003e to \u003ca href=\"https://pinout.xyz/pinout/ground\" target=\"_blank\" rel=\"noopener\"\u003eGround\u003c/a\u003e. By knowing that, we can also configure the \u003ccode\u003egpio-shutdown\u003c/code\u003e overlay to use this same pin to cleanly shut down a Raspberry Pi when it\u0026rsquo;s on.\u003c/p\u003e\n\u003cp\u003eSo, in order to add a power button to my Pi, I connected a momentary push button between those two pins as follows:\u003c/p\u003e\n\u003cp\u003e\n\u003ca href=\"/posts/2022/06/adding-power-button-status-leds-raspberry-pi/images/rpi-power-button_bb.png\" target=\"_blank\" rel=\"noopener noreferrer\"\u003e\n  \u003cimg src=\"/posts/2022/06/adding-power-button-status-leds-raspberry-pi/images/rpi-power-button_bb.png\"\n    srcset=\"/posts/2022/06/adding-power-button-status-leds-raspberry-pi/images/rpi-power-button_bb_hufc7a6d6b188940ae20866cb208cf5f2f_80154_720x0_resize_q100_h2_mitchellnetravali_3.webp 720w\"\n    alt=\"Raspberry Pi power button wiring diagram\" width=\"720\"\n  /\u003e\n\u003c/a\u003e\n\u003c/p\u003e\n\u003cp\u003eThen update the \u003ccode\u003e/boot/config.txt\u003c/code\u003e file to include the following:\u003c/p\u003e\n\u003cdiv class=\"highlight\"\u003e\u003cpre tabindex=\"0\" class=\"chroma\"\u003e\u003ccode class=\"language-txt\" data-lang=\"txt\"\u003e\u003cspan class=\"line\"\u003e\u003cspan class=\"cl\"\u003edtoverlay=gpio-shutdown,gpio_pin=3,debounce=1000\n\u003c/span\u003e\u003c/span\u003e\u003c/code\u003e\u003c/pre\u003e\u003c/div\u003e\u003cp\u003eThis configures the \u003ccode\u003egpio-shutdown\u003c/code\u003e overlay to use the GPIO3 pin for shutdown with a debounce value of 1000 ms (1 second) meaning that the button needs to be pressed for at least 1s before the Pi starts its shutdown procedure. This parameter is pretty useful to prevent accidental triggering.\u003c/p\u003e\n\u003cp\u003eThe only issue with using this setup to handle power management is that the GPIO3 pin is also used by the I²C bus as the SCL Pin thus requiring I²C to be disabled. If this bus is required, a more complex setup might be possible but has not been investigated here.\u003c/p\u003e\n\u003cblockquote\u003e\n\u003cp\u003e\u003cstrong\u003eNote\u003c/strong\u003e\u003c/p\u003e\n\u003cp\u003eUsing \u003ccode\u003egpio-shutdown\u003c/code\u003e to power off a Raspberry Pi does not completely cut power to it, it only puts it in a halted state (similar to what happens when running \u003ccode\u003epoweroff\u003c/code\u003e or \u003ccode\u003ehalt\u003c/code\u003e on it). It will still consume a negligible amount of power.\u003c/p\u003e\n\u003c/blockquote\u003e\n\u003ch2 id=\"adding-a-power-status-led\"\u003eAdding a power status LED\u003c/h2\u003e\n\u003cp\u003eThings started to get a little harder once I tried to add a power status LED. A lot of different setup have been documented on the internet such as wiring it to the UART TXD pin, but I felt like using the UART bus this way wasn\u0026rsquo;t a clean solution.\u003c/p\u003e\n\u003cp\u003eAnother issue I found was most of the setup were using pins that are pulled up to 3.3V when the Pi is powered off (pin 1 to 8 are pulled up by default, requiring a pull-down resistor to be used properly). This can be a nice side effect if you wish to have a dimmed LED when the Raspberry Pi is powered off, but this wasn\u0026rsquo;t what I was looking for.\u003c/p\u003e\n\u003cp\u003eIn the end I decided to use the \u003ca href=\"https://pinout.xyz/pinout/pin11_gpio17\" target=\"_blank\" rel=\"noopener\"\u003eGPIO17 pin (Pin 11)\u003c/a\u003e with the \u003ca href=\"https://www.raspberrypi.com/documentation/computers/config_txt.html#gpio-control\" target=\"_blank\" rel=\"noopener\"\u003eGPIO control directives\u003c/a\u003e available in \u003ccode\u003econfig.txt\u003c/code\u003e to drive it high on boot. As this pin is not pulled-up by default, the LED will be completely off when the Pi is off.\u003c/p\u003e\n\u003cp\u003eUsing a 3 mm 2.2V 20mA red LED with a 3.3 kΩ resistor (to reduce its brightness), I installed it between GPIO17 and Ground as follows:\u003c/p\u003e\n\u003cp\u003e\n\u003ca href=\"/posts/2022/06/adding-power-button-status-leds-raspberry-pi/images/rpi-power-led_bb.png\" target=\"_blank\" rel=\"noopener noreferrer\"\u003e\n  \u003cimg src=\"/posts/2022/06/adding-power-button-status-leds-raspberry-pi/images/rpi-power-led_bb.png\"\n    srcset=\"/posts/2022/06/adding-power-button-status-leds-raspberry-pi/images/rpi-power-led_bb_hu96850d1834c39e8551d1705508b3b852_78887_720x0_resize_q100_h2_mitchellnetravali_3.webp 720w\"\n    alt=\"Raspberry Pi power status led wiring diagram\" width=\"720\"\n  /\u003e\n\u003c/a\u003e\n\u003c/p\u003e\n\u003cp\u003eThen updated the \u003ccode\u003e/boot/config.txt\u003c/code\u003e file to add the following directive with instruct the system to drive the GPIO17 pin high on boot:\u003c/p\u003e\n\u003cdiv class=\"highlight\"\u003e\u003cpre tabindex=\"0\" class=\"chroma\"\u003e\u003ccode class=\"language-txt\" data-lang=\"txt\"\u003e\u003cspan class=\"line\"\u003e\u003cspan class=\"cl\"\u003egpio=17=op,dh\n\u003c/span\u003e\u003c/span\u003e\u003c/code\u003e\u003c/pre\u003e\u003c/div\u003e\u003cp\u003eThis setup can be adapted to any other GPIO pin available on the board with the caveat about pulled-up pins previously described. A pretty neat setup I tested \u0026ldquo;abusing\u0026rdquo; this caveat was to use the \u003ca href=\"https://pinout.xyz/pinout/pin3_gpio2\" target=\"_blank\" rel=\"noopener\"\u003eGPIO2 pin\u003c/a\u003e using \u003ccode\u003egpio=2=op,dh\u003c/code\u003e to have a dimly lit LED when the Pi is off and a brighter LED when it\u0026rsquo;s on.\u003c/p\u003e\n\u003ch2 id=\"adding-an-activity-led\"\u003eAdding an activity LED\u003c/h2\u003e\n\u003cp\u003eFinally, it was time to add an external activity LED, this was pretty easy once I stumbled upon the \u003ca href=\"https://github.com/raspberrypi/firmware/blob/329af8a59d91ea023ce3e2566e2ccd4ec0624438/boot/overlays/README#L295-L310\" target=\"_blank\" rel=\"noopener\"\u003e\u003ccode\u003eact-led\u003c/code\u003e overlay\u003c/a\u003e. This overlay is easy to configure as it only really requires a GPIO pin but can be customized using the \u003ca href=\"https://github.com/raspberrypi/firmware/blob/329af8a59d91ea023ce3e2566e2ccd4ec0624438/boot/overlays/README#L262-L264\" target=\"_blank\" rel=\"noopener\"\u003e\u003ccode\u003eact_led_trigger\u003c/code\u003e parameter\u003c/a\u003e to choose which event should trigger it.\u003c/p\u003e\n\u003cp\u003eThe choice of the GPIO pin to use had to follow the same logic as for the power status LED, but I really couldn\u0026rsquo;t use a pulled-up pin here as I didn\u0026rsquo;t want it to light up at all if nothing happened on the Pi. In the end I decided to use the \u003ca href=\"https://pinout.xyz/pinout/pin13_gpio27\" target=\"_blank\" rel=\"noopener\"\u003eGPIO27 pin (Pin 13)\u003c/a\u003e as it was near a ground pin, close to GPIO17 and not pulled-up by default.\u003c/p\u003e\n\u003cp\u003eHere I used a 3 mm 2.2V 20mA yellow LED with a 4.7 kΩ resistor (still to limit its brightness) wired between GPIO27 and Ground:\u003c/p\u003e\n\u003cp\u003e\n\u003ca href=\"/posts/2022/06/adding-power-button-status-leds-raspberry-pi/images/rpi-activity-led_bb.png\" target=\"_blank\" rel=\"noopener noreferrer\"\u003e\n  \u003cimg src=\"/posts/2022/06/adding-power-button-status-leds-raspberry-pi/images/rpi-activity-led_bb.png\"\n    srcset=\"/posts/2022/06/adding-power-button-status-leds-raspberry-pi/images/rpi-activity-led_bb_hu57be1527b531c1f3b8aa673aead18f76_80491_720x0_resize_q100_h2_mitchellnetravali_3.webp 720w\"\n    alt=\"Raspberry Pi activity status led wiring diagram\" width=\"720\"\n  /\u003e\n\u003c/a\u003e\n\u003c/p\u003e\n\u003cp\u003eFinally, updating the \u003ccode\u003e/boot/config.txt\u003c/code\u003e one last time to add \u003ccode\u003eact-led\u003c/code\u003e overlay configuration:\u003c/p\u003e\n\u003cdiv class=\"highlight\"\u003e\u003cpre tabindex=\"0\" class=\"chroma\"\u003e\u003ccode class=\"language-txt\" data-lang=\"txt\"\u003e\u003cspan class=\"line\"\u003e\u003cspan class=\"cl\"\u003edtparam=act_led_trigger=mmc0\n\u003c/span\u003e\u003c/span\u003e\u003cspan class=\"line\"\u003e\u003cspan class=\"cl\"\u003edtoverlay=act-led,activelow=off,gpio=27\n\u003c/span\u003e\u003c/span\u003e\u003c/code\u003e\u003c/pre\u003e\u003c/div\u003e\u003cp\u003eHere I set the \u003ccode\u003eact_led_trigger\u003c/code\u003e to \u003ccode\u003emmc0\u003c/code\u003e which will make the LED react to filesystem usage on the SD card of the Pi. This could be set to any of the other triggers available from the following list:\u003c/p\u003e\n\u003cdiv class=\"highlight\"\u003e\u003cpre tabindex=\"0\" class=\"chroma\"\u003e\u003ccode class=\"language-txt\" data-lang=\"txt\"\u003e\u003cspan class=\"line\"\u003e\u003cspan class=\"cl\"\u003enone                No trigger\n\u003c/span\u003e\u003c/span\u003e\u003cspan class=\"line\"\u003e\u003cspan class=\"cl\"\u003ekbd-scrolllock      Keyboard scroll lock\n\u003c/span\u003e\u003c/span\u003e\u003cspan class=\"line\"\u003e\u003cspan class=\"cl\"\u003ekbd-numlock         Keyboard num lock\n\u003c/span\u003e\u003c/span\u003e\u003cspan class=\"line\"\u003e\u003cspan class=\"cl\"\u003ekbd-capslock        Keyboard caps lock\n\u003c/span\u003e\u003c/span\u003e\u003cspan class=\"line\"\u003e\u003cspan class=\"cl\"\u003ekbd-kanalock        Keyboard kana lock\n\u003c/span\u003e\u003c/span\u003e\u003cspan class=\"line\"\u003e\u003cspan class=\"cl\"\u003ekbd-shiftlock       Keyboard shift\n\u003c/span\u003e\u003c/span\u003e\u003cspan class=\"line\"\u003e\u003cspan class=\"cl\"\u003ekbd-altgrlock       Keyboard altgr\n\u003c/span\u003e\u003c/span\u003e\u003cspan class=\"line\"\u003e\u003cspan class=\"cl\"\u003ekbd-ctrllock        Keyboard ctrl\n\u003c/span\u003e\u003c/span\u003e\u003cspan class=\"line\"\u003e\u003cspan class=\"cl\"\u003ekbd-altlock         Keyboard alt\n\u003c/span\u003e\u003c/span\u003e\u003cspan class=\"line\"\u003e\u003cspan class=\"cl\"\u003ekbd-shiftllock      Keyboard left shift\n\u003c/span\u003e\u003c/span\u003e\u003cspan class=\"line\"\u003e\u003cspan class=\"cl\"\u003ekbd-shiftrlock      Keyboard right shift\n\u003c/span\u003e\u003c/span\u003e\u003cspan class=\"line\"\u003e\u003cspan class=\"cl\"\u003ekbd-ctrlllock       Keyboard left ctrl\n\u003c/span\u003e\u003c/span\u003e\u003cspan class=\"line\"\u003e\u003cspan class=\"cl\"\u003ekbd-ctrlrlock       Keyboard right ctrl\n\u003c/span\u003e\u003c/span\u003e\u003cspan class=\"line\"\u003e\u003cspan class=\"cl\"\u003etimer               Flash at 1 second intervals\n\u003c/span\u003e\u003c/span\u003e\u003cspan class=\"line\"\u003e\u003cspan class=\"cl\"\u003eoneshot             Flash only once\n\u003c/span\u003e\u003c/span\u003e\u003cspan class=\"line\"\u003e\u003cspan class=\"cl\"\u003eheartbeat           Flash like a heartbeat (1-0-1-00000)\n\u003c/span\u003e\u003c/span\u003e\u003cspan class=\"line\"\u003e\u003cspan class=\"cl\"\u003ebacklight           Always on\n\u003c/span\u003e\u003c/span\u003e\u003cspan class=\"line\"\u003e\u003cspan class=\"cl\"\u003egpio                Flash when a certain GPIO is high???\n\u003c/span\u003e\u003c/span\u003e\u003cspan class=\"line\"\u003e\u003cspan class=\"cl\"\u003ecpu0                Flash on cpu0 usage\n\u003c/span\u003e\u003c/span\u003e\u003cspan class=\"line\"\u003e\u003cspan class=\"cl\"\u003ecpu1                Flash on cpu1 usage\n\u003c/span\u003e\u003c/span\u003e\u003cspan class=\"line\"\u003e\u003cspan class=\"cl\"\u003ecpu2                Flash on cpu2 usage\n\u003c/span\u003e\u003c/span\u003e\u003cspan class=\"line\"\u003e\u003cspan class=\"cl\"\u003ecpu3                Flash on cpu3 usage\n\u003c/span\u003e\u003c/span\u003e\u003cspan class=\"line\"\u003e\u003cspan class=\"cl\"\u003edefault-on          Always on\n\u003c/span\u003e\u003c/span\u003e\u003cspan class=\"line\"\u003e\u003cspan class=\"cl\"\u003e[input]             Default state\n\u003c/span\u003e\u003c/span\u003e\u003cspan class=\"line\"\u003e\u003cspan class=\"cl\"\u003epanic               Flash on kernel panic\n\u003c/span\u003e\u003c/span\u003e\u003cspan class=\"line\"\u003e\u003cspan class=\"cl\"\u003emmc0                Flash on mmc0 (primary SD Card interface) activity\n\u003c/span\u003e\u003c/span\u003e\u003cspan class=\"line\"\u003e\u003cspan class=\"cl\"\u003emmc1                Flash on mmc1 (secondary SD Card interface) activity\n\u003c/span\u003e\u003c/span\u003e\u003cspan class=\"line\"\u003e\u003cspan class=\"cl\"\u003erfkill0             Flash on wifi activity\n\u003c/span\u003e\u003c/span\u003e\u003cspan class=\"line\"\u003e\u003cspan class=\"cl\"\u003erfkill1             Flash on bluetooth activity\n\u003c/span\u003e\u003c/span\u003e\u003c/code\u003e\u003c/pre\u003e\u003c/div\u003e\u003cp\u003eThanks to \u003ca href=\"https://raspberrypi.stackexchange.com/users/3334/ameer\" target=\"_blank\" rel=\"noopener\"\u003eAmeer\u003c/a\u003e on the \u003ca href=\"https://raspberrypi.stackexchange.com/a/69759\" target=\"_blank\" rel=\"noopener\"\u003eRaspberry Pi Stack Exchange forum\u003c/a\u003e for creating this list.\u003c/p\u003e\n\u003ch2 id=\"final-setup\"\u003eFinal setup\u003c/h2\u003e\n\u003cp\u003eIn the end, if we put everything together we can achieve quite a nice setup without requiring any extra software on your Raspberry Pi that handles:\u003c/p\u003e\n\u003cul\u003e\n\u003cli\u003ea power button to shut down and reboot your Raspberry Pi\u003c/li\u003e\n\u003cli\u003ea power status LED lighting up when the system if on\u003c/li\u003e\n\u003cli\u003ean activity LED reacting to file system\u003c/li\u003e\n\u003c/ul\u003e\n\u003cp\u003eThe final wiring diagram should look like this:\u003c/p\u003e\n\u003cp\u003e\n\u003ca href=\"/posts/2022/06/adding-power-button-status-leds-raspberry-pi/images/rpi-power-leds-final_bb.png\" target=\"_blank\" rel=\"noopener noreferrer\"\u003e\n  \u003cimg src=\"/posts/2022/06/adding-power-button-status-leds-raspberry-pi/images/rpi-power-leds-final_bb.png\"\n    srcset=\"/posts/2022/06/adding-power-button-status-leds-raspberry-pi/images/rpi-power-leds-final_bb_hua73ea03de5beaf44d9e66a7216fee8eb_87787_720x0_resize_q100_h2_mitchellnetravali_3.webp 720w\"\n    alt=\"Raspberry Pi power button, power status and activity status led wiring diagram\" width=\"720\"\n  /\u003e\n\u003c/a\u003e\n\u003c/p\u003e\n\u003cp\u003eAnd the \u003ccode\u003e/boot/config.txt\u003c/code\u003e file should have the following lines at the end:\u003c/p\u003e\n\u003cdiv class=\"highlight\"\u003e\u003cpre tabindex=\"0\" class=\"chroma\"\u003e\u003ccode class=\"language-txt\" data-lang=\"txt\"\u003e\u003cspan class=\"line\"\u003e\u003cspan class=\"cl\"\u003e# Power button\n\u003c/span\u003e\u003c/span\u003e\u003cspan class=\"line\"\u003e\u003cspan class=\"cl\"\u003edtoverlay=gpio-shutdown,gpio_pin=3,debounce=1000\n\u003c/span\u003e\u003c/span\u003e\u003cspan class=\"line\"\u003e\u003cspan class=\"cl\"\u003e\n\u003c/span\u003e\u003c/span\u003e\u003cspan class=\"line\"\u003e\u003cspan class=\"cl\"\u003e# Power status LED\n\u003c/span\u003e\u003c/span\u003e\u003cspan class=\"line\"\u003e\u003cspan class=\"cl\"\u003egpio=17=op,dh\n\u003c/span\u003e\u003c/span\u003e\u003cspan class=\"line\"\u003e\u003cspan class=\"cl\"\u003e\n\u003c/span\u003e\u003c/span\u003e\u003cspan class=\"line\"\u003e\u003cspan class=\"cl\"\u003e# Activity LED\n\u003c/span\u003e\u003c/span\u003e\u003cspan class=\"line\"\u003e\u003cspan class=\"cl\"\u003edtparam=act_led_trigger=mmc0\n\u003c/span\u003e\u003c/span\u003e\u003cspan class=\"line\"\u003e\u003cspan class=\"cl\"\u003edtoverlay=act-led,activelow=off,gpio=27\n\u003c/span\u003e\u003c/span\u003e\u003c/code\u003e\u003c/pre\u003e\u003c/div\u003e\u003cp\u003ePaired with the \u003ca href=\"https://www.printables.com/model/227181\" target=\"_blank\" rel=\"noopener\"\u003eMP-1 Rack Raspberry Pi module\u003c/a\u003e, this setup allowed me to achieve my goal of having a rack mounted solution with power controls and feedback for my Pis. And I hope it helped you too if you were looking for something similar\u003c/p\u003e\n\u003cp\u003e\n\u003ca href=\"/posts/2022/06/adding-power-button-status-leds-raspberry-pi/images/mp1-rack-pi-module.jpg\" target=\"_blank\" rel=\"noopener noreferrer\"\u003e\n  \u003cimg src=\"/posts/2022/06/adding-power-button-status-leds-raspberry-pi/images/mp1-rack-pi-module.jpg\"\n    srcset=\"/posts/2022/06/adding-power-button-status-leds-raspberry-pi/images/mp1-rack-pi-module_huf19009cd6da5c1c50b738fc47412f017_875439_720x0_resize_q100_h2_mitchellnetravali.webp 720w\"\n    alt=\"MP-1 Rack Raspberry Pi modules\" width=\"720\"\n  /\u003e\n\u003c/a\u003e\n\u003c/p\u003e\n\u003ch2 id=\"references\"\u003eReferences\u003c/h2\u003e\n\u003cul\u003e\n\u003cli\u003e\u003ca href=\"https://github.com/raspberrypi/firmware/blob/329af8a59d91ea023ce3e2566e2ccd4ec0624438/boot/overlays/README#L1232-L1295\" target=\"_blank\" rel=\"noopener\"\u003e\u003ccode\u003egpio-shutdown\u003c/code\u003e overlay documentation\u003c/a\u003e\u003c/li\u003e\n\u003cli\u003e\u003ca href=\"https://embeddedcomputing.com/technology/open-source/development-kits/raspberry-pi-power-up-and-shutdown-with-a-physical-button\" target=\"_blank\" rel=\"noopener\"\u003e\u003cem\u003eRaspberry Pi Power-Up and Shutdown with a Physical Button\u003c/em\u003e by Jeremy S. Cook\u003c/a\u003e\u003c/li\u003e\n\u003cli\u003e\u003ca href=\"https://www.stderr.nl/Blog/Hardware/RaspberryPi/PowerButton.html\" target=\"_blank\" rel=\"noopener\"\u003e\u003cem\u003eRaspberry pi powerdown and powerup button\u003c/em\u003e by Matthijs Kooijman\u003c/a\u003e\u003c/li\u003e\n\u003cli\u003e\u003ca href=\"https://howchoo.com/g/ytzjyzy4m2e/build-a-simple-raspberry-pi-led-power-status-indicator\" target=\"_blank\" rel=\"noopener\"\u003e\u003cem\u003eBuild a Simple Raspberry Pi LED Power/Status Indicator\u003c/em\u003e by Zach on Howchoo\u003c/a\u003e\u003c/li\u003e\n\u003cli\u003e\u003ca href=\"https://forums.raspberrypi.com/viewtopic.php?p=1800623#p1800623\" target=\"_blank\" rel=\"noopener\"\u003e\u003cem\u003eUse GPIO 2 for power LED\u003c/em\u003e on the Raspberry Pi forum\u003c/a\u003e\u003c/li\u003e\n\u003cli\u003e\u003ca href=\"https://forums.raspberrypi.com/viewtopic.php?t=267032\" target=\"_blank\" rel=\"noopener\"\u003e\u003cem\u003eExternal PWR \u0026amp; ACT LEDS\u003c/em\u003e on the Raspberry Pi forum\u003c/a\u003e\u003c/li\u003e\n\u003cli\u003e\u003ca href=\"https://raspberrypi.stackexchange.com/a/69759\" target=\"_blank\" rel=\"noopener\"\u003e\u003ccode\u003eact_led_trigger\u003c/code\u003e values by Ameer on StackExchange\u003c/a\u003e\u003c/li\u003e\n\u003c/ul\u003e\n","tags":["raspberrypi","homelab","electronics"]},{"id":"https://blog.userctl.xyz/posts/2022/06/building-mp1-rack-collection-modular-racking-system/","url":"https://blog.userctl.xyz/posts/2022/06/building-mp1-rack-collection-modular-racking-system/","title":"Building the MP-1 Rack collection: a modular racking system","date_published":"2022-06-20T21:00:00Z","date_modified":"2022-06-30T01:09:38+02:00","summary":"How I built the MP-1 Rack collection, a modular racking system based on the DAP Audio MP-1 19\u0026quot; 2U rack frame to house my ZimaBoards and Raspberry Pis.","content_html":"\u003cp\u003eAfter receiving my long awaited \u003ca href=\"http://www.zimaboard.com/\" target=\"_blank\" rel=\"noopener\"\u003eZimaBoards\u003c/a\u003e, I was looking for a solution to install them in my 19\u0026quot; rack easily before starting building my Kubernetes cluster.\u003c/p\u003e\n\u003cp\u003eI\u0026rsquo;ve seen in the past some modular racking setup for the Raspberry Pi such as the \u003ca href=\"https://github.com/mcpiface/McPiFace\" target=\"_blank\" rel=\"noopener\"\u003ePi Blade McPiFace from Stephen Harrison\u003c/a\u003e, the \u003ca href=\"https://www.thingiverse.com/thing:3022136\" target=\"_blank\" rel=\"noopener\"\u003eRackPi 3D model by Daniel Reinke\u003c/a\u003e or the \u003ca href=\"https://www.thingiverse.com/thing:1793758\" target=\"_blank\" rel=\"noopener\"\u003eRaspberry Pi Rack covers made by Daniel Mostosi\u003c/a\u003e that I really liked. The common denominator between all of them being the use of the \u003ca href=\"https://www.musicstore.com/en_OT/EUR/DAP-2-HE-Rackblende-f-Modulsystem-10-Segmente-MP-1/art-PAH0017160-000\" target=\"_blank\" rel=\"noopener\"\u003eDAP Audio MP-1 modular rack frame\u003c/a\u003e as a base.\u003c/p\u003e\n\u003cp\u003eI decided to take inspiration from those existing modules and build my own modules for the MP-1 frame to achieve the perfect modular rack I wanted that could house my 4 ZimaBoards, a Raspberry Pi and some keystone jacks. This started by ordering the frame and some official blanks for reference.\u003c/p\u003e\n\u003cp\u003e\n\u003ca href=\"/posts/2022/06/building-mp1-rack-collection-modular-racking-system/images/mp1-rack-mounted.jpg\" target=\"_blank\" rel=\"noopener noreferrer\"\u003e\n  \u003cimg src=\"/posts/2022/06/building-mp1-rack-collection-modular-racking-system/images/mp1-rack-mounted.jpg\"\n    srcset=\"/posts/2022/06/building-mp1-rack-collection-modular-racking-system/images/mp1-rack-mounted_hu5daf18fd4f8805e70461d5b54ab598a5_804978_720x0_resize_q100_h2_mitchellnetravali.webp 720w\"\n    alt=\"MP-1 Rack modules mounted\" width=\"720\"\n  /\u003e\n\u003c/a\u003e\n\u003c/p\u003e\n\u003ch2 id=\"the-dap-audio-mp-1-modular-frame\"\u003eThe DAP Audio MP-1 Modular Frame\u003c/h2\u003e\n\u003cp\u003eWhile waiting for my order to arrive, I started looking around for some dimensions to start designing each mount. There isn\u0026rsquo;t much data available on the internet and the main resources for dimensions was the previously mentioned 3D models.\u003c/p\u003e\n\u003cp\u003eOnce I received my order, I took the time to measure everything before installing the frame to help others build their custom modules in the future.\u003c/p\u003e\n\u003cp\u003eThe frame is a 2U 19\u0026quot; rack panel made from 2 mm bent sheet metal consisting of two 9 mm wide rails and a 441 mm × 70.3 mm center opening. Each rail has ten 3 mm untapped screw holes, though the panel is delivered with the required self-taping screws required to attach your modules. Those dimensions provide space for ten 44.1 mm × 88.3 mm segments, which was confirmed by their blank module measurements.\u003c/p\u003e\n\u003cp\u003eHere is a drawing of the dimensions I was able to measure from the frame itself and from the official \u003ca href=\"https://www.musicstore.com/en_OT/EUR/DAP-Leer-Modul-f-Rackblende-2-10-2-Segmente/art-PAH0017179-000\" target=\"_blank\" rel=\"noopener\"\u003eone\u003c/a\u003e and \u003ca href=\"https://www.musicstore.com/en_OT/EUR/DAP-Leer-Modul-f-Rackblende-1-10-1-Segment/art-PAH0017178-000\" target=\"_blank\" rel=\"noopener\"\u003etwo segments\u003c/a\u003e blank face plates available on the Music Store website.\u003c/p\u003e\n\u003cp\u003e\n\u003ca href=\"/posts/2022/06/building-mp1-rack-collection-modular-racking-system/images/dap-audio-mp1.png\" target=\"_blank\" rel=\"noopener noreferrer\"\u003e\n  \u003cimg src=\"/posts/2022/06/building-mp1-rack-collection-modular-racking-system/images/dap-audio-mp1.png\"\n    srcset=\"/posts/2022/06/building-mp1-rack-collection-modular-racking-system/images/dap-audio-mp1_hudf7a0a95fc11b0cdbbae22c89e886247_16293_720x0_resize_q100_h2_mitchellnetravali_3.webp 720w\"\n    alt=\"DAP Audio MP-1 Modular Rack Frame dimensions\" width=\"720\"\n  /\u003e\n\u003c/a\u003e\n\u003c/p\u003e\n\u003cp\u003e\n\u003ca href=\"/posts/2022/06/building-mp1-rack-collection-modular-racking-system/images/dap-audio-mp1-blanks.png\" target=\"_blank\" rel=\"noopener noreferrer\"\u003e\n  \u003cimg src=\"/posts/2022/06/building-mp1-rack-collection-modular-racking-system/images/dap-audio-mp1-blanks.png\"\n    srcset=\"/posts/2022/06/building-mp1-rack-collection-modular-racking-system/images/dap-audio-mp1-blanks_hu94456c5ba29262b7256834838e71c4c9_9668_720x0_resize_q100_h2_mitchellnetravali_3.webp 720w\"\n    alt=\"DAP MP-1 Module dimensions\" width=\"720\"\n  /\u003e\n\u003c/a\u003e\n\u003c/p\u003e\n\u003ch2 id=\"the-mp-1-rack-collection\"\u003eThe MP-1 Rack collection\u003c/h2\u003e\n\u003cp\u003eNow that I had my base, it was time to build the modules to fill in the frame with my small computers. I ended up building a collection of four modules to fit everything I needed:\u003c/p\u003e\n\u003cul\u003e\n\u003cli\u003e\u003ca href=\"https://www.printables.com/model/227179\" target=\"_blank\" rel=\"noopener\"\u003ea ZimaBoard mount\u003c/a\u003e that can accommodate up to two 2.5\u0026quot; hard drives\u003c/li\u003e\n\u003cli\u003e\u003ca href=\"https://www.printables.com/model/227181\" target=\"_blank\" rel=\"noopener\"\u003ea Raspberry Pi mount\u003c/a\u003e with a power button and front facing HDMI port\u003c/li\u003e\n\u003cli\u003e\u003ca href=\"https://www.printables.com/model/227186\" target=\"_blank\" rel=\"noopener\"\u003ea keystone module\u003c/a\u003e in two size to house either 2 or 6 jacks\u003c/li\u003e\n\u003cli\u003e\u003ca href=\"https://www.printables.com/model/227187\" target=\"_blank\" rel=\"noopener\"\u003ea blank module\u003c/a\u003e to fill in empty spaces\u003c/li\u003e\n\u003c/ul\u003e\n\u003cp\u003e\n\u003ca href=\"/posts/2022/06/building-mp1-rack-collection-modular-racking-system/images/mp1-rack-modules.jpg\" target=\"_blank\" rel=\"noopener noreferrer\"\u003e\n  \u003cimg src=\"/posts/2022/06/building-mp1-rack-collection-modular-racking-system/images/mp1-rack-modules.jpg\"\n    srcset=\"/posts/2022/06/building-mp1-rack-collection-modular-racking-system/images/mp1-rack-modules_hudc4e88fe8dc70eb65cc8dc4d4b8cef9b_933612_720x0_resize_q100_h2_mitchellnetravali.webp 720w\"\n    alt=\"MP-1 Rack modules preview\" width=\"720\"\n  /\u003e\n\u003c/a\u003e\n\u003c/p\u003e\n\u003ch3 id=\"zimaboard-module\"\u003eZimaBoard module\u003c/h3\u003e\n\u003cp\u003eI started by first building the ZimaBoard mount, the requirement here was to create a simple but effective way to mount it with spaces for two 2.5\u0026quot; 9.5 mm drives. I first looked at integrating an existing hot-swap solution such as the \u003ca href=\"https://www.icydock.com/goods.php?id=234\" target=\"_blank\" rel=\"noopener\"\u003eIcy Dock flexiDOCK MB522SP-B\u003c/a\u003e in my model, sadly, those 3.5\u0026quot; modules are too large to fit in the 2 segments space I wanted this module to take (so I can fit 4 of them on one frame).\u003c/p\u003e\n\u003cp\u003eIn the end, adding some simple rails under the mount was the solution I went with, it does not provide any hot-swap capabilities but works extremely well with the official \u003ca href=\"https://shop.zimaboard.com/collections/diy-nas-media-server-bt-client/products/sata-y-cable-for-zimaboard-2-5-inch-hdd-3-5-inch-hdd-raid-free-nas-unraid\" target=\"_blank\" rel=\"noopener\"\u003eSATA Y Cable\u003c/a\u003e.\u003c/p\u003e\n\u003cp\u003e\n\u003ca href=\"/posts/2022/06/building-mp1-rack-collection-modular-racking-system/images/mp1-rack-zimaboard.jpg\" target=\"_blank\" rel=\"noopener noreferrer\"\u003e\n  \u003cimg src=\"/posts/2022/06/building-mp1-rack-collection-modular-racking-system/images/mp1-rack-zimaboard.jpg\"\n    srcset=\"/posts/2022/06/building-mp1-rack-collection-modular-racking-system/images/mp1-rack-zimaboard_hu6a35e30894c47dc62199d5be58df84ff_395243_720x0_resize_q100_h2_mitchellnetravali.webp 720w\"\n    alt=\"MP-1 Rack ZimaBoard module\" width=\"720\"\n  /\u003e\n\u003c/a\u003e\n\u003c/p\u003e\n\u003ch3 id=\"raspberry-pi-module\"\u003eRaspberry Pi module\u003c/h3\u003e\n\u003cp\u003eI then went on to create my own Raspberry Pi module, as said in the introduction existing solutions already exists, but none had both space of a front-facing HDMI port and some LEDs / buttons. This started with just a simple mount and cutouts, I decided to use heat-set insert as a mounting solution here to strengthen the connection between the Pi and the module.\u003c/p\u003e\n\u003cp\u003eFollowing that, I added both a space for a 6 mm × 6 mm momentary switch and two 3 mm LEDs that I have configured as a \u003ccode\u003egpio-shutdown\u003c/code\u003e trigger, a simple power LED, and an HDD activity led (more details is available on \u003ca href=\"https://www.printables.com/model/227181\" target=\"_blank\" rel=\"noopener\"\u003ethis model Printables page\u003c/a\u003e).\u003c/p\u003e\n\u003cp\u003eFinally, I added a keystone jack mount, so I can use one of those slim FPV HDMI cables and an HDMI keystone to add a front facing HDMI port (as those cables are also available as mini-HDMI to HDMI, this solution can also be adapted for the Raspberry Pi 4).\u003c/p\u003e\n\u003cp\u003eI decided to publish multiple variants of this specific model module as I understand that not everybody wants some shiny LEDs or spent the necessary cash to add the front-facing HDMI port. I\u0026rsquo;ve also added a screw-in version of each variant if you do not want to use any heat-set insert to mount your Pi.\u003c/p\u003e\n\u003cp\u003e\n\u003ca href=\"/posts/2022/06/building-mp1-rack-collection-modular-racking-system/images/mp1-rack-raspberrypi.jpg\" target=\"_blank\" rel=\"noopener noreferrer\"\u003e\n  \u003cimg src=\"/posts/2022/06/building-mp1-rack-collection-modular-racking-system/images/mp1-rack-raspberrypi.jpg\"\n    srcset=\"/posts/2022/06/building-mp1-rack-collection-modular-racking-system/images/mp1-rack-raspberrypi_huec896a4e8579eea6a1d975a9d977db2d_466222_720x0_resize_q100_h2_mitchellnetravali.webp 720w\"\n    alt=\"MP-1 Rack Raspberry Pi module\" width=\"720\"\n  /\u003e\n\u003c/a\u003e\n\u003c/p\u003e\n\u003ch3 id=\"extra-modules\"\u003eExtra modules\u003c/h3\u003e\n\u003cp\u003eNow that I have a keystone jack footprint, I decided to add two modules to the collection that just allows you to attach some keystone to your frame: a small one segment module that can house 2 jacks and a two segments module for 6 jacks. This ended up being quite a handy way to cleanly connect my router to my rack without having an exposed long cable.\u003c/p\u003e\n\u003cp\u003eI also added one segment and two segments blank modules to the collection to provide an easy way to plug your empty slots if you haven\u0026rsquo;t bought the official ones with your frame or to use as a base when creating your own modules.\u003c/p\u003e\n\u003cp\u003e\n\u003ca href=\"/posts/2022/06/building-mp1-rack-collection-modular-racking-system/images/mp1-rack-extra.jpg\" target=\"_blank\" rel=\"noopener noreferrer\"\u003e\n  \u003cimg src=\"/posts/2022/06/building-mp1-rack-collection-modular-racking-system/images/mp1-rack-extra.jpg\"\n    srcset=\"/posts/2022/06/building-mp1-rack-collection-modular-racking-system/images/mp1-rack-extra_hua6c6a506b198f1a202c7e68a466ec8da_400419_720x0_resize_q100_h2_mitchellnetravali.webp 720w\"\n    alt=\"MP-1 Rack keystone and blank modules\" width=\"720\"\n  /\u003e\n\u003c/a\u003e\n\u003c/p\u003e\n\u003ch3 id=\"download-the-collection\"\u003eDownload the collection\u003c/h3\u003e\n\u003cp\u003eYou can find all those models with their Fusion 360 source files in the \u003ca href=\"https://www.printables.com/social/242926-orax/collections/191937\" target=\"_blank\" rel=\"noopener\"\u003eMP-1 Rack collection on Printables\u003c/a\u003e as well as a \u003ca href=\"https://www.printables.com/model/224057-zimaboard-dual-hdd-stand\" target=\"_blank\" rel=\"noopener\"\u003estandalone version of the ZimaBoard mount to use a simple desk stand\u003c/a\u003e.\u003c/p\u003e\n\u003cp\u003eI really hope this collection will help others create their perfect mounting solutions for their small single board computer and inspire more people in building modules for the MP-1 frame!\u003c/p\u003e\n","tags":["raspberrypi","zimaboard","homelab"]},{"id":"https://blog.userctl.xyz/posts/2022/05/announcing-berryos-lightweight-os-raspberry-pi/","url":"https://blog.userctl.xyz/posts/2022/05/announcing-berryos-lightweight-os-raspberry-pi/","title":"Announcing BerryOS: a lightweight OS for your Raspberry Pi","date_published":"2022-05-30T22:00:00Z","date_modified":"2022-10-04T00:37:02+02:00","summary":"BerryOS is a lightweight operating system for your Raspberry Pi available for both armhf and arm64 Raspberry Pis and configurable using cloud-init.","content_html":"\u003cp\u003eAfter a couple of weeks working on it, I am proud to finally be releasing the first version of \u003ca href=\"https://berryos.wiki/\" target=\"_blank\" rel=\"noopener\"\u003eBerryOS\u003c/a\u003e to the public!\u003c/p\u003e\n\u003ch2 id=\"what-is-berryos\"\u003eWhat is BerryOS?\u003c/h2\u003e\n\u003cp\u003e\n\u003ca href=\"/posts/2022/05/announcing-berryos-lightweight-os-raspberry-pi/images/berryos-banner.png\" target=\"_blank\" rel=\"noopener noreferrer\"\u003e\n  \u003cimg src=\"/posts/2022/05/announcing-berryos-lightweight-os-raspberry-pi/images/berryos-banner.png\"\n    srcset=\"/posts/2022/05/announcing-berryos-lightweight-os-raspberry-pi/images/berryos-banner_hue5bda957566a0833f00f68da66c062c0_11802_720x0_resize_q100_h2_mitchellnetravali_3.webp 720w\"\n    alt=\"BerryOS Logo\" width=\"720\"\n  /\u003e\n\u003c/a\u003e\n\u003c/p\u003e\n\u003cp\u003eBerryOS is a lightweight operating system for your Raspberry Pi based on the official Raspberry Pi OS Lite bootstrapped directly from its sources. It is available in two variant: \u003ccode\u003eBerryOS/armhf\u003c/code\u003e and \u003ccode\u003eBerryOS/arm64\u003c/code\u003e for 32 \u0026amp; 64-bit ARM compatible hardware.\u003c/p\u003e\n\u003cp\u003eWhen building it, my goal was to create a lightweight version of Raspberry Pi OS Lite than can be configured headlessly at first boot using \u003ca href=\"https://cloud-init.io/\" target=\"_blank\" rel=\"noopener\"\u003e\u003ccode\u003ecloud-init\u003c/code\u003e\u003c/a\u003e. Other images including \u003ccode\u003ecloud-init\u003c/code\u003e already exists such as the \u003ca href=\"https://ubuntu.com/download/raspberry-pi\" target=\"_blank\" rel=\"noopener\"\u003eUbuntu Server RPi release\u003c/a\u003e or the now defunct \u003ca href=\"https://blog.hypriot.com/downloads/\" target=\"_blank\" rel=\"noopener\"\u003eHypriotOS\u003c/a\u003e, though most of them includes extra software or are not based on Debian itself.\u003c/p\u003e\n\u003cp\u003eIn order to keep the same level of compatibility with 3rd party software and hardware, I decided to bootstrap it directly from the Raspberry Pi OS sources (\u003ca href=\"http://raspbian.org/\" target=\"_blank\" rel=\"noopener\"\u003eRaspbian GNU/Linux\u003c/a\u003e and \u003ca href=\"https://www.debian.org/\" target=\"_blank\" rel=\"noopener\"\u003eDebian GNU/Linux\u003c/a\u003e for its \u003ccode\u003earmhf\u003c/code\u003e and \u003ccode\u003earm64\u003c/code\u003e version respectively) with some tweaks to the list of pre-installed package and default configuration.\u003c/p\u003e\n\u003cp\u003eIn the end, BerryOS turned out to be nearly 40% lighter than Raspberry Pi OS Lite, had fewer processes running by default while being completely configurable using \u003ccode\u003ecloud-init\u003c/code\u003e.\u003c/p\u003e\n\u003cp\u003eHere is a comparison table between the first BerryOS release (BerryOS Bullseye 2022.05.30) and the latest Raspberry Pi OS Lite release (Raspberry Pi OS Bullseye 2022.04.04) running on a Raspberry Pi 3 B:\u003c/p\u003e\n\u003ctable\u003e\n\u003cthead\u003e\n\u003ctr\u003e\n\u003cth\u003eStat\u003c/th\u003e\n\u003cth\u003eBerryOS/armhf\u003c/th\u003e\n\u003cth\u003eRaspiOS/armhf\u003c/th\u003e\n\u003cth\u003eBerryOS/arm64\u003c/th\u003e\n\u003cth\u003eRaspiOS/arm64\u003c/th\u003e\n\u003c/tr\u003e\n\u003c/thead\u003e\n\u003ctbody\u003e\n\u003ctr\u003e\n\u003ctd\u003eRAM usage\u003c/td\u003e\n\u003ctd\u003e37M\u003c/td\u003e\n\u003ctd\u003e57M\u003c/td\u003e\n\u003ctd\u003e52M\u003c/td\u003e\n\u003ctd\u003e72M\u003c/td\u003e\n\u003c/tr\u003e\n\u003ctr\u003e\n\u003ctd\u003eRunning processes\u003c/td\u003e\n\u003ctd\u003e12\u003c/td\u003e\n\u003ctd\u003e18\u003c/td\u003e\n\u003ctd\u003e12\u003c/td\u003e\n\u003ctd\u003e20\u003c/td\u003e\n\u003c/tr\u003e\n\u003ctr\u003e\n\u003ctd\u003eDisk usage\u003c/td\u003e\n\u003ctd\u003e807.1M\u003c/td\u003e\n\u003ctd\u003e1.3G\u003c/td\u003e\n\u003ctd\u003e611.7M\u003c/td\u003e\n\u003ctd\u003e1.3G\u003c/td\u003e\n\u003c/tr\u003e\n\u003ctr\u003e\n\u003ctd\u003ePre-installed packages\u003c/td\u003e\n\u003ctd\u003e312\u003c/td\u003e\n\u003ctd\u003e530\u003c/td\u003e\n\u003ctd\u003e285\u003c/td\u003e\n\u003ctd\u003e521\u003c/td\u003e\n\u003c/tr\u003e\n\u003ctr\u003e\n\u003ctd\u003eDownload size\u003c/td\u003e\n\u003ctd\u003e201M\u003c/td\u003e\n\u003ctd\u003e297M\u003c/td\u003e\n\u003ctd\u003e153M\u003c/td\u003e\n\u003ctd\u003e271M\u003c/td\u003e\n\u003c/tr\u003e\n\u003ctr\u003e\n\u003ctd\u003eImage size\u003c/td\u003e\n\u003ctd\u003e1312M\u003c/td\u003e\n\u003ctd\u003e1924M\u003c/td\u003e\n\u003ctd\u003e1112M\u003c/td\u003e\n\u003ctd\u003e1908M\u003c/td\u003e\n\u003c/tr\u003e\n\u003c/tbody\u003e\n\u003c/table\u003e\n\u003cp\u003eThe methodology for these results can be found in \u003ca href=\"https://github.com/0rax/BerryOS/blob/main/README.md#Benchmark\" target=\"_blank\" rel=\"noopener\"\u003ethe Benchmark section of the BerryOS README file\u003c/a\u003e.\u003c/p\u003e\n\u003ch2 id=\"where-to-get-it\"\u003eWhere to get it?\u003c/h2\u003e\n\u003cp\u003eBerryOS is completely open-source and licensed under the \u003ca href=\"https://opensource.org/licenses/ISC\" target=\"_blank\" rel=\"noopener\"\u003eISC License\u003c/a\u003e. Its source code is hosted on GitHub at \u003ca href=\"https://github.com/0rax/BerryOS\" target=\"_blank\" rel=\"noopener\"\u003egithub.com/0rax/BerryOS\u003c/a\u003e.\u003c/p\u003e\n\u003cp\u003eFrom there, you can download all current and previous version of each variant or checkout \u003ca href=\"https://berryos.wiki/\" target=\"_blank\" rel=\"noopener\"\u003eits documentation\u003c/a\u003e (which is still a work in progress) where you will also find \u003ca href=\"hhttps://berryos.wiki/docs/examples/\"\u003esome example configuration files\u003c/a\u003e to get you started.\u003c/p\u003e\n\u003cp\u003eIf you decide to give it a go and find any issues with it, do not hesitate to \u003ca href=\"https://github.com/0rax/BerryOS/issues/new\" target=\"_blank\" rel=\"noopener\"\u003ereport them on GitHub\u003c/a\u003e, so they can be fixed as soon as possible.\u003c/p\u003e\n\u003ch2 id=\"how-to-use-it\"\u003eHow to use it?\u003c/h2\u003e\n\u003cp\u003eGrab your closest Raspberry Pi and your SD card of choice, head to the \u003ca href=\"https://github.com/0rax/BerryOS/releases/latest\" target=\"_blank\" rel=\"noopener\"\u003elatest release page\u003c/a\u003e and download the variant you need.\u003c/p\u003e\n\u003cul\u003e\n\u003cli\u003e\u003ccode\u003eBerryOS/armhf\u003c/code\u003e should be compatible with ALL Raspberry Pi models.\u003c/li\u003e\n\u003cli\u003e\u003ccode\u003eBerryOS/arm64\u003c/code\u003e should be compatible with the Raspberry Pi 3B, 3B+, 4 \u0026amp; 400, Compute Module 3, 3+ \u0026amp; 4 as well as the Raspberry Pi Zero 2 W.\u003c/li\u003e\n\u003c/ul\u003e\n\u003cp\u003e\n\u003ca href=\"/posts/2022/05/announcing-berryos-lightweight-os-raspberry-pi/images/rpi-3b.jpg\" target=\"_blank\" rel=\"noopener noreferrer\"\u003e\n  \u003cimg src=\"/posts/2022/05/announcing-berryos-lightweight-os-raspberry-pi/images/rpi-3b.jpg\"\n    srcset=\"/posts/2022/05/announcing-berryos-lightweight-os-raspberry-pi/images/rpi-3b_hubce0dc0a8248cbd6c0a31cb67d590823_190548_720x0_resize_q100_h2_mitchellnetravali.webp 720w\"\n    alt=\"Raspberry Pi 3B \u0026amp;amp; SD Card\" width=\"720\"\n  /\u003e\n\u003c/a\u003e\n\u003c/p\u003e\n\u003cp\u003eFire up you favorite tool and flash your newly acquired image to your SD card. Any flashing tools should work, such as the official \u003ca href=\"https://www.raspberrypi.com/software/\" target=\"_blank\" rel=\"noopener\"\u003eRaspberry Pi Imager\u003c/a\u003e, \u003ca href=\"https://www.balena.io/etcher/\" target=\"_blank\" rel=\"noopener\"\u003ebalenaEtcher\u003c/a\u003e, \u003ca href=\"https://github.com/hypriot/flash\" target=\"_blank\" rel=\"noopener\"\u003eHypriot\u0026rsquo;s \u003ccode\u003eflash\u003c/code\u003e tool\u003c/a\u003e or even \u003ccode\u003edd\u003c/code\u003e on any *NIX like system.\u003c/p\u003e\n\u003cblockquote\u003e\n\u003cp\u003e\u003cstrong\u003eNote\u003c/strong\u003e\u003c/p\u003e\n\u003cp\u003e\u003ca href=\"https://github.com/hypriot/flash\" target=\"_blank\" rel=\"noopener\"\u003eHypriot\u0026rsquo;s \u003ccode\u003eflash\u003c/code\u003e tool\u003c/a\u003e can be used pretty efficiently with BerryOS as it allows you to specify extra configuration file to copy to your SD card after flashing directly from the command line.\u003c/p\u003e\n\u003cp\u003eFor example to flash BerryOS with a custom \u003ccode\u003euser-data\u003c/code\u003e and \u003ccode\u003econfig.txt\u003c/code\u003e file you already have on disk, you can just run:\u003c/p\u003e\n\u003cdiv class=\"highlight\"\u003e\u003cpre tabindex=\"0\" class=\"chroma\"\u003e\u003ccode class=\"language-sh\" data-lang=\"sh\"\u003e\u003cspan class=\"line\"\u003e\u003cspan class=\"cl\"\u003eflash --userdata user-data.yaml --bootconf config.txt ~/Downloads/berryos-arm64-bullseye-20220527.img.xz\n\u003c/span\u003e\u003c/span\u003e\u003c/code\u003e\u003c/pre\u003e\u003c/div\u003e\u003c/blockquote\u003e\n\u003cp\u003eOnce successfully flashed, unplug and re-plug your SD card from your computer (to force remounting it) and open the drive named \u003ccode\u003eboot\u003c/code\u003e. You should be able to open the \u003ccode\u003euser-data\u003c/code\u003e file with your favorite text editor from there.\u003c/p\u003e\n\u003cp\u003e\u003ccode\u003euser-data\u003c/code\u003e is the configuration file that will be used by \u003ccode\u003ecloud-init\u003c/code\u003e to configure your system on its first boot. We have set it up to use the \u003ca href=\"https://cloudinit.readthedocs.io/en/latest/topics/format.html#cloud-config-data\" target=\"_blank\" rel=\"noopener\"\u003eCloud Config format\u003c/a\u003e as it makes configuring a system really simple, though other format are also available.\u003c/p\u003e\n\u003cp\u003eThis is a really important file when setting up a BerryOS system, as this is where you will set up how to access your system.\u003c/p\u003e\n\u003cblockquote\u003e\n\u003cp\u003e\u003cstrong\u003eNote\u003c/strong\u003e\u003c/p\u003e\n\u003cp\u003eBy default, BerryOS does not enable password based SSH access to the default user to follow the decision made by the Raspberry Pi Foundation in April 2022 to disable it on Raspberry Pi OS Bullseye going forward (\u003ca href=\"https://www.raspberrypi.com/news/raspberry-pi-bullseye-update-april-2022/\" target=\"_blank\" rel=\"noopener\"\u003esource\u003c/a\u003e).\u003c/p\u003e\n\u003c/blockquote\u003e\n\u003cp\u003eI would suggest going through the whole file (also \u003ca href=\"https://github.com/0rax/BerryOS/blob/main/rootfs/boot/user-data\" target=\"_blank\" rel=\"noopener\"\u003eavailable on GitHub\u003c/a\u003e) and read the comments to understand what you are able to configure using it. You can also have more extensive explanation of the configuration capabilities in \u003ca href=\"https://berryos.wiki/docs/config\" target=\"_blank\" rel=\"noopener\"\u003ethe project documentation\u003c/a\u003e.\u003c/p\u003e\n\u003cp\u003eHere we will just update the default user (\u003ccode\u003epi\u003c/code\u003e) password and enable SSH password authentication and set the system hostname. To do so, append the following lines to the \u003ccode\u003euser-data\u003c/code\u003e file:\u003c/p\u003e\n\u003cdiv class=\"highlight\"\u003e\u003cpre tabindex=\"0\" class=\"chroma\"\u003e\u003ccode class=\"language-yaml\" data-lang=\"yaml\"\u003e\u003cspan class=\"line\"\u003e\u003cspan class=\"cl\"\u003e\u003cspan class=\"nt\"\u003ehostname\u003c/span\u003e\u003cspan class=\"p\"\u003e:\u003c/span\u003e\u003cspan class=\"w\"\u003e \u003c/span\u003e\u003cspan class=\"l\"\u003eberryos.userctl.xyz      \u003c/span\u003e\u003cspan class=\"w\"\u003e \u003c/span\u003e\u003cspan class=\"c\"\u003e# Set system hostname\u003c/span\u003e\u003cspan class=\"w\"\u003e\n\u003c/span\u003e\u003c/span\u003e\u003c/span\u003e\u003cspan class=\"line\"\u003e\u003cspan class=\"cl\"\u003e\u003cspan class=\"w\"\u003e\u003c/span\u003e\u003cspan class=\"nt\"\u003emanage_etc_hosts\u003c/span\u003e\u003cspan class=\"p\"\u003e:\u003c/span\u003e\u003cspan class=\"w\"\u003e \u003c/span\u003e\u003cspan class=\"kc\"\u003etrue\u003c/span\u003e\u003cspan class=\"w\"\u003e              \u003c/span\u003e\u003cspan class=\"c\"\u003e# Update /etc/hosts with the new hostname\u003c/span\u003e\u003cspan class=\"w\"\u003e\n\u003c/span\u003e\u003c/span\u003e\u003c/span\u003e\u003cspan class=\"line\"\u003e\u003cspan class=\"cl\"\u003e\u003cspan class=\"w\"\u003e\n\u003c/span\u003e\u003c/span\u003e\u003c/span\u003e\u003cspan class=\"line\"\u003e\u003cspan class=\"cl\"\u003e\u003cspan class=\"w\"\u003e\u003c/span\u003e\u003cspan class=\"nt\"\u003epassword\u003c/span\u003e\u003cspan class=\"p\"\u003e:\u003c/span\u003e\u003cspan class=\"w\"\u003e \u003c/span\u003e\u003cspan class=\"l\"\u003eberryos                  \u003c/span\u003e\u003cspan class=\"w\"\u003e \u003c/span\u003e\u003cspan class=\"c\"\u003e# Set default user password\u003c/span\u003e\u003cspan class=\"w\"\u003e\n\u003c/span\u003e\u003c/span\u003e\u003c/span\u003e\u003cspan class=\"line\"\u003e\u003cspan class=\"cl\"\u003e\u003cspan class=\"w\"\u003e\u003c/span\u003e\u003cspan class=\"nt\"\u003echpasswd\u003c/span\u003e\u003cspan class=\"p\"\u003e:\u003c/span\u003e\u003cspan class=\"w\"\u003e \u003c/span\u003e{\u003cspan class=\"w\"\u003e \u003c/span\u003e\u003cspan class=\"nt\"\u003eexpire\u003c/span\u003e\u003cspan class=\"p\"\u003e:\u003c/span\u003e\u003cspan class=\"w\"\u003e \u003c/span\u003e\u003cspan class=\"kc\"\u003efalse\u003c/span\u003e\u003cspan class=\"w\"\u003e \u003c/span\u003e}\u003cspan class=\"w\"\u003e         \u003c/span\u003e\u003cspan class=\"c\"\u003e# Do not expire password after first login\u003c/span\u003e\u003cspan class=\"w\"\u003e\n\u003c/span\u003e\u003c/span\u003e\u003c/span\u003e\u003cspan class=\"line\"\u003e\u003cspan class=\"cl\"\u003e\u003cspan class=\"w\"\u003e\u003c/span\u003e\u003cspan class=\"nt\"\u003essh_pwauth\u003c/span\u003e\u003cspan class=\"p\"\u003e:\u003c/span\u003e\u003cspan class=\"w\"\u003e \u003c/span\u003e\u003cspan class=\"kc\"\u003etrue\u003c/span\u003e\u003cspan class=\"w\"\u003e                    \u003c/span\u003e\u003cspan class=\"c\"\u003e# Enable SSH password authentication for default user\u003c/span\u003e\u003cspan class=\"w\"\u003e\n\u003c/span\u003e\u003c/span\u003e\u003c/span\u003e\u003c/code\u003e\u003c/pre\u003e\u003c/div\u003e\u003cp\u003eThe \u003ccode\u003epassword\u003c/code\u003e field can either be a plaintext password or a hashed version of it. On *NIX system, a password can be hashed using the \u003ccode\u003eopenssl passwd -6\u003c/code\u003e command. The file would end up looking like:\u003c/p\u003e\n\u003cdiv class=\"highlight\"\u003e\u003cpre tabindex=\"0\" class=\"chroma\"\u003e\u003ccode class=\"language-yaml\" data-lang=\"yaml\"\u003e\u003cspan class=\"line\"\u003e\u003cspan class=\"cl\"\u003e\u003cspan class=\"nt\"\u003epassword\u003c/span\u003e\u003cspan class=\"p\"\u003e:\u003c/span\u003e\u003cspan class=\"w\"\u003e \u003c/span\u003e\u003cspan class=\"l\"\u003e$6$kEE0sV/2tz/jWBtQ$tRpM0XqKhl3xEroj837u6VCQadIoSL......nSY48unRmtsZv0\u003c/span\u003e\u003cspan class=\"w\"\u003e\n\u003c/span\u003e\u003c/span\u003e\u003c/span\u003e\u003cspan class=\"line\"\u003e\u003cspan class=\"cl\"\u003e\u003cspan class=\"w\"\u003e\u003c/span\u003e\u003cspan class=\"nt\"\u003echpasswd\u003c/span\u003e\u003cspan class=\"p\"\u003e:\u003c/span\u003e\u003cspan class=\"w\"\u003e \u003c/span\u003e{\u003cspan class=\"w\"\u003e \u003c/span\u003e\u003cspan class=\"nt\"\u003eexpire\u003c/span\u003e\u003cspan class=\"p\"\u003e:\u003c/span\u003e\u003cspan class=\"w\"\u003e \u003c/span\u003e\u003cspan class=\"kc\"\u003efalse\u003c/span\u003e\u003cspan class=\"w\"\u003e \u003c/span\u003e}\u003cspan class=\"w\"\u003e         \u003c/span\u003e\u003cspan class=\"c\"\u003e# Do not expire password after first login\u003c/span\u003e\u003cspan class=\"w\"\u003e\n\u003c/span\u003e\u003c/span\u003e\u003c/span\u003e\u003cspan class=\"line\"\u003e\u003cspan class=\"cl\"\u003e\u003cspan class=\"w\"\u003e\u003c/span\u003e\u003cspan class=\"nt\"\u003essh_pwauth\u003c/span\u003e\u003cspan class=\"p\"\u003e:\u003c/span\u003e\u003cspan class=\"w\"\u003e \u003c/span\u003e\u003cspan class=\"kc\"\u003etrue\u003c/span\u003e\u003cspan class=\"w\"\u003e                    \u003c/span\u003e\u003cspan class=\"c\"\u003e# Enable SSH password authentication\u003c/span\u003e\u003cspan class=\"w\"\u003e\n\u003c/span\u003e\u003c/span\u003e\u003c/span\u003e\u003c/code\u003e\u003c/pre\u003e\u003c/div\u003e\u003cp\u003eIf you wish to assign a static IP to your Raspberry Pi, you should also edit the \u003ca href=\"https://github.com/0rax/BerryOS/blob/main/rootfs/boot/network-config\" target=\"_blank\" rel=\"noopener\"\u003e\u003ccode\u003enetwork-config\u003c/code\u003e\u003c/a\u003e file. For example, to assign the \u003ccode\u003e192.168.1.128\u003c/code\u003e IP to your Pi with a \u003ccode\u003e/24\u003c/code\u003e netmask (equivalent to \u003ccode\u003e255.255.255.0\u003c/code\u003e) and \u003ccode\u003e192.168.1.1\u003c/code\u003e as gateway, you should update the file to look like this.\u003c/p\u003e\n\u003cdiv class=\"highlight\"\u003e\u003cpre tabindex=\"0\" class=\"chroma\"\u003e\u003ccode class=\"language-yaml\" data-lang=\"yaml\"\u003e\u003cspan class=\"line\"\u003e\u003cspan class=\"cl\"\u003e\u003cspan class=\"nt\"\u003eversion\u003c/span\u003e\u003cspan class=\"p\"\u003e:\u003c/span\u003e\u003cspan class=\"w\"\u003e \u003c/span\u003e\u003cspan class=\"m\"\u003e2\u003c/span\u003e\u003cspan class=\"w\"\u003e\n\u003c/span\u003e\u003c/span\u003e\u003c/span\u003e\u003cspan class=\"line\"\u003e\u003cspan class=\"cl\"\u003e\u003cspan class=\"w\"\u003e\u003c/span\u003e\u003cspan class=\"nt\"\u003eethernets\u003c/span\u003e\u003cspan class=\"p\"\u003e:\u003c/span\u003e\u003cspan class=\"w\"\u003e\n\u003c/span\u003e\u003c/span\u003e\u003c/span\u003e\u003cspan class=\"line\"\u003e\u003cspan class=\"cl\"\u003e\u003cspan class=\"w\"\u003e  \u003c/span\u003e\u003cspan class=\"nt\"\u003eeth0\u003c/span\u003e\u003cspan class=\"p\"\u003e:\u003c/span\u003e\u003cspan class=\"w\"\u003e\n\u003c/span\u003e\u003c/span\u003e\u003c/span\u003e\u003cspan class=\"line\"\u003e\u003cspan class=\"cl\"\u003e\u003cspan class=\"w\"\u003e    \u003c/span\u003e\u003cspan class=\"nt\"\u003edhcp4\u003c/span\u003e\u003cspan class=\"p\"\u003e:\u003c/span\u003e\u003cspan class=\"w\"\u003e \u003c/span\u003e\u003cspan class=\"kc\"\u003efalse\u003c/span\u003e\u003cspan class=\"w\"\u003e\n\u003c/span\u003e\u003c/span\u003e\u003c/span\u003e\u003cspan class=\"line\"\u003e\u003cspan class=\"cl\"\u003e\u003cspan class=\"w\"\u003e    \u003c/span\u003e\u003cspan class=\"nt\"\u003eaddresses\u003c/span\u003e\u003cspan class=\"p\"\u003e:\u003c/span\u003e\u003cspan class=\"w\"\u003e\n\u003c/span\u003e\u003c/span\u003e\u003c/span\u003e\u003cspan class=\"line\"\u003e\u003cspan class=\"cl\"\u003e\u003cspan class=\"w\"\u003e      \u003c/span\u003e- \u003cspan class=\"m\"\u003e192.168.1.128\u003c/span\u003e\u003cspan class=\"l\"\u003e/24\u003c/span\u003e\u003cspan class=\"w\"\u003e\n\u003c/span\u003e\u003c/span\u003e\u003c/span\u003e\u003cspan class=\"line\"\u003e\u003cspan class=\"cl\"\u003e\u003cspan class=\"w\"\u003e    \u003c/span\u003e\u003cspan class=\"nt\"\u003eroutes\u003c/span\u003e\u003cspan class=\"p\"\u003e:\u003c/span\u003e\u003cspan class=\"w\"\u003e\n\u003c/span\u003e\u003c/span\u003e\u003c/span\u003e\u003cspan class=\"line\"\u003e\u003cspan class=\"cl\"\u003e\u003cspan class=\"w\"\u003e      \u003c/span\u003e- \u003cspan class=\"nt\"\u003eto\u003c/span\u003e\u003cspan class=\"p\"\u003e:\u003c/span\u003e\u003cspan class=\"w\"\u003e \u003c/span\u003e\u003cspan class=\"m\"\u003e0.0.0.0\u003c/span\u003e\u003cspan class=\"l\"\u003e/0\u003c/span\u003e\u003cspan class=\"w\"\u003e\n\u003c/span\u003e\u003c/span\u003e\u003c/span\u003e\u003cspan class=\"line\"\u003e\u003cspan class=\"cl\"\u003e\u003cspan class=\"w\"\u003e        \u003c/span\u003e\u003cspan class=\"nt\"\u003evia\u003c/span\u003e\u003cspan class=\"p\"\u003e:\u003c/span\u003e\u003cspan class=\"w\"\u003e \u003c/span\u003e\u003cspan class=\"m\"\u003e192.168.1.1\u003c/span\u003e\u003cspan class=\"w\"\u003e\n\u003c/span\u003e\u003c/span\u003e\u003c/span\u003e\u003c/code\u003e\u003c/pre\u003e\u003c/div\u003e\u003cp\u003eSave your modifications, un-mount your SD card and insert it in your Raspberry Pi. Connect you Ethernet cable and power supply, and after some time you should be able to access it using \u003ccode\u003essh pi@$ip\u003c/code\u003e.\u003c/p\u003e\n\u003cp\u003eAs \u003ccode\u003eavahi-daemon\u003c/code\u003e IS NOT installed by default, you will not be able to use the Pi hostname to connect to it. If you haven\u0026rsquo;t given it a static IP, you will need to find it another way. The easiest solution is to plug a screen to it as BerryOS prints the system IPs on each TTY by default (you might need to switch to TTY2 to get a clean reading by using \u003ccode\u003eAlt + Right\u003c/code\u003e). Another solution is to check your router\u0026rsquo;s DHCP assignation table.\u003c/p\u003e\n\u003cblockquote\u003e\n\u003cp\u003e\u003cstrong\u003eNote\u003c/strong\u003e\u003c/p\u003e\n\u003cp\u003eIf you require Wi-Fi connectivity, you should check out the \u003ca href=\"https://berryos.wiki/docs/config/network/\" target=\"_blank\" rel=\"noopener\"\u003eNetwork Configuration guide\u003c/a\u003e in the BerryOS Wiki to set it up properly.\u003c/p\u003e\n\u003c/blockquote\u003e\n\u003cp\u003eCongratulation, you can now enjoy BerryOS to its full extent!\u003c/p\u003e\n\u003ch2 id=\"the-future-of-berryos\"\u003eThe future of BerryOS\u003c/h2\u003e\n\u003cp\u003eBerryOS is the operating system I with I had for quite some years now, thus I intend to support and keep it up to date with mainstream Raspberry Pi OS for the foreseeable future.\u003c/p\u003e\n\u003cp\u003eHaving a lightweight alternative to the default operating system for your Raspberry Pi is the real goal here, something than can be used by anyone that just want to tinker a bit more with their hardware and have more control over its software. I do not want to create a complete new ecosystem but keep it as close and compatible with RaspiOS as possible without adding unnecessary software or removing capabilities.\u003c/p\u003e\n\u003cp\u003eThe clear next step for the project now is to expand its documentation and add more example of how \u003ccode\u003ecloud-init\u003c/code\u003e can be used. Those Cloud Config files are great to share setups with each other and having great resources built around this possibility should be what we aspire to.\u003c/p\u003e\n\u003cp\u003eIf this is something that you find interesting, come check it out, or even get involved with the project on \u003ca href=\"https://github.com/0rax/BerryOS\" target=\"_blank\" rel=\"noopener\"\u003eGitHub\u003c/a\u003e.\u003c/p\u003e\n","tags":["linux","raspberrypi","berryos"]}]}