Raspbian buster

From CMEE4K
Jump to navigation Jump to search

Raspberry Pi OS full update (May 2020)

New version of Raspberry Pi OS wass released on May 28, 2020. Follows are before upgrade

$ cat /etc/os-release
PRETTY_NAME="Raspbian GNU/Linux 10 (buster)"
NAME="Raspbian GNU/Linux"
VERSION_ID="10"
VERSION="10 (buster)"
VERSION_CODENAME=buster
ID=raspbian
ID_LIKE=debian
HOME_URL="http://www.raspbian.org/"
SUPPORT_URL="http://www.raspbian.org/RaspbianForums"
BUG_REPORT_URL="http://www.raspbian.org/RaspbianBugs"

Update OS

  • sudo apt update
  • sudo apt full-upgrade
  • MagicMirror has problem with the new OS, stop it before reboot.
    • pm2 stop mm
    • pm2 save
  • sudo reboot

Check upgrade

  • The /etc/os-release file does not change.
  • Previous OS
    • Menu > Help > The MagPi
    • uname -a: Linux raspberrypi 4.19.97-v7l+ #1294 SMP Thu Jan 30 13:21:14 GMT 2020 armv7l GNU/Linux
  • New OS
    • Menu > Help > Bookshelf
    • uname -a: Linux raspberrypi 4.19.118-v7l+ #1311 SMP Mon Apr 27 14:26:42 BST 2020 armv7l GNU/Linux


Upgrade MagicMirror2 for the new Raspberry Pi OS

Raspbian buster OS (Feb 2020)

The latest raspbian buster was released on 2020-Feb-13.

Capture some raspbian commands

  • sudo apt-get update || sudo apt update
  • sudo apt-get upgrade || sudo apt upgrade
  • sudo raspi-config > interface > enable Pi camera
  • sudo reboot which enables the change after reboot

After reboot

Camera

  • raspistill -o xxx.jpg captures still phone in file
  • raspivid -o xxx.h264 captures 5 second video clip in file
    • raspivid -o xxx.h264 -t 3000 captures 3 second video clip in file
  • omxplayer xxx.h264 to play the record video

Or, use Windows' Power Media Player (from CyberLink) to watch that h264 file.

Use Python code

Preview

from picamera import PiCamera
from time import sleep
camera = PiCamera()
camera.start_preview()
sleep(10)
camera.stop_preview()

Capture Picture

from picamera import PiCamera
from time import sleep
camera = PiCamera()
camera.start_preview()
sleep(5)
camera.capture('/home/pi/Desktop/image.jpg')
camera.stop_preview()

Capture Video

from picamera import PiCamera
from time import sleep
camera = PiCamera()
camera.start_preview()
camera.start_recording('/home/pi/video.h264')
sleep(10)
camera.stop_recording()
camera.stop_preview()

USB Mini Microphone

After install USB Mini Microphone Use USB mini microphone on Raspbian, and Use USB Microphone with Raspberry PI and Raspbian Buster Lite

  • lsusb
    • C-Media Electronics, Inc. CM108 Audio Controller is not listed.
    • My USB Mini Microphone shows Bus 001 Device 003: ID 8086:0808 Intel Corp.
  • arecord -l shows the following
**** List of CAPTURE Hardware Devices ****
card 1: Device [USB PnP Sound Device], device 0: USB Audio [USB Audio]
  Subdevices: 1/1
  Sundevice #0: subdevice #0
  • arecord -D plughw:1,0 -d 3 test.wav <-- We see device card1, device0. Use plughw:1,0 to represent it.
  • aplay test.wav

My RPi 4: The Audio input is not set to USB PnP Sound Device, change it as follows,

  • Right click to Audio icon > Audio Inputs > Select USB PnP Sound Device
  • Also select Input Device setting ..., and change the Capture Enable, and Mic volumn.

Adjust the gain of the microphone

  • In the latest Raspbian, Audio Device Settings is not in Preferences
  • alsamixer <-- Alsamixer helps us with a simple interface to manage audio devices volumes.

Set Play sound on HDMI

RPi Audio Configuration
Use one of the following, or all.

  1. Right click to Audio icon > Audio Outputs > Select HDMI
  2. amixer cset numid=3 2 <-- 2 is HDMI, 1 is headphone jack
  3. sudo raspi-config > Advanced Options > Audio > Select HDMI
  4. sudo vi /boot/config.txt
    • Find and change line: hdmi_drive=2 <-- force HDMI mode (from DVI mode)
    • Reboot

My RPi 4: I can play sound on HDMI monitor, but after did some testing, Rpi did not play sound on HDMI monitor.
I try all techniques until I changed the /boot/config.txt file and reboot, then HDMI can play sound.

Set Fix IP address

From Mac, run Angry IP Scanner to scan which IP(s) are in-use. Then, do the following in RPi.

  • sudo vi /etc/dhcpcd.conf file
    • Find either eth0 or wlan0
    • Change or add the following lines
    • No netmask and No broadcast
interface wlan0
static ip_address=47.235.11.240/24
static routers=47.235.11.1
static domain_name_servers=47.235.11.1

Then, reboot.

Appendix

Try to install Zoom-client from snap

It reports zoom client is not ready for this CPU.
TODO: Put install zoom-client URL here.

Reference