메뉴 건너뛰기

TSKit

Rpi3 auto ap mode.

조회 수 6059 추천 수 0 2014.12.08 00:02:09

Normal client mode.


$sudo apt-get update

$sudo apt-get install hostapd -y

$sudo apt-get install dnsmasq -y

$sudo systemctl disable hostapd

$sudo systemctl disable dnsmasq


/etc/hostapd/hostapd.conf

interface=wlan0

driver=nl80211

ssid=RPI3wifi

hw_mode=g

channel=6

wmm_enabled=0

macaddr_acl=0

auth_algs=1

wpa=2

wpa_passphrase=1234567890

wpa_key_mgmt=WPA-PSK

wpa_pairwise=TKIP

rsn_pairwise=CCMP


/etc/default/hostapd

#demon_conf=""

==>

demon_conf="/etc/hostapd/hostapd.conf"


/etc/dnsmasq.conf

#Pi3Hotspot Config

#stop DNSmasq from using resolv.conf

no-resolv

#Interface to use

interface=wlan0

bind-interfaces

dhcp-range=10.0.0.3,10.0.0.20,12h

server=8.8.8.8


/etc/network/interfaces

allow-hotplug wlan0

iface wlan0 inet manual

#wpa-conf /etc/wpa_supplicant/wpa_supplicant.conf


/etc/rc.local

#!/bin/sh -e

==>

#!/bin/bash -e


insert between fi and exit 0 


#Wifi config - if no prefered Wifi generate a hotspot

#RPi Network Conf Bootstrapper

 

createAdHocNetwork()

{

    echo "Creating RPI Hotspot network"

    ifconfig wlan0 down

    ifconfig wlan0 10.0.0.5 netmask 255.255.255.0 up

    service dnsmasq start

    service hostapd start

    echo " "

    echo "Hotspot network created"

    echo " "

}

 

echo "================================="

echo "RPi Network Conf Bootstrapper"

echo "================================="

echo "Scanning for known WiFi networks"

ssids=( 'mySSID1','mySSID2' )

connected=false

for ssid in "${ssids[@]}"

do

    echo " "

    echo "checking if ssid available:" $ssid

    echo " "

    if iwlist wlan0 scan | grep $ssid > /dev/null

    then

        echo "First WiFi in range has SSID:" $ssid

        echo "Starting supplicant for WPA/WPA2"

        wpa_supplicant -B -i wlan0 -c /etc/wpa_supplicant/wpa_supplicant.conf > /dev/null 2>&1

        echo "Obtaining IP from DHCP"

        if dhclient -1 wlan0

        then

            echo "Connected to WiFi"

            connected=true

            break

        else

            echo "DHCP server did not respond with an IP lease (DHCPOFFER)"

            wpa_cli terminate

            break

        fi

    else

        echo "Not in range, WiFi with SSID:" $ssid

    fi

done

 

if ! $connected; then

    createAdHocNetwork

fi


출처:

https://blog.psangwoo.com/rpi/2016/08/20/rpi-connect_wifi.html

태그
엮인글 :
List of Articles
번호 제목 글쓴이 날짜 조회 수

Mac os sierra(10.12.1) on LG 15nd530 file

  • tskit
  • 2016-12-12
  • 조회 수 40047

rpi serial clock file

  • tskit
  • 2016-10-14
  • 조회 수 5446

osx 10.10 on sense nt-p510 file

  • tskit
  • 2015-11-15
  • 조회 수 5313

해킨토시 설치(SUCCESS) file [1]

  • tskit
  • 2015-10-07
  • 조회 수 12876

Rpi3 auto ap mode.

  • tskit
  • 2014-12-08
  • 조회 수 6059

RPi Shutdown switch for safe. file

  • tskit
  • 2014-12-04
  • 조회 수 5180

inxi install [1]

  • tskit
  • 2014-12-04
  • 조회 수 6494

갤럭시노트 3100mah 배터리 file

  • tskit
  • 2013-04-22
  • 조회 수 5207

7인치 a13 tablet file

  • tskit
  • 2012-11-22
  • 조회 수 6064

옵티머스원 ku3700 V33 커널 컴파일 중... file

  • tskit
  • 2011-11-04
  • 조회 수 10010

옵티머스원 ku3700 file

  • tskit
  • 2011-11-04
  • 조회 수 7393

옴팝 커널 컴파일 file

  • tskit
  • 2011-10-02
  • 조회 수 8044

framework-res.apk수정하기

  • tskit
  • 2011-09-28
  • 조회 수 16242

initramfs 수정해보기

  • tskit
  • 2011-09-27
  • 조회 수 9752

갤럭시k 컴파일해보기

  • tskit
  • 2011-09-27
  • 조회 수 9415

갤럭시 안드로이드 오픈소스

  • tskit
  • 2011-09-11
  • 조회 수 9110

고런처 배경화면 file

  • tskit
  • 2011-09-10
  • 조회 수 11400

옴드로이드 file

  • tskit
  • 2011-09-10
  • 조회 수 9590

안드로이드 게시판을 생성합니다.

  • tskit
  • 2011-09-10
  • 조회 수 8006