[ Home | Install | Raspi | Lite | Gpio | Build ]
Setup Wifi
(install raspiOS lite)
sudo apt update && sudo apt full-upgrade
sudo apt purge rpicam-apps-lite libpisp1
sudo dpkg-reconfigure tzdata
sudo dpkg-reconfigure locales
sync
reboot
sudo systemctl stop avahi-daemon
sudo systemctl disable avahi-daemon
sudo rfkill list
sudo rfkill unblock 1
sudo apt install ifupdown resolvconf wpa_supplicant
ifconfig
sudo nano /etc/wpa_supplicant/wpa_supplicant.conf
---
country=FR
update_config=1
ctrl_interface=/var/run/wpa_supplicant
---
wpa_passphrase MY_SSID MY_PSK | sudo tee -a /etc/wpa_supplicant/wpa_supplicant.conf
sudo mv /etc/network/interfaces /etc/network/interfaces.bak
sudo nano /etc/network/interfaces
---
auto lo
iface lo inet loopback
allow-hotplug wlan0
iface wlan0 inet static
address 192.168.1.135/24
netmask 255.255.255.0
broadcast 192.168.1.255
gateway 192.168.1.254
dns-nameservers 8.8.8.8 8.8.4.4
wpa-conf /etc/wpa_supplicant/wpa_supplicant.conf
---
sudo systemctl stop NetworkManager
sudo systemctl disable NetworkManager
sync
reboot
sudo apt purge network-manager netplan.io cloud-init
sudo apt autopurge
sudo cp /boot/firmware/config.txt /boot/firmware/config.txt.bak
sudo nano /boot/firmware/config.txt
---
auto_initramfs=1
dtoverlay=vc4-kms-v3d
max_framebuffers=2
disable_fw_kms_setup=1
arm_64bit=1
disable_overscan=1
#user config
dtoverlay=disable-bt
---
Enable SSH
sudo raspi-config
(enable ssh)
ssh hotnuma@192.168.1.135
Install custom programs
sudo apt install git meson
git config --global user.name "user_name"
git config --global user.email user_email@gmail.com
mkdir ~/DevFiles && cd ~/DevFiles
git clone https://github.com/hotnuma/libtinyc.git
pushd libtinyc
./install.sh
popd
git clone https://github.com/hotnuma/systools.git
pushd systools
./install.sh
popd
git clone https://github.com/hotnuma/sysload.git
pushd sysload
./install.sh
popd
sudo psmem.py
---
Private + Shared = RAM used Program
5.9 MiB + 4.7 MiB = 10.5 MiB systemd (2)
3.2 MiB + 4.3 MiB = 7.5 MiB sshd-session (2)
4.2 MiB + 2.1 MiB = 6.3 MiB wpa_supplicant (2)
3.3 MiB + 838.5 KiB = 4.1 MiB systemd-udevd
3.7 MiB + 172.5 KiB = 3.9 MiB bash
2.1 MiB + 775.5 KiB = 2.9 MiB systemd-journald
852.0 KiB + 2.0 MiB = 2.8 MiB sudo (2)
1.6 MiB + 1.1 MiB = 2.7 MiB sshd
1.4 MiB + 873.5 KiB = 2.3 MiB systemd-logind
1.2 MiB + 772.5 KiB = 2.0 MiB systemd-timesyncd
1.8 MiB + 200.5 KiB = 1.9 MiB (sd-pam)
1.1 MiB + 449.5 KiB = 1.5 MiB dbus-daemon
400.0 KiB + 895.0 KiB = 1.3 MiB avahi-daemon (2)
620.0 KiB + 426.0 KiB = 1.0 MiB agetty (2)
288.0 KiB + 207.5 KiB = 495.5 KiB cron
---------------------------------
21 prc
51.2 MiB
=================================
---
Passwordless login
https://www.tecmint.com/ssh-passwordless-login-using-ssh-keygen-in-5-easy-steps/
ssh-keygen -t rsa
(press enter 3 times)
ssh-copy-id hotnuma@192.168.1.135
ssh hotnuma@192.168.1.135
Enable i2c
sudo apt install i2c-tools
sudo raspi-config
(enable arm i2c)
Install IR receiver
sudo nano /boot/firmware/config.txt
---
dtoverlay=gpio-ir,gpio_pin=17
---
reboot
sudo apt install lirc liblirc-dev ir-keytable
select a protocol : sudo ir-keytable -p nec
read key codes : ir-keytable -t
create a custom keymap :
sudo nano /etc/rc_keymaps/custom.toml
---
[[protocols]]
name = "custom"
protocol = "nec"
variant = "nec"
[protocols.scancodes]
0x52 = "KEY_OK"
---
test the keymap :
sudo ir-keytable -c -w /etc/rc_keymaps/custom.toml
ir-keytable -t
sudo cp /etc/rc_maps.cfg /etc/rc_maps.cfg.bak
sudo nano /etc/rc_maps.cfg
---
* * custom.toml
---
sudo ir-keytable -a /etc/rc_maps.cfg
irw
reboot
Execute command from C code
https://www.lirc.org/api-docs/html/group__lirc__client.html
nano ~/.lircrc
---
begin
prog = radio
button = KEY_OK
config = radio sabrosita
end
---
cbuild test remote.c lirc
./test