반응형
라즈베리파이에서 WiFi 통신 연결이 가능하다.
아래 경로를 통해 vi 에디터 접속
sudo vi /etc/wpa_supplicant/wpa_supplicant.confp
공유기 or 스마트폰 핫스팟 등 ssid 와 password 정보를 아래와 같이 적는다.
ctrl_interface=DIR=/var/run/wpa_supplicant GROUP=netdev
update_config=1
country=GB
network={
ssid="devk"
psk="********"
key_mgmt=WPA-PSK
}
WiFi 연결 유무를 확인하기 위해 아래 명령어를 진행한다.
ifconfig
아래와 같이 wlan0 확인 가능
lo: flags=73<UP,LOOPBACK,RUNNING> mtu 65536
inet 127.0.0.1 netmask 255.0.0.0
inet6 ::1 prefixlen 128 scopeid 0x10<host>
loop txqueuelen 1000 (Local Loopback)
RX packets 4 bytes 236 (236.0 B)
RX errors 0 dropped 0 overruns 0 frame 0
TX packets 4 bytes 236 (236.0 B)
TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0
wlan0: flags=4163<UP,BROADCAST,RUNNING,MULTICAST> mtu 1500
inet 192.168.43.43 netmask 255.255.255.0 broadcast 192.168.43.255
inet6 fe80::dea6:32ff:fe9e:3abc prefixlen 64 scopeid 0x20<link>
inet6 2001:2d8:e994:2db3:dea6:32ff:fe9e:3abc prefixlen 64 scopeid 0x0<global>
ether dc:a6:32:9e:3a:bc txqueuelen 1000 (Ethernet)
RX packets 662 bytes 49639 (48.4 KiB)
RX errors 0 dropped 0 overruns 0 frame 0
TX packets 627 bytes 113201 (110.5 KiB)
TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0
아래 명령어를 통해 script 진입 후 아래 정보를 입력한다. 그리고 재부팅을 진행
sudo vi /etc/network/interfaces
# interfaces(5) file used by ifup(8) and ifdown(8)
# Please note that this file is written to be used with dhcpcd
# For static IP, consult /etc/dhcpcd.conf and 'man dhcpcd.conf'
# Include files from /etc/network/interfaces.d:
source-directory /etc/network/interfaces.d
auto lo
iface lo inet loopback
iface eth0 inet manual
allow-hotplug wlan0
iface wlan0 inet static
wpa-conf /etc/wpa_supplicant/wpa_supplicant.conf
address 192.168.43.43
netmask 255.255.255.0
gateway 192.168.43.1
network 192.168.43.0
broadcast 192.168.43.255
반응형
'Embedded > Raspberry Pi' 카테고리의 다른 글
[Raspberry Pi] 라즈베리파이 apt-get update upgrade 문제 해결하기 (0) | 2022.01.20 |
---|---|
[Raspberry Pi] 라즈베리파이 WiFi 끊김 문제 해결하기 2 (0) | 2022.01.20 |
[Raspberry Pi] 라즈베리파이 WiFi 끊김 문제 해결하기 (0) | 2022.01.20 |
[Raspberry Pi] 라즈비안 이미지 다운로드 및 쓰기 (0) | 2022.01.18 |
[Raspberry Pi] 라즈베리파이4 Model B 4GB 키트 구성 (0) | 2022.01.16 |