0
此代碼對樹莓PI3運行試圖在腳本有條件
我有一個腳本/etc/rc2.d/S05frameapp有條件地啓動hostapd啓動/ usr/sbin目錄/ hostapd(查看是否無線(此部分被運行,如果沒有wifi已經建立一套該設備)
echo "restarting etho"
/sbin/ifup wlan0
echo "Starting hostapd";
/usr/bin/nohup /usr/sbin/hostapd -B -P /var/run/hostapd.pid /etc/hostapd/hostapd.conf >> /tmp/hostapd.log 2>&1 &
echo "Starting dnsmasq ";
/usr/sbin/service dnsmasq start;
echo "Starting wifi_config node";
cd /home/wifi_listener/
/usr/bin/nohup /usr/local/bin/node app.js >> /tmp/nodeapp.log 2>&1 &
從nohup的已設置或不)
腳本,在/tmp/hostapd.log我見
cat /tmp/hostapd.log
Configuration file: /etc/hostapd/hostapd.conf
Failed to create interface mon.wlan0: -95 (Operation not supported)
Could not set channel for kernel driver
Interface initialization failed
wlan0: interface state UNINITIALIZED->DISABLED
wlan0: AP-DISABLED
wlan0: Unable to setup interface.
hostapd_free_hapd_data: Interface wlan0 wasn't started
,但如果我現在登錄(通過硬連線網絡),並運行以下它的工作原理...
#/usr/sbin/hostapd -B -P /var/run/hostapd.pid /etc/hostapd/hostapd.conf
Configuration file: /etc/hostapd/hostapd.conf
Failed to create interface mon.wlan0: -95 (Operation not supported)
wlan0: Could not connect to kernel driver
Using interface wlan0 with hwaddr b8:27:eb:40:bd:a4 and ssid
"WhatUlooknAtWillis"
wlan0: interface state UNINITIALIZED->ENABLED
wlan0: AP-ENABLED
,所以我想kinfod這可能是一個時間問題?這就是爲什麼我現在有腳本運行S05
感謝您的幫助