Raspberry Pi: Difference between revisions

From Chorke Wiki
Jump to navigation Jump to search
 
(71 intermediate revisions by the same user not shown)
Line 3: Line 3:


<source lang="bash">
<source lang="bash">
touch /Volumes/boot/ssh
screen /dev/tty.wchusbserial14430 115200
screen /dev/tty.wchusbserial14430 115200
</source>
==WPA Supplicant==
<source lang="bash">
cat <<EOF > /Volumes/boot/wpa_supplicant.conf
country=MY
ctrl_interface=DIR=/var/run/wpa_supplicant GROUP=netdev
update_config=1
network={
scan_ssid=1
ssid="ChorkeOrg_2.4GHz"
psk="p@$$w0rd"
}
EOF
</source>
</source>


Line 13: Line 29:
<source lang="ini">
<source lang="ini">
# Chorke Academia, Inc.
# Chorke Academia, Inc.
#static domain_name_servers=10.19.83.5 10.19.83.1
# static domain_name_servers=10.19.83.100 10.19.83.1
static domain_search=dev.shahed.biz
static domain_search=dev.shahed.biz
#static host_name=pi3
# static host_name=pi3
</source>
</source>


<source lang="bash">
<source lang="bash" highlight="5,6">
sudo systemctl restart dhcpcd
sudo systemctl restart dhcpcd
sudo systemctl daemon-reload
sudo systemctl daemon-reload
sudo apt install resolvconf
sudo apt install openresolv
sudo resolvconf -u


# execute in ssh client machine
# execute in ssh client machine
ssh-copy-id -i ~/.ssh/rpi_chorke_rsa [email protected].3
ssh-copy-id -i ~/.ssh/rpi_chorke_rsa [email protected].203
ssh -i ~/.ssh/rpi_chorke_rsa [email protected].3
ssh -i ~/.ssh/rpi_chorke_rsa [email protected].203
</source>
</source>


<source lang="ini">
<source lang="ini">
#/Users/chorke/.ssh/config
# ~/.ssh/config
Host rpi.bgd.chorke.org
Host rpi.bgd.chorke.org
     HostName 10.19.83.3
     HostName 10.19.83.203
     PreferredAuthentications publickey
     PreferredAuthentications publickey
     IdentityFile ~/.ssh/rpi_chorke_rsa
     IdentityFile ~/.ssh/rpi_chorke_rsa
Line 47: Line 67:
dpkg-reconfigure phpmyadmin
dpkg-reconfigure phpmyadmin
apt autoremove
apt autoremove
</source>
==Firmware Update==
<source lang="bash" highlight="4,5,7,8,10">
sudo apt update
sudo apt full-upgrade
sudo rpi-update
sudo init 6
sudo rpi-eeprom-update -d -a
sudo init 6
sudo raspi-config
</source>
==Swap Memory==
<source lang="bash" highlight="2,3">
printf '\nbefore:\n';free -th;\
sed -i "s|CONF_SWAPSIZE=100|CONF_SWAPSIZE=2048|" /etc/dphys-swapfile;\
service dphys-swapfile restart;\
printf '\nupdate:\n';free -th
</source>
==Operating Voltage==
<source lang="bash">
for id in core sdram_c sdram_i sdram_p;do \
    echo -e "$id:\t$(vcgencmd measure_volts $id)";\
done
</source>
</source>


Line 97: Line 146:
# Hello World!
# Hello World!
</source>
</source>
==Knowledge==
{|
|
'''systemctl'''
systemctl list-unit-files
systemctl daemon-reload
|
'''Pi zero 2W (bullseye)'''
cp /Volumes/boot/bcm2710-rpi-3-b.dtb
    /Volumes/boot/bcm2710-rpi-zero-2.dtb
|
'''Java Native Image'''
sudo apt install build-essential libz-dev zlib1g-dev
sudo apt install libc6 libc6-dev
|-
|colspan='3'|
----
|-
|
sudo apt install libc6=2.32
sudo apt install libc6=2.34
|
apt update && apt dist-upgrade
apt update --allow-releaseinfo-change
|
ifconfig wlan0 up
ifconfig wlan0 down
|}


