Benutzer-Werkzeuge

Webseiten-Werkzeuge


setup_zero_buster

Dies ist eine alte Version des Dokuments!


Raspberry Zero mit Bullseye installieren

Raspbian-Bullseye herunterladen und installieren: 2021-10-30-raspios-bullseye-armhf.zip

Flashen mit BalenaEtcher

Config-Dateien installieren

Eine leere Datei mit Namen „ssh“ ins boot-Verzeichnis

cmdline.txt (anhängen)

 ip=192.168.178.32::192.168.178.1:255.255.255.0:zero:wlan0:off

wpa_supplicant.conf (erstellen)

country=DE
ctrl_interface=DIR=/var/run/wpa_supplicant GROUP=netdev
update_config=1
network={
    ssid="iMacToGo"
    psk="PASSWORD"
    key_mgmt=WPA-PSK
}

SD-Karte in den Zero und los - dauert länger

Anmelden und Nacharbeiten

ssh pi@192.168.178.32
pwd:raspberry

sudo raspi-config

1-S3: password
1-S4: hostname:zero
3-P1: PiCamera
3-P2: SSH
5-L1: de_DE.UTF-8 / de_DE.UTF-8
5-L2: Timezone: Europe->Monaco
6   : Expand Filesystem

sudo reboot now

sudo apt-get update
sudo apt-get -y dist-upgrade (15 Minuten)

sudo reboot now

Netzwerk - wieder auf DHCP umstellen und mit meinem WLAN Verbinden

/etc/network/interfaces
allow-hotplug wlan0
iface wlan0 inet dhcp
    wpa-conf /etc/wpa_supplicant/wpa_supplicant.conf
wireless-power off
/etc/wpa_supplicant/wpa_supplicant.conf
country=DE
ctrl_interface=DIR=/var/run/wpa_supplicant GROUP=netdev
update_config=1
network={
    ssid="iMacToGo"
    psk="KENNWORT"
    key_mgmt=WPA-PSK
}

Das zweite WLAN als Hotspot einrichten mit einrichten

sudo apt-get install dnsmasq hostapd

sudo nano /etc/network/interfaces
allow-hotplug wlan1
iface wlan1 inet static
address 192.168.10.254
netmask 255.255.255.0
up iptables-restore < /etc/iptables.nat
wireless-power off

sudo nano /etc/hostapd.conf
# WLAN-Router-Betrieb
# Schnittstelle und Treiber
interface=wlan1
#driver=nl80211
# WLAN-Konfiguration
ssid=WLANrouter
channel=1
hw_mode=g
ieee80211n=1
ieee80211d=1
country_code=DE
wmm_enabled=1
# WLAN-Verschlüsselung
auth_algs=1
wpa=2
wpa_key_mgmt=WPA-PSK
rsn_pairwise=CCMP
wpa_passphrase=testtest

sudo nano /etc/default/hostapd
DAEMON_CONF="/etc/hostapd.conf"

sudo nano /etc/dnsmasq.conf
interface=wlan1
no-dhcp-interface=eth0
dhcp-range=interface:wlan1,192.168.10.1,192.168.10.10,infinite

sudo nano /etc/sysctl.conf
net.ipv4.ip_forward=1

(sollten die nächsten Befehle nicht gehen, erst den Rest machen, dann gehen sie)
sudo iptables -t nat -A POSTROUTING -o wlan0 -j MASQUERADE
sudo iptables -A FORWARD -i wlan0 -o wlan1 -m state --state RELATED,ESTABLISHED -j ACCEPT
sudo iptables -A FORWARD -i wlan1 -o wlan0 -j ACCEPT
sudo sh -c "iptables-save > /etc/iptables.nat"

sudo dnsmasq --test -C /etc/dnsmasq.conf (testen)
sudo hostapd -dd /etc/hostapd.conf (testen)

sudo service dnsmasq start
sudo systemctl enable dnsmasq (beim booten)

sudo systemctl unmask hostapd
sudo systemctl start hostapd
sudo systemctl enable hostapd (beim booten)

VNC-Server, der vom Mac aus geht

sudo apt-get install tightvncserver
vncserver (starten)

Suche

sudo apt-get install mlocate
sudo updatedb 

Tools

sudo apt-get install aircrack-ng
sudo airmon-ng start wlan1
sudo airodump-ng wlan1mon
sudo apt-get install gawk tcpdump # https://github.com/brannondorsey/sniff-probes
IFACE=wlan1mon 
OUTPUT=output.txt 
#CHANNEL_HOP=1

sudo apt-get installl dsniff

Statt den FORWARD Regeln kann man auch eine Bridge einrichten:
sudo apt-get install bridge-utils
sudo brctl addbr br0
(sudo brctl Addis br0 wlan0) geht nicht, stattdessen in "sudo nano /etc/default/hostapd"
bridge=br0

