RaspberryPi4B: Difference between revisions

From Wiki RB4
Line 125: Line 125:
* login via cmd line  
* login via cmd line  
  ssh uwe@uweheuer.spdns.de -p 54445 <Lr><STANDARD><Lr>
  ssh uwe@uweheuer.spdns.de -p 54445 <Lr><STANDARD><Lr>
===VNC (Remote Desktop)===
* update raspberry
** <code>sudo apt update</code>
** <code>sudo apt upgrade -y</code>
* reinstall VNC
**<code>sudo apt install realvnc-vnc-server realvnc-vnc-viewer -y</code>
* enable VNC via
**<code>raspi-config -> interfaces</code>


==Configuration==
==Configuration==

Revision as of 21:05, 17 August 2025

Type Information

  • Raspberry 4B 8GB (1,5 GHz Quad-Core ARM-Cortex A72 CPU)
  • bought at pi3g.com via their shop buyzero.de at 12/08/2021 as Raspberry Pi 4 Server Set:
    • 64GB microSD
    • USB C 5 Volt 3 Ampere Netzteil
    • microHDMI auf HDMI Kabel
    • FLIRC Gehäuse
    • CAT 6 LAN Kabel 2 m

Installation

Update to 64-bit OS

  • installation of Windows app Pi Imager
  • write 64-bit OS lite (w/o desktop) to 64GB microSD
  • boot by plug in power
  • user 'uwe' <Lr><STANDARD><Lr>
  • fixed ip address by Fritzbox
  • execute 'raspi-config' and enable SSH, set timezone to Berlin, hostname to 'raspberrypi4', ...

Obsolete Initial Operation

  • copy empty file named 'ssh' to root at microSD to enable SSH access
  • microSD to slot
  • plug-in USB power supply
  • login via SSH with user 'pi' and pwd 'raspberry'
  • enable WLAN via raspi-config
  • set fixed IP for LAN and WLAN via fritz.box to 192.168.178.(72|73)
  • update OS via
sudo apt update
sudo apt dist-upgrade

Angular

npm install -g @angular/cli

Docker

  • installation according to here with the convenience script (because of the comment regarding raspberry installation)
curl -fsSL https://get.docker.com -o get-docker.sh
DRY_RUN=1 sudo sh ./get-docker.sh
sudo reboot
sudo usermod -aG docker $USER // logout and login
  • architecture is linux/arm64/v8
  • edited /usr/lib/systemd/system/docker.service, saved the old version to ~/SoftwareProjects/eclipse-workspace/uweheuer-backend/docker.service.2023-01-07 to get rid of iptables error and missing dPort parameter when calling docker compose up for uweheuerbackend

Test by:

docker 
docker version
docker compose version
docker run hello-world

Portainer Community Edition (CE)

mkdir ~/PortainerData
docker volume create portainer_data
docker run -d   -p 8000:8000 -p 9443:9443   --name portainer   --restart=always   -v /var/run/docker.sock:/var/run/docker.sock   -v portainer_data:/home/uwe/PortainerData   cr.portainer.io/portainer/portainer-ce:latest
admin <Lp><Lp><STANDARD><Lp><Lp>

Git and GitHub CLI

sudo apt install git
git --version
git config --global user.email uwe.heuer@gmail.com
git config --global user.name UweHeuer
  • GitHub CLI from here
type -p curl >/dev/null || sudo apt install curl -y
curl -fsSL https://cli.github.com/packages/githubcli-archive-keyring.gpg | sudo dd of=/usr/share/keyrings/githubcli-archive-keyring.gpg \
&& sudo chmod go+r /usr/share/keyrings/githubcli-archive-keyring.gpg \
&& echo "deb [arch=$(dpkg --print-architecture) signed-by=/usr/share/keyrings/githubcli-archive-keyring.gpg] https://cli.github.com/packages stable main" | sudo tee /etc/apt/sources.list.d/github-cli.list > /dev/null \
&& sudo apt update \
&& sudo apt install gh -y
  • test by
gh version

Java

java -version
sudo apt install openjdk-17-jdk

Maven

sudo apt install maven

MySQL

Node.js

  • installation according to here
curl -fsSL https://deb.nodesource.com/setup_lts.x | sudo -E bash -
sudo apt install nodejs
node -v // prints v18.14.0
sudo apt install build-essential

PostgreS(QL)

// create a docker container
docker run -p 5432:5432 --name postgres -e POSTGRES_PASSWORD=Halloo0@1 -e POSTGRES_DB=postgres -e POSTGRES_USER=postgres -v pgdata:/var/lib/postgresql/data -d postgres
// -p <HOSTPORT>:<CONTAINERPORT>
// -e <ENV_VARIABLE>=<VALUE>
// -v <VOLUME_NAME>:<CONTAINER_DIR>
// -n <NAME>
pi@raspberrypi:~ $ docker volume inspect pgdata
[
    {
        "CreatedAt": "2021-09-30T21:44:54+01:00",
        "Driver": "local",
        "Labels": null,
        "Mountpoint": "/var/lib/docker/volumes/pgdata/_data",
        "Name": "pgdata",
        "Options": null,
        "Scope": "local"
    }
]
// test access
C:\Uwes\Programme\PostgreSQL\12\bin> .\psql.exe -h uweheuer.spdns.de -U postgres postgres

// clean up everything
docker stop postgres
docker rm postgres
docker volume rm pgdata // this seems to be important, because it seems otherwise the password is denied

Remode Desktop (RDP)

  • login via SSH
    • sudo apt install xrdp
    • sudo service xrdp start
  • remote desktop via Windows is empty => try VNC

SSH

  • login via cmd line
ssh uwe@uweheuer.spdns.de -p 54445 <Lr><STANDARD><Lr>

VNC (Remote Desktop)

  • update raspberry
    • sudo apt update
    • sudo apt upgrade -y
  • reinstall VNC
    • sudo apt install realvnc-vnc-server realvnc-vnc-viewer -y
  • enable VNC via
    • raspi-config -> interfaces

Configuration

  • 192.168.178.72 pi raspberry
  • hostname 'raspberrypi4'

Disable WLAN

  • disable WLAN by adding to /boot/config.txt and reboot
#UH 18-08-2021 switch off WLAN
dtoverlay=disable-wifi

Operation

On/Off

  • on/off by plug-in/off power supply

Reboot

sudo reboot

Update

sudo apt-get update && sudo apt-get upgrade