Configuração: rasbian raspberry pi 4.4.14-v7 + com systemd para coisas relacionadas à rede.
Usando o broadcom interno wifi
Ponto de Acesso: Outro RPi3 com Hostapd 1: 2.3-1 + deb8u3 e 4.4.14-v7 +
Vou me referir a "cliente" como o RPI que está tentando se conectar ao Ponto de Acesso do Hostapd (WPA2)
O Hostapd usa um isc-dhcp-server na interface wifi que funciona bem (envia concessões, renova-os, DHCPACK etc.)
Requisito:
Eu não consigo aceitar o modo de fallback via / etc / network / interfaces ou configurações semelhantes via f.e. ifplugd, que dependem desse arquivo.
Atualmente usamos dhclient em vez do padrão dhcpcd.
Fora das perguntas estão outros gerenciadores de rede, bem como quaisquer ferramentas gráficas.
Problemas:
O cliente precisa de uma reinicialização completa para que o wifi funcione novamente se o Access Point não puder ser acessado por um curto período de tempo (reinicialização, perda de energia, algo parecido)
Eu não estou conectado ao AP via wpa_supplicant naquele momento. (hostapd_cli all_sta não mostra meu MAC Wifi do cliente)
iwconfig wlan0
wlan0 IEEE 802.11bgn ESSID: off / any
Modo: Ponto de acesso gerenciado: Tx-Power não associado = 31 dBm
Repetir limite curto: 7 RTS thr: off Fragmento thr: off
Chave de criptografia: desativada
Gerenciamento de energia: desligado
A versão "antiga" de resolver isso é via scripts ifplugd (ações ifup / ifdown) e / ou ter configurado wpa-roam em / etc / network / interfaces e usando a camada de compatibilidade "networking.service - LSB: Raise interfaces de rede. "
Outra opção seria usar um cronjob para detectar a falha na conexão e reiniciar o $ SOMETHING.
Infelizmente, não consegui descobrir o que é $ SOMETHING.
Como eu só quero usar a rede systemd, eu não carreguei a unidade "networking".
Parece-me que o wpa_supplicant tenta procurar novamente o AP, mas de alguma forma rejeita o SSID AP correspondente.
Aqui estão as configurações.
serviços carregados:
systemctl -t service
UNIT LOAD ACTIVE SUB DESCRIPTION
bluetooth.service loaded active running Bluetooth service
console-setup.service loaded active exited LSB: Set console font and keymap
cron.service loaded active running Regular background program processing daemon
dbus.service loaded active running D-Bus System Message Bus
dphys-swapfile.service loaded active exited LSB: Autogenerate and use a swap file
fake-hwclock.service loaded active exited Restore / save the current clock
[email protected] loaded active running Getty on tty1
hciuart.service loaded active running Configure Bluetooth Modems connected by UART
hdparm.service loaded active exited LSB: Tune IDE hard disks
kbd.service loaded active exited LSB: Prepare console
keyboard-setup.service loaded active exited LSB: Set preliminary keymap
kmod-static-nodes.service loaded active exited Create list of required static device nodes for the current kernel
[email protected] loaded active exited Wireless network connectivity (wlan0)
ntp.service loaded active running LSB: Start NTP daemon
openvpn.service loaded active exited OpenVPN service
postfix.service loaded active running LSB: Postfix Mail Transport Agent
raspi-config.service loaded active exited LSB: Switch to ondemand cpu governor (unless shift key is pressed)
rc-local.service loaded active running /etc/rc.local Compatibility
rsyslog.service loaded active running System Logging Service
ssh.service loaded active running OpenBSD Secure Shell server
systemd-fsck-root.service loaded active exited File System Check on Root Device
[email protected] loaded active exited File System Check on /dev/mmcblk0p1
systemd-journald.service loaded active running Journal Service
systemd-logind.service loaded active running Login Service
systemd-modules-load.service loaded active exited Load Kernel Modules
systemd-networkd.service loaded active running Network Service
systemd-random-seed.service loaded active exited Load/Save Random Seed
systemd-remount-fs.service loaded active exited Remount Root and Kernel File Systems
[email protected] loaded active exited Load/Save RF Kill Switch Status of rfkill0
[email protected] loaded active exited Load/Save RF Kill Switch Status of rfkill1
systemd-setup-dgram-qlen.service loaded active exited Increase datagram queue length
systemd-sysctl.service loaded active exited Apply Kernel Variables
systemd-tmpfiles-setup-dev.service loaded active exited Create Static Device Nodes in /dev
systemd-tmpfiles-setup.service loaded active exited Create Volatile Files and Directories
systemd-udev-trigger.service loaded active exited udev Coldplug all Devices
systemd-udevd.service loaded active running udev Kernel Device Manager
systemd-update-utmp.service loaded active exited Update UTMP about System Boot/Shutdown
systemd-user-sessions.service loaded active exited Permit User Sessions
triggerhappy.service loaded active running LSB: triggerhappy hotkey daemon
udev-finish.service loaded active exited Copy rules generated while the root was ro
[email protected] loaded active running User Manager for UID 0
cat /etc/systemd/network/00-wireless.network
#General configuration wlan0
[Match]
Name=wlan0
[Network]
DHCP=ipv4
eu configurei algumas informações de depuração adicionais em /var/log/wpa_supplicant.log para que o ExecStart seja um pouco mais longo que o normal.
cat /etc/systemd/system/[email protected]
[Unit]
Description=Wireless network connectivity (%i)
Wants=network.target
Before=network.target
BindsTo=sys-subsystem-net-devices-%i.device
After=sys-subsystem-net-devices-%i.device
[Service]
Type=oneshot
RemainAfterExit=yes
ExecStart=/sbin/ip l set %i up
ExecStart=/sbin/wpa_supplicant -t -dd -f /var/log/wpa_supplicant.log -dd -B -i %i -c /etc/wpa_supplicant/wpa_supplicant.conf
ExecStart=/sbin/dhclient %i
ExecStop=/sbin/ip l set %i down
[Install]
WantedBy=multi-user.target
cat /etc/wpa_supplicant/wpa_supplicant.conf
country=DE
ctrl_interface=/var/run/wpa_supplicant GROUP=netdev
update_config=1
network={
ssid="testap"
psk="testconn"
}
alguns registros:
inicializando o cliente:
systemctl status [email protected]
● [email protected] - Wireless network connectivity (wlan0)
Loaded: loaded (/etc/systemd/system/[email protected]; enabled)
Active: active (exited) since Fri 2016-08-05 12:21:17 CEST; 3min 32s ago
Process: 431 ExecStart=/sbin/dhclient %i (code=exited, status=0/SUCCESS)
Process: 425 ExecStart=/sbin/wpa_supplicant -t -dd -f /var/log/wpa_supplicant.log -dd -B -i %i -c /etc/wpa_supplicant/wpa_supplicant.conf (code=exited, status=0/SUCCESS)
Process: 387 ExecStart=/sbin/ip l set %i up (code=exited, status=0/SUCCESS)
Main PID: 431 (code=exited, status=0/SUCCESS)
cliente de inicialização (tudo OK, conexão estável e funcionando por horas / dias nos testes anteriores)
journalctl -u [email protected] -b
-- Logs begin at Fri 2016-08-05 12:21:05 CEST, end at Fri 2016-08-05 12:22:53 CEST. --
Aug 05 12:21:08 testclient systemd[1]: Starting Wireless network connectivity (wlan0)...
Aug 05 12:21:09 testclient dhclient[431]: DHCPREQUEST on wlan0 to 255.255.255.255 port 67
Aug 05 12:21:13 testclient dhclient[431]: DHCPREQUEST on wlan0 to 255.255.255.255 port 67
Aug 05 12:21:17 testclient dhclient[431]: DHCPREQUEST on wlan0 to 255.255.255.255 port 67
Aug 05 12:21:17 testclient dhclient[431]: DHCPACK from 192.168.100.1
Aug 05 12:21:17 testclient dhclient[431]: bound to 192.168.100.11 -- renewal in 60 seconds.
Aug 05 12:21:17 testclient systemd[1]: Started Wireless network connectivity (wlan0).
Aug 05 12:22:17 testclient dhclient[549]: DHCPREQUEST on wlan0 to 192.168.100.1 port 67
Aug 05 12:22:17 testclient dhclient[549]: DHCPACK from 192.168.100.1
Aug 05 12:22:17 testclient dhclient[549]: bound to 192.168.100.11 -- renewal in 53 seconds.
reinicializando o AP:
Aug 5 12:26:55 testclient systemd-networkd[422]: wlan0 : lost carrier
Aug 5 12:26:55 testclient dhclient: DHCPREQUEST on wlan0 to 192.168.100.1 port 67
Aug 5 12:27:00 testclient dhclient: DHCPREQUEST on wlan0 to 192.168.100.1 port 67
Aug 5 12:27:12 testclient dhclient: DHCPREQUEST on wlan0 to 192.168.100.1 port 67
Aug 5 12:27:32 testclient dhclient: DHCPREQUEST on wlan0 to 192.168.100.1 port 67
isso me leva a acreditar que estou perdendo uma opção na "transportadora perdida" na unidade de rede do sistema para reiniciar o serviço sem fio.
Qual parte eu perdi ou onde posso obter mais informações se minhas habilidades de pesquisa em SE e google me falharam. Obrigado.
nota: de acordo com a ajuda raspberrypi.se eu não deveria usar o site rpi se, mas UX, o que eu fiz. Por favor, mude se eu entendi mal a parte de "Questões diretamente relacionadas a problemas com Linux / Unix. Por favor, use o Unix e o Linux Exchange".
várias referências que eu tentei, no entanto, a maioria delas é desatualizada ou não me ajudou na minha situação.
Reconectar automaticamente o Wi-Fi quando desconectado?