== References ==
== References ==
{|
| valign="top" |
* [https://blogs.msdn.microsoft.com/david/2017/07/20/setting_up_raspian_and_dotnet_core_2_0_on_a_raspberry_pi/ Setting up Raspian and .NET Core 2.0 on a Raspberry Pi]
* [https://blogs.msdn.microsoft.com/david/2017/07/20/setting_up_raspian_and_dotnet_core_2_0_on_a_raspberry_pi/ Setting up Raspian and .NET Core 2.0 on a Raspberry Pi]
* [https://taras.codes/blog/hosting-an-asp-net-core-application-on-raspberry-pi-3/ Hosting an ASP.NET Core application on Raspberry Pi 3]
* [https://buildthings.wordpress.com/raspberry-pi-bind9-dns-ddns-dynamic-dns-dnssec-keygen-nsupdate-ddnsclient-on-off-switch-ham-radio-arduino-attiny-remote-base/ Raspberry Pi Bind9 DNS/DDNS (Dynamic DNS) Server]
* [https://buildthings.wordpress.com/raspberry-pi-bind9-dns-ddns-dynamic-dns-dnssec-keygen-nsupdate-ddnsclient-on-off-switch-ham-radio-arduino-attiny-remote-base/ Raspberry Pi Bind9 DNS/DDNS (Dynamic DNS) Server]
* [https://www.hanselman.com/blog/InstallingTheNETCore2xSDKOnARaspberryPiAndBlinkingAnLEDWithSystemDeviceGpio.aspx IoT with System.Device.Gpio by .Net Core 2.2]
* [https://www.hanselman.com/blog/InstallingTheNETCore2xSDKOnARaspberryPiAndBlinkingAnLEDWithSystemDeviceGpio.aspx IoT with System.Device.Gpio by .Net Core 2.2]
* [https://domoticproject.com/configuring-dns-server-raspberry-pi/ Configuring a DNS Server in Raspberry Pi]
* [https://domoticproject.com/configuring-dns-server-raspberry-pi/ Configuring a DNS Server in Raspberry Pi]
* [https://github.com/dotnet/core/blob/master/Documentation/linux-prereqs.md Linux System Prerequisites for .NET Core]
* [https://github.com/dotnet/core/blob/master/Documentation/linux-prereqs.md Linux System Prerequisites for .NET Core]
* [https://learn.pi-supply.com/make/how-to-save-power-on-your-raspberry-pi/ How to save Power on your Raspberry Pi]
* [https://medium.com/@ylerjen/installing-netcore-on-a-raspberry-pi-3-e6ea1bca12e3 Installing .Net Core on a Raspberry Pi 3]
* [https://medium.com/@ylerjen/installing-netcore-on-a-raspberry-pi-3-e6ea1bca12e3 Installing .Net Core on a Raspberry Pi 3]
* [[Raspberry Pi Authoritative DNS Server]]
* [[Raspberry Pi Authoritative DNS Server]]
* [https://www.raspberrypi.org/documentation/configuration/wireless/wireless-cli.md Setting WiFi up via the command line]
* [[Linux Mount Drive]]
 
| valign="top" |
* [https://prabg.wordpress.com/2018/04/07/jboss-wildfly-as-setup-on-raspberry-pi-3 JBoss Wildfly AS Setup on Raspberry pi 3]
* [https://www.raspberrypi.org/documentation/configuration/wireless/headless.md Setting up a Raspberry Pi headless]
* [https://seanjziegler.com/managing-an-rpi-cluster-with-ansible/ Raspberry Pi Cluster with Ansible]
* [https://www.raspberrypi.org/documentation/configuration/external-storage.md External Storage Configuration]
* [https://seanjziegler.com/how-to-run-jira-on-a-raspberry-pi-4/ Run Jira on a Raspberry Pi 4]
* [https://www.raspberrypi.org/forums/viewtopic.php?t=203716 PI Zero W wpa_supplicant]
* [https://www.raspberrypi.org/forums/viewtopic.php?t=203716 PI Zero W wpa_supplicant]
* [https://nodered.org/docs/platforms/docker Node-RED Docker Image]
* [https://nodered.org/docs/platforms/docker Node-RED Docker Image]
* [https://github.com/dotnet/iot .NET Core IoT Libraries]
* [https://github.com/dotnet/iot .NET Core IoT Libraries]
* [https://www.raspberrypi.org/documentation/configuration/nfs.md Network File System]
* [https://github.com/dotnet/core/blob/master/samples/RaspberryPiInstructions.md .NET Core Samples]
* [https://github.com/dotnet/core/blob/master/samples/RaspberryPiInstructions.md .NET Core Samples]
| valign="top" |
* [https://www.tomshardware.com/reviews/raspberry-pi-headless-setup-how-to,6028.html Install Raspberry Pi OS Without a Monitor]
* [https://www.tomshardware.com/how-to/fix-cannot-currently-show-desktop-error-raspberry-pi Cann't Currently Show the Desktop Error]
* [https://www.tomshardware.com/how-to/boot-raspberry-pi-4-usb Boot Raspberry Pi 4 From a USB SSD]
* [https://www.programmersought.com/article/37674456208/ Install the CentOS on Raspberry Pi4]
* [https://miguelangelantolin.com/bitbucket-server-on-raspberry-pi/ Bitbucket server on Raspberry Pi]
* [https://seanjziegler.com/tennis-ball-tracking-with-opencv/ Tracking an object with OpenCV]
* [https://gist.github.com/brunojppb/1c5a95f941f7306a4865766a3316da3e Install TeamCity on Ubuntu]
* [https://www.centos.org/centos-linux/ CentOS Linux ARM64]
* [https://ubuntu.com/download/raspberry-pi Ubuntu Linux ARM64]
* [https://www.raspberrypi.org/documentation/remote-access/vnc/ Installing VNC]
|-
| colspan="3" |
----
|-
| valign="top" |
* [https://www.digitalocean.com/community/tutorials/how-to-install-configure-pgadmin4-server-mode Install & Configure pgAdmin 4 in Server Mode]
* [https://www.raspberrypi.org/documentation/configuration/wireless/wireless-cli.md Setting WiFi up via the command line]
* [https://wiki.alpinelinux.org/wiki/Raspberry_Pi_4_-_Persistent_system_acting_as_a_NAS_and_Time_Machine Raspberry Pi4 NAS & Time Machine]
* [https://en.wikipedia.org/wiki/ARM_Cortex-A53 ARM Cortex-A53 (ARMv8-A 64-bit)]
* [https://turingpi.com/installing-kubernetes-cluster-on-the-turingpi/ Kubernetes (K3s) on the Turing Pi]
* [https://www.raspberrypi.org/documentation/installation/sd-cards.md SD Card Size or Capacity]
* [https://alpinelinux.org/downloads/ Download Alpine Linux]
* [https://my.cytron.io/p-raspberry-pi-zero-2-w Raspberry Pi Zero 2 W]
* [https://en.wikipedia.org/wiki/OpenRC OpenRC init System]
* [https://blog.while-true-do.io/fedora-raspberrypi-setup/ Raspberry Pi Fedora]
| valign="top" |
* [https://qengineering.eu/install-64-os-on-raspberry-pi-zero-2.html Install 64 bit OS on '''Raspberry Pi zero 2 W''']
* [https://downloads.raspberrypi.org/raspios_lite_arm64/images/ Download Raspberry PiOS AArch64 Lite]
* [https://downloads.raspberrypi.org/raspios_arm64/images/ Download Raspberry PiOS AArch64 Full]
* [https://askubuntu.com/questions/1143268/ Install a <code>Libc6 version >= 2.29</code>]
* [https://wiki.alpinelinux.org/wiki/Raspberry_Pi Install Alpine Linux on Raspberry Pi]
* [https://turingpi.com/turing-pi-2-announcement/ Turing Pi V2 Announcement]
* [https://pkgs.org/download/libc6 Download <code>Libc6</code> for Linux]
* [[Fedora/Raspberry Pi]]
* [[Ubuntu/Raspberry Pi]]
* [[Fedora]]
| valign="top" |
* [https://tutorial.cytron.io/2020/02/22/how-to-check-if-your-raspberry-pi-4-model-b-is-rev1-2/ Check if Raspberry Pi 4 Model B is Rev1.2]
* [https://forums.raspberrypi.com/viewtopic.php?t=360226 RPi5 » OTG <code>g_ether</code> is not working]
* [https://github.com/raspberrypi/bookworm-feedback/issues/77 RPi5 » <code>dwc2 overlay</code> fails]
* [https://github.com/techcraftco/rpi-usb-gadget/releases/ RPI USB Gadget Releases]
* [https://www.pshinecable.com/article/what-are-the-differences-between-usb-pd3-1-and-usb-pd2-0-pd3-0.html PD » 1.0 » 2.0 » 3.0 » 3.1]
* [https://www.raspberrypi.com/documentation/computers/raspberry-pi.html Raspberry Pi Hardware]
* [https://stackoverflow.com/questions/28981112/ Close a frozen SSH]
* [https://www.hardill.me.uk/wordpress/2019/11/02/pi4-usb-c-gadget/ Pi4 USB-C Gadget]
* [https://github.com/techcraftco/rpi-usb-gadget RPI USB Gadget]
* [[Apple iPad Pro]]
|}

Latest revision as of 18:48, 15 December 2023

Maker pHAT

<pdf page="9">File:Pi_maker_phat_users_manual.pdf</pdf>

touch /Volumes/boot/ssh
screen /dev/tty.wchusbserial14430 115200

WPA Supplicant

cat <<EOF > /Volumes/boot/wpa_supplicant.conf
country=MY
ctrl_interface=DIR=/var/run/wpa_supplicant GROUP=netdev
update_config=1

network={
scan_ssid=1
ssid="ChorkeOrg_2.4GHz"
psk="p@$$w0rd"
}
EOF
sudo raspi-config
sudo nano /etc/dhcpcd.conf
# Chorke Academia, Inc.
# static domain_name_servers=10.19.83.100 10.19.83.1
static domain_search=dev.shahed.biz
# static host_name=pi3
sudo systemctl restart dhcpcd
sudo systemctl daemon-reload

sudo apt install resolvconf
sudo apt install openresolv
sudo resolvconf -u

# execute in ssh client machine
ssh-copy-id -i ~/.ssh/rpi_chorke_rsa [email protected]
ssh -i ~/.ssh/rpi_chorke_rsa [email protected]
# ~/.ssh/config
Host rpi.bgd.chorke.org
     HostName 10.19.83.203
     PreferredAuthentications publickey
     IdentityFile ~/.ssh/rpi_chorke_rsa
     User pi
ssh rpi.bgd.chorke.org
apt install openjdk-8-jre
apt install openjdk-8-jdk
update-alternatives --config java
update-alternatives --config javac
dpkg-reconfigure phpmyadmin
apt autoremove

Firmware Update

sudo apt update
sudo apt full-upgrade

sudo rpi-update
sudo init 6

sudo rpi-eeprom-update -d -a
sudo init 6

sudo raspi-config

Swap Memory

printf '\nbefore:\n';free -th;\
sed -i "s|CONF_SWAPSIZE=100|CONF_SWAPSIZE=2048|" /etc/dphys-swapfile;\
service dphys-swapfile restart;\
printf '\nupdate:\n';free -th

Operating Voltage

for id in core sdram_c sdram_i sdram_p;do \
    echo -e "$id:\t$(vcgencmd measure_volts $id)";\
done

Dotnet Core

sudo su
mkdir -p /opt/dotnet
chown pi /opt/dotnet
sudo apt udpate
sudo apt install curl libunwind8 gettext apt-transport-https
sudo apt install libicu63 libssl1.1
cd /opt/dotnet
# download from http://cdn.chorke.org/soft/rpix/dotnet/
sudo tar zxf dotnet-sdk-2.2.102-linux-arm.tar.gz -C /opt/dotnet/
sudo tar zxf dotnet-runtime-2.1.9-linux-arm.tar.gz -C /opt/dotnet/
sudo tar zxf aspnetcore-runtime-2.2.1-linux-arm.tar.gz -C /opt/dotnet/
echo 'export DOTNET_ROOT=opt/dotnet' >> ~/.bash_profile
echo 'export PATH=$PATH:$DOTNET_ROOT' >> ~/.bash_profile
printenv
sudo ln -s /opt/dotnet/dotnet /usr/local/bin
dotnet --info
dotnet --help

Core Project

cd ~/Documents
mkdir HelloWorld
cd HelloWorld

dotnet new console
dotnet publish -r linux-arm
bin/Debug/netcoreapp2.2/linux-arm/publish/HelloWorld
# Hello World!

dotnet publish -r win-arm
bin/Debug/netcoreapp2.2/win-arm/publish/HelloWorld
# Hello World!

Knowledge

systemctl
systemctl list-unit-files
systemctl daemon-reload
Pi zero 2W (bullseye)
cp /Volumes/boot/bcm2710-rpi-3-b.dtb
   /Volumes/boot/bcm2710-rpi-zero-2.dtb
Java Native Image
sudo apt install build-essential libz-dev zlib1g-dev
sudo apt install libc6 libc6-dev

sudo apt install libc6=2.32
sudo apt install libc6=2.34
apt update && apt dist-upgrade
apt update --allow-releaseinfo-change
ifconfig wlan0 up
ifconfig wlan0 down

References