Wednesday, April 05, 2023

raspberry pi setup redux

Setting up a Raspberry Pi 4 as an Icecast player with a local video playing on the screen, notes below:

  • Interesting idea for chromium tabs for display, but we have not used it, https://blog.gordonturner.com/2019/07/23/raspberry-pi-switch-chromium-browser-tabs/

  • Remmina refuses to connect to realvnc server on pi - simplest solution was to install realvnc client.

  • Unfortunately, high CPU usage with VLC playing the local video file. Tried 64 bit Raspberry Pi OS, 32 bit Raspberry Pi OS, finally got good results with 32 bit "Legacy" Raspbian Buster and omxplayer. With omxplayer, CPU usage is only 5% or less. With VLC, either VLC (in 64 bit) or Xorg (in 32 bit) uses 100%. Unfortunately, omxplayer has been removed from newer versions of Raspberry Pi OS. Maybe we can use vlc later after exploring various output device options, but as of now,
    runStreamAndVideo.sh has

    mpg123 http://stream.radiosai.org:8000 &
    #cvlc "sssmc-prconn.mp4" --fullscreen
    omxplayer -o local --loop /home/pi/sssmc-prconn_360p.mp4


  • For setting up wifi after fresh installs, the easiest option was to ssh into the device using an ethernet cable nearby, and use
    sudo raspi-config
    System -> Wireless LAN
    The method of using a wpa_supplicant.conf file created in /boot seems to work only if
    (a) the country is already set
    (b) the conf file has Unix style line endings.
    The following sudo nano /boot/wpa_supplicant.conf worked once for me, didn't work for a fresh install -
    country=IN  #omit if US
    ctrl_interface=DIR=/var/run/wpa_supplicant GROUP=netdev
    update_config=1
    network={
        ssid="Our-SSID"
        psk="Our-Password"
    }

  • Used our old technique of creating a .desktop file in .config/autostart directory + enabling auto login to GUI + wait for network to boot (wait for network is needed, because otherwise mpg123 doesn't play.)

  • sudo apt install realvnc-vnc-server
    to install VNC server, and
    sudo raspi-config
    Interface options -> VNC to enable the service at boot.

  • We can control the volume easily with ssh, with the alsamixer command, up arrow and down arrow.

  • Default audio device is analog out. To change to HDMI, a HDMI monitor needs to be connected, then we can use
    sudo raspi-config
    System -> Audio
    (or using VNC, right-clicking on the volume applet on top right corner)

  • Instead of using our earlier method of an IR remote control to shut down the machine, we're using RaspController android app instead.
    (The device drivers have changed yet again from our earlier method.
    sudo modprobe lirc_rpi
    was replaced by
    sudo modprobe gpio_ir
    and now, with Raspbian Buster, it is
    sudo modprobe gpio_ir_recv )

  • We can set the hostname of the Raspberry pi using
    sudo raspi-config
    System -> Hostname
    and we're supposed to be able to reach it using hostname.local on the local network for "devices which support mDNS" or Avahi. On the pi,
    sudo apt-get install avahi-daemon
    sudo apt-get install avahi-utils


    But avahi-browse -a -d local didn't seem to work. Probably some syntax issue.

    Also, the hostname.local didn't seem to work out of the box for some Android devices. So, set up a static ip by moving up the DHCP pool to a more restricted set on the router, and setting up the static ip by right-clicking on the wifi icon using VNC,
    Wireless and Wired networking settings ->
    Configure -> SSID (choose our SSID)
    or Configure -> interface (choose wlan0)
    and set the required IP address etc. by unchecking the "Automatic" box.



No comments:

Post a Comment