The included microSD card with a Raspberry Pi 500+ is 32GB. You can get a larger official microSD card, or a third-party one, preferably one of these top picks. There are also alternative boot options. Here, we will flash a drive using Raspberry Pi Imager.
- Download and install Raspberry Pi Imager on another computer.
- Insert a microSD card, using an adapter if necessary.
- Run Raspberry Pi Imager.
- Under "Raspberry Pi Device", select "Select device" and select "Raspberry Pi 5".
- Under "Operating system", select "Choose OS" and select "Raspberry Pi OS (64-bit)" or an alterative, e.g. "Recalbox" in the "Emulation and game OS" submenu.
- Under "Storage", select "Choose storage" and select, e.g. "SDHC Card 31.7 GB, Mounted as D:".
- You have a few choices when prompted with, "Would you like to apply OS and customization settings". If you're frequently flashing drives using Raspberry Pi Imager, this menu allows you to save and reuse common configurations whenver you flash, like the Raspberry Pi's hostname, username/password, wireless network SSID/password, and configure SSH (remote access). See OS customization settings for more details, but here we will follow a specific process.
- Select "Edit settings" when prompted "Would you like to apply OS and customization settings". Any unticked boxes in this menu after clicking "Save" will not be applied to the resulting OS image.
- Tick the boxes for "Set username and password" and "Configure wireless LAN" in the "General" tab, entering your desired username/password and SSID/password, respectively. Also enter "US" for wireless LAN country.
- Tick the box for "Set locale settings", set the time zone to "US/Pacific", and set the Keyboard layout to "us".
- Select the "Options" tab and untick the box "Enable telemetry".
- Select the "Services" tab, then tick the box to "Enable SSH" and select "Allow public-key authentication only".
- Make sure OpenSSH is installed if on Windows.
- Open a PowerShell terminal window and run
ssh-keygen -t ed25519 - When prompted to "enter a file in which to save the key", press "Enter" to use the default.
- When prompted to enter a passphrase, do so. It is not recommended to leave the passphrase blank.
- Enter
ssh-add, then enter the passphrase. "Identity added" will be reported if done correctly. - IMPORTANT: Run
Remove-Item '~/.ssh/id_ed25519'to delete the private key. - Update the clipboard with the public key by running
Get-Content '~/.ssh/id_ed25519.pub' | Set-Clipboard - Navigate back to the Raspberry Pi Imager and paste (Ctrl+V) the public key in the "Set authorized_keys for...' field (Note: You don't need to click "Add SSH Key" unless you want to add another key).
- Click "Save" at the bottom of the dialog.
- Back at "Would you like to apply OS and customization settings", click "Yes" to apply these customizations to the image we're about to flash.
- Click "Yes" if prompted with "All existing data on 'SDHC Card' will be erased".
- Raspberry Pi Imager will flash the microSD card (it will take awhile), and eject the card after it's finished.
- Insert the card into your Raspberry Pi and plug it in or turn it on for first boot.
It is also possible to enable USB boot and boot from an external SSD and enclosure, which needs a power supply supporting USB-PD "Power Delivery". THe official 27W power supply supports this, but sometimes fails to enable this mode and may need to be unplugged and plugged back in if you are warned "USB boot requires a high current (5V 5A) power supply."
With a standalone Raspberry Pi 5 or the Raspberry Pi 500+ keyboard-computer, but not the Raspberry Pi 500 keyboard-computer, an NVMe boot drive can be inserted into an onboard M.2 slot.
If on Windows, check for or install OpenSSH as follows.
- Navigate to optional features in Windows Settings.
- Search for "OpenSSH Clent" under the "Added features" section. If it's there, you're all set.
- If it's not, select "View features" next to "Add an optional feature" at the top, search for "OpenSSH Client", tick the box for "OpenSSH Client", click "Next", then click "Add"
- Search for PowerShell in the Start menu, right-click and select "Run as administrator", and run
Get-Service 'ssh-agent' | Set-Service -StartupType 'Automatic'; Start-Service 'ssh-agent'
- Distrobox
- Run
sudo apt install distrobox - Podman is needed, but for some reason, we didn't need to run
sudo apt install podmanon Raspberry Pi. - Set up a desktop environment in Distrobox
- Run
- Raspberry Pi Connect: Allows remote access but screen is always grey. Terminal access is fine.
- VSCode Tunnel
- Install VSCode
- Run
code tunnel service installto run a tunnel on startup - If using a Raspberry Pi to tunnel into other machines, configure the keychain in VSCode launch options
- Boot your Raspberry Pi on your local network, either via WiFi or directly connected to your router via an Ethernet cable.
- On the computer you ran Raspberry Pi Imager on and configured SSH for, open a terminal windowand run
ssh user@hostname.local, whereuseris the username andhostname.localis the hostname (with.localprefix added for you) when you flashed the drive in Raspberry Pi Imager. - When prompted "The authenticity of host ... can't be established", enter "yes"
MicroSD cards can fail, so you may want to use RPi Clone to clone an existing Raspberry Pi installation to a standalone backup microSD or drive. You can also use gparted to manually create a backup from a currently running Raspberry Pi OS as below, but using RPi Clone is strongly recommended.
Plug in a flash drive. Click on the start menu, navigate to Accessories, then SD Card Copier. For Copy From Device, choose GC1S5 (/dev/mmcblk0). For Copy To Device, choose /dev/sda. Be sure to tick the box for New Partition UUIDs. Then click Start. Once that is complete, install gparted.
sudo apt install gpartedClick on the start menu, navigate to System Tools, then GParted. Select /dev/sda. Then right-click on the rootfs partition, click Resize/Move, and shrink it to the minimum possible size. Run fdisk to find out the Sector size, which will be used later as <BLOCK SIZE> in the dd command.
$ sudo fdisk -l /dev/mmcblk0
Disk /dev/mmcblk0: 59.7 GiB, 64088965120 bytes, 125173760 sectors
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disklabel type: dos
Disk identifier: 0xbdba5d04Using gparted, format the remaining unallocated space in the same flash drive as NTFS. Unplug and replug the flash drive to trigger mounting. Note the Mount Point of the NTFS partition, which will be used later as the <MOUNT POINT> in the dd command. Right-click on the NTFS partition, then click Information, and note the First sector, which will be used later as <COUNT> in the dd command.
Finally, use dd to copy /dev/sda to <MOUNT POINT>, where <BS> is the block size found from fdisk (512), and <COUNT> is found from the first sector of the NTFS partition. This ensures that dd stops before entering the NTFS partition.
dd if=/dev/sda of=<MOUNT POINT>/pi.img bs=<BS> count=<COUNT>See setup for a Raspberry Pi image.
Connect to WiFi. In bash, run sudo apt update, then sudo apt full-upgrade. Next, run mousepad /etc/dhcpcd.conf or similar to view the networking configuration file. Find the lines that look similar to below, uncomment them, and input proper addresses. Use eth0 to set a static IP for wired connection, and wlan0 for wireless.
# Example static IP configuration:
interface wlan0
static ip_address=192.168.X.XX/24
static ip6_address=XXXX:XXXX:XXXX:XXXX::ff/64
static routers=192.168.X.1
static domain_name_servers=192.168.X.1 8.8.8.8 XXXX:XXXX:XXXX:XXXX::1Then add the SSH location to VSCode. If you have accessed multiple Raspberry Pis from the same IP address, SSH will fail unless you clear the entry in %USERPROFILE%\.ssh\known_hosts corresponding to the IP address you wish to access a newly set up device from. You can have multiple entries for the same IP address, with different recognized devices, but VSCode won't ever automatically add a second device on an IP address that it has already seen another device on.
From this source, we can do the following instead:
sudo apt-get install -y build-essential tk-dev libncurses5-dev libncursesw5-dev libreadline6-dev libdb5.3-dev libgdbm-dev libsqlite3-dev libssl-dev libbz2-dev libexpat1-dev liblzma-dev zlib1g-dev libffi-dev tar wget vimwget https://www.python.org/ftp/python/3.<X>.<Y>/Python-3.<X>.<Y>.tgzsudo tar zxf Python-3.<X>.<Y>.tgz
cd Python-3.<X>.<Y>
sudo ./configure --enable-optimizations
sudo make -j 4
sudo make altinstall/etc/xdg/openbox/lxde-pi-rc.xml
Strangely, applications are only considered "installed" if they are visible in the start menu via the "Main Menu Editor". The right-click context menu and other parts of the OS that list your "Applications" will only list those that are visible in the start menu. This means that you have to clutter your start menu with tools that are mostly executed with a file target, but are uselessly called bare from the start menu. I haven't found a way around this.
The "panel" is the taskbar/start menu. For example, the Start menu is a menu widget in the panel given the address start-here. But creating it manually makes an ugly menu that's not configured like the default one. If you delete the start menu, or mess up the panel in some other way, follow the guide found here. For a Raspberry Pi 4 Model B running Raspbian Buster, do the following:
sudo cp /etc/xdg/lxpanel/LXDE-pi/panels/panel /home/pi/.config/lxpanel/LXDE-pi/panels/panel
sudo rebootThe "Performance" tab of the "Raspberry Pi Configuration" application has a "Fan" option that seems to be temperature-sensitive. This does not work, however. I verified this by manually powering the same GPIO pin indicated by the menu. The fan turns on only when it is manually powered. There is a little whine when the temperature threshold is reached, so I think there must be some messed up logic in the built-in fan control.
/sys/class/backlight/rpi_backlight
Short GPIO3 to ground to wake.
WAKE_ON_GPIO
https://www.raspberrypi.org/documentation/hardware/raspberrypi/bcm2711_bootloader_config.md
Could use a TinyPICO to remotely pull the pin low. https://www.tinypico.com/
Or Femto’s ESP32 ModUle (FEMU) https://www.crowdsupply.com/femto/femu
Global (all user) menu items are defined in /usr/share/applications. These *.desktop files are INI-like files that specify the name of the option in the Start Menu, what command it performs, its icon, etc. Pay attention to the "categories" of built-in icons to map to the Start Menu category entries (their names differ). Per user menu items are defined in ~/.local/share/applications.
[Desktop Entry]
Type=Application
Name=Kivy Test
Icon=/home/pi/.kivy/icon/kivy-icon-128.png
Exec=bash
Exec=/home/pi/kivy-test/.venv/bin/python /home/pi/kivy-test/main.py
Categories=Utility;https://www.raspberrypi.org/documentation/hardware/raspberrypi/bcm2711_bootloader_config.md
wake_on_gpio is set by default.
Add dtoverlay=gpio-shutdown to /boot/config.txt.
There are many boards that implement the ESP8266 microcontroller. Standouts are the NodeMCU DEVKIT, Adafruit's Feather HUZZAH ESP8266 breakout, and the ACROBOTIC ESP8266 ESP-12E. All of these have a 2x15 DIP/DIL form factor (dual in-line, dual in-line package). These boards seem to implement the ESP-12E modules. The Adafruit HUZZAH 8266 breakout (not the Feather) is a slightly different implementation, that of the "ESP-12F" module instead.
NodeMCU has an open-source board specification, and thus has many clones. Their documentation, like this or this is thorough, but overwhelming. It details hardware and software. The ACROBOTIC board mentioned earlier has an informative and good-looking pinout. It looks so good, in fact, that this particular pinout image appears on most other no-name Amazon clones.
The successor to the ESP8266 implementations discussed above is the https://en.wikipedia.org/wiki/ESP32. Maybe I should seek out a board under this umbrella for better future-proofing and more active development.
Whatever I choose, I will probably use MicroPython documentation to accomplish my goal of remote power-on of the Raspberry Pi.
Install gparted. Plug in two flash drives. Format Flash Drive #2 as FAT32. Use the SD card copier to copy the SD card to Flash Drive #1. Shrink the rootfs partition with gparted. Use Info in gparted to find the last sector of the rootfs partition now that it has been shrunk. Then, use dd as follows:
dd if=/dev/sda of=<MOUNT POINT>/pi.img bs=<BS> count=<COUNT>where sda is Flash Drive #1, <MOUNT POINT> is the mount point of Flash Drive #2, <BS> is probably 512 or 1M (check with fdisk -l -u=sectors /dev/sdc), and <COUNT> is whatever the last sector of rootfs is plus one. The final pi.img file can be saved in the cloud or flashed onto an SD card using the Raspberry Pi Imager on Windows.
The OS that is recovered by flashing the image will be just as you left it. You should be able to sudo raspi-config --expand-rootfs to expand the root filesystem to fill the whole SD card.