sudo nano /etc/network/interfaces
auto br0
face br0 net manual
bridge_ports wlan0 wlan1

urlsnarf -i wlan0 (alles andere geht nicht)

# der block geht noch nicht
git clone https://github.com/moxie0/sslstrip.git
sudo apt-get install python-twisted-web
sudo iptables -t nat -A PREROUTING -p tcp --destination-port 80 -j REDIRECT --to-port 8080
iptables -t nat -L
python sslstrip.py -p -l 8080
tail -f sslstrip.log

Zugriff per Bluetooth (mit zwei Apps kamen immer Steuerzeichen mit, also doch Hotspot)
Verbindung (erstellen von bnep0) geht nur, wenn am Handy Mehr→Bluetooth-Tethering AN ist
http://bluez.sourceforge.net/contrib/HOWTO-PAN
https://www.raspberrypi.org/forums/viewtopic.php?t=223029

Bei Connect-Problemen:

sudo cat /var/log/syslog | grep -i protocol
Jul 29 11:02:50 zero bluetoothd[426]: a2dp-source profile connect failed for 00:EC:0A:72:14:61: Protocol not available
sudo apt-get install pulseaudio-module-bluetooth
pulseaudio --start
sudo apt-get install bluez bluez-tools
sudo bluetoothctl
agent on
default-agent
scan on
pair 00:EC:0A:72:14:61
trust 00:EC:0A:72:14:61
connect 00:EC:0A:72:14:61
exit
git clone https://github.com/WayneKeenan/RaspberryPi_BTPAN_AutoConnect.git
(https://github.com/WayneKeenan/RaspberryPi_BTPAN_AutoConnect)
mkdir bin; mv Rasp*/* bin

sudo nano /etc/network/interfaces
allow-hotplug bnep0
iface bnep0 inet static
address 192.168.44.106
netmask 255.255.255.0

sudo /home/pi/bin/check-and-connect-bt-pan.sh
crontab -e
* * * * * /home/pi/bin/check-and-connect-bt-pan.sh

Zugriff per Webbrowser auf die Konsole

sudo apt install shellinabox minicom
sudo nano /etc/default/shellinabox
SHELLINABOX_ARGS="-t -s /:LOGIN -s /termi:pi:pi:/usr/home/pi:/usr/bin/minicom --no-beep" 
/etc/init.d/shellinabox restart (1)
http://192.168.178.32:4200

FritzBox Anrufe feststellen - callMonitor Externer Link

#96*5*
telnet fritz.box 1012
29.07.20 10:19:09;RING;0;#from#;#to#;SIP1;
29.07.20 10:19:16;DISCONNECT;0;0;

Mehr Infos:
https://administrator.de/wissen/netzwerk-management-server-raspberry-pi-191718.html#toc-18

Kamera Externer Link

raspivid -o vid.h264
sudo apt install -y gpac

# Capture 30 seconds of raw video at 640x480 and 150kB/s bit rate into a pivideo.h264 file:
raspivid -t 30000 -w 640 -h 480 -fps 25 -b 1200000 -p 0,0,640,480 -o pivideo.h264
# Wrap the raw video with an MP4 container:
MP4Box -add pivideo.h264 pivideo.mp4
# Remove the source raw file, leaving the remaining pivideo.mp4 file to play
rm pivideo.h264

Streaming Video Externer Link

sudo apt-get install motion -y
v4l2-ctl -V
sudo nano /etc/motion/motion.conf
daemon on
stream_localhost off
target_dir /home/pi/Monitor
v4l2_palette 15
width 640 
height 480
framerate 10
sudo nano /etc/default/motion
start_motion_daemon=yes
mkdir /home/pi/Monitor
sudo chgrp motion /home/pi/Monitor
chmod g+rwx /home/pi/Monitor
sudo service motion start

AFP

sudo apt install netatalk
sudo nano /etc/netatalk/afp.conf
[Homes]
  basedir regex = /home
afp://192.168.178.32

SAMBA

sudo apt-get install samba samba-common smbclient
sudo service smbd status
sudo service nmbd status
sudo nano /etc/samba/smb.conf
	# Name der Freigabe
	[pi]
	path=/home/pi
	available=yes
	browsable=yes
	guest ok = no
	writeable = yes
	write list = pi
	valid users = pi
sudo service smbd restart
sudo service nmbd restart
#Eigene Benutzer/Kennwort für SAMBA(!). man kann natürlich pi nehmen
sudo smbpasswd -a pi
smb://192.168.178.32
setup_zero_buster.1641895066.txt.gz · Zuletzt geändert: 2022/01/11 09:57 von varnholt