-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathraspi.txt
70 lines (49 loc) · 1.2 KB
/
raspi.txt
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
# default login
user: pi
pass: raspberry
# configure WiFi on RasPi Zero W:
cat <<EOF > /etc/NetworkManager/system-connections/foobar.nmconnection
[connection]
id=my favorite network
uuid=xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx
type=wifi
interface-name=wlan0
[wifi]
mode=infrastructure
ssid=network_name
[wifi-security]
auth-alg=open
key-mgmt=wpa-psk
psk=topsi_kret_pa$$w0rd
[ipv4]
method=auto
[ipv6]
addr-gen-mode=default
method=auto
[proxy]
EOF
# switch UART between: linux console, serial port and none
# raspi-config
> interface options > serial port > (pick preferred combination)
# enable SSH by default (headless)
touch /boot/ssh
# prohibit passwords via SSH (keys only)
cat <<EOF > /etc/ssh/sshd_config.d/no_passwords.conf
PermitRootLogin prohibit-password
PasswordAuthentication no
PermitEmptyPasswords no
KerberosOrLocalPasswd no
EOF
systemctl restart ssh
# add IP of eth0 to TTY loggin screen
echo '\4{eth0}' >> /etc/issue
# I2C usage
(enable I2C in `raspi-config` first!)
## scan bus for devices
i2cdetect -y 1
## read entire from EEPROM
i2cdump -y 1 0x50
## read byte 0x42 from EEPROM (0x50 address)
i2cget -y 1 0x50 0x42
## set byte 0x42 to 0x12 (EEPRIN is at 0x50 address)
i2cset -y 1 0x50 0x42 0x12