Skip to content

Instantly share code, notes, and snippets.

@rockavoldy
Last active September 8, 2023 14:47
Note Raspberry Pi Zero W

Some note (and maybe cheatsheet) for Pi Zero W

Enable SSH Access over USB Pi Zero W

  1. Create new file called ssh in boot partition
  2. Open config.txt file in boot partition, and add this to the bottom of the line
    dtoverlay=dwc2
    
  3. Open cmdline.txt file in boot partition, and add modules-load=dwc,g_ether to after to the end of the line and make sure there is space to separate the option

Make raspi automatically connect to Hotspot on boot

  1. Create file named wpa_supplicant.conf inside boot partition
  2. Fill the file with config below, Change SSID and password to your local Access Point credentials
    country=ID
    update_config=1
    ctrl_interface=/var/run/wpa_supplicant
    
    network={
     scan_ssid=1
     ssid="Silence of the LAN"
     psk="snow white and seven dwarfs"
    }
    

Disable WiFi and Bluetooth

If you're in the newer Raspi OS, just add them to the config.txt

dtoverlay=disable-wifi
dtoverlay=disable-bt

If you're on the older Raspbian, it's the correct dtoverlay

dtoverlay=pi3-disable-wifi
dtoverlay=pi3-disable-bt

Source

Disable password needed for your user (DWYOR)

Change below username(akhmad) with yours (or pi, if you know what you're doing)

sudo cp /etc/sudoers ~/sudoers.bak
sudo su - root -c 'echo "akhmad ALL=(ALL) NOPASSWD:ALL" >> /etc/sudoers'

Source

Resources about picam

Compile linux kernel for Raspi Zero W

moved to linux-kernel-cross-compile

About raspicam

I have tried to make my Arducam 16MP Autofocus works with showmewebcam/showmewebcam, but i can't. Basically unicam is not supported by uvc-gadget, and as long as i search, there is no implementation to make unicam works with uvc-gadget, and can't find any hacks or workaround. It's supported now!

Then i found this repo that pipe from tensorflow to uvc-gadget, it seems i can pipe from libcamera-vid like from this gist or this tutorial from arducam to v4l2loopback. But now, the issue is i can't test it on my pi0w because when i try to use libcamera-vid, or libcamera-raw, it somehow got kernel panic like in this issue reported here. I can manage to run libcamera-vid without kernel panic again with raspios-buster, and install the pivariety without updating the kernel, then stream to tcp port, it's works, but the delay is too much (around 2 or 3 seconds maybe), haven't tried with ffmpeg and v4l2loopback though, will update it later when i try it, but my goal for now with this arducam and raspi zero is to create timelapse device for astrophotography.

So, for now, will wait for that kernel panic issue fixed before comeback to test it again (or maybe someone implement new stack to uvc-gadget, or i got newer and more powerful raspi like pi4 to test hehe)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment