This is an old revision of the document!
How to configure built-in WIFI module
This wiki page will be updated soon!!! (2020.05.21)
This wiki page describes wifi setting instructions and available with OGA HW Rev 1.1 only.
- WIFI KEY Features
- Configuring WIFI station mode (1) - using [Configuration] Menu
- Configuring WIFI station mode (2) - using command line
- Configuring WIFI AP mode
- Checking basic connection
- Configuring Suspend/Resume
WIFI Key Features
- ESP-WROOM-S2 that integrates ESP8266EX
- WIFI Protocol : 802.11 b/g/n
- Frequency Range : 2.4 GHz ~ 2.5 GHz (2400 MHz ~ 2483.5 MHz)
- SDIO interface up to 50 MHz, SDIO v2.0
Configuring WIFI station mode (1) - using [Configuration] Menu
You can activate WIFI connection with built-in WIFI module ('wlan0' node) using [CONFIGURATION] menu of Emulationstation.
Please refer to this wiki page.
-> Setting Network
Configuring WIFI station mode (2) - using command line
Or you can establish WIFI network using the following instuctions.
First, check esp8089 module is loaded normally.
- target
$ lsmod Module Size Used by esp8089 266240 0 sch_fq_codel 20480 5 ip_tables 24576 0 x_tables 32768 1 ip_tables ipv6 372736 24
Turn on wifi radio.
- target
# nmcli radio wifi on
You can get all available WIFI list as following.
- target
$ nmcli dev wifi list IN-USE SSID MODE CHAN RATE SIGNAL BARS SECURITY SSID_1 Infra 1 130 Mbit/s 92 ▂▄▆█ WPA1 WPA2 SSID_2 Infra 11 130 Mbit/s 92 ▂▄▆█ WPA2 802.1 SSID_3 Infra 11 130 Mbit/s 92 ▂▄▆█ WPA2
Enter SSID and password data.
- target
$ nmcli dev wifi con 'SSID_1' password 'password_of_ssid1'
If there is no issue during network establishment, you will get IP information.
- target
$ ip addr 1: lo: <LOOPBACK,UP,LOWER_UP> mtu 65536 qdisc noqueue state UNKNOWN group default qlen 1 link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00 inet 127.0.0.1/8 scope host lo valid_lft forever preferred_lft forever inet6 ::1/128 scope host valid_lft forever preferred_lft forever 2: wlan0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc mq state UP group default qlen 1000 link/ether ab:cd:ef:12:34:56 brd ff:ff:ff:ff:ff:ff inet 192.168.0.5/24 brd 192.168.0.255 scope global dynamic noprefixroute wlan0 valid_lft 6830sec preferred_lft 6830sec inet6 fe80::1234:1234:1234:1234/64 scope link noprefixroute valid_lft forever preferred_lft forever
Then, check ping operation.
- target
$ ping google.com
Configuring WIFI AP mode
1. Update & Upgrade
- target
$ sudo apt update -y $ sudo apt upgrade -y
2. Install Packages
- target
$ sudo apt install -y dhcpcd5 $ sudo apt install -y hostapd dnsmasq
Since the configurations are not ready yet, so display related services now.
- target
$ sudo systemctl disable hostapd $ sudo systemctl disable dnsmasq
3. Setup (1) - Configuration a static IP
To configure the static IP address, please edit a dhcpcd configuration file, /etc/dhcpcd.conf.
Go to the end fo this file and add the following lines.
For this example, we will use a static IP, 192.168.4.1.
- target
$ vi /etc/dhcpcd.conf
- target
interface wlan0 static ip_address=192.168.4.1/24 nohook wpa_supplicant
4. Setup (2) : Configuring the access point host software - 'hostapd'
(1) You need to edit the hostapd configuration file in /etc/hostapd.
- target
$ vi /etc/hostapd/hostapd.conf
- target
interface=wlan0 driver=nl80211 ssid=${NameOfNetwork} hw_mode=${hw_mode} channel=7 wmm_enabled=0 macaddr_acl=0 auth_algs=1 ignore_broadcast_ssid=0 wpa=2 wpa_passphrase=${password} wpa_key_mgmt=WPA-PSK wpa_pairwise=TKIP rsn_pairwise=CCMP
ESP8266ex supports 2.4GHz band, so we will set 'hw_mode' ad 'g' for this example.
- a = IEEE 802.11a (5 GHz)
- b = IEEE 802.11b (2.4 GHz)
- g = IEEE 802.11g (2.4 GHz)
- ad = IEEE 802.11ad (60 GHz)
(2) Then need to tell the system where to find this configuration file.
- target
$ vi /etc/default/hostapd
- target
DAEMON_CONF="/etc/hostapd/hostapd.conf"
5. Setup (3) : Configuring DHCP server - 'dnsmasq'
Add the following information in the dnsmasq configuration file, /etc/dnsmasq.conf.
- target
$ vi /etc/dnsmasq.conf
- target
# If you don't want dnsmasq to read /etc/resolv.conf or any other # file, getting its servers from this file instead (see below), then # uncomment this. no-resolv # If you want dnsmasq to listen for DHCP and DNS requests only on # specified interfaces (and the loopback) give the name of the # interface (eg eth0) here. # Repeat the line for more than one interface. interface=wlan0 # On systems which support it, dnsmasq binds the wildcard address, # even when it is listening on only some interfaces. It then discards # requests that it shouldn't reply to. This has the advantage of # working even when interfaces come and go and change address. If you # want dnsmasq to really bind only the interfaces it is listening on, # uncomment this option. About the only time you may need this is when # running another nameserver on the same machine. bind-interfaces # Uncomment this to enable the integrated DHCP server, you need # to supply the range of addresses available for lease and optionally # a lease time. If you have more than one network, you will need to # repeat this for each network on which you want to supply DHCP # service. dhcp-range=192.168.4.3,192.168.4.20,12h
6. Setup (4) : Configuring network
Create /etc/network/interfaces.
Make sure that 3rd line is blocked using “#”.
- target
allow-hotplug wlan0 iface wlan0 inet manual # wpa-conf /etc/wpa_supplicant/wpa_supplicant.conf
7. Start services
- target
$ sudo systemctl enable dnsmasq $ sudo systemctl start dnsmasq $ sudo systemctl enable hostapd $ sudo systemctl start hostapd
- target
$ ip addr 1: lo: <LOOPBACK,UP,LOWER_UP> mtu 65536 qdisc noqueue state UNKNOWN group default qlen 1 link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00 inet 127.0.0.1/8 scope host lo valid_lft forever preferred_lft forever inet6 ::1/128 scope host valid_lft forever preferred_lft forever 2: wlan0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc mq state UP group default qlen 1000 link/ether ab:cd:ef:12:34:56 brd ff:ff:ff:ff:ff:ff inet 192.168.4.1/24 brd 192.168.4.255 scope global noprefixroute wlan0 valid_lft forever preferred_lft forever inet6 fe80::1234:1234:1234:1234/64 scope link valid_lft forever preferred_lft forever
Checking basic connection
mmc1 node
- target
$ cat /sys/kernel/debug/mmc1/ios clock: 50000000 Hz vdd: 21 (3.3 ~ 3.4 V) bus mode: 2 (push-pull) chip select: 0 (don't care) power mode: 2 (on) bus width: 2 (4 bits) timing spec: 2 (sd high-speed) signal voltage: 0 (3.30 V) driver type: 0 (driver type B)
sdio id
- target
$ cat /sys/bus/sdio/devices/mmc1\:0001\:1/modalias sdio:c00v6666d1111
module
- target
$ lsmod Module Size Used by esp8089 266240 0 sch_fq_codel 20480 5 ip_tables 24576 0 x_tables 32768 1 ip_tables ipv6 372736 24
Configuring Suspend/Resume
/lib/systemd/system-sleep/sleep
#!/bin/bash case $1 in pre) rmmod esp8089 ;; post) modprobe -i esp8089 ;; esac
- target
$ sudo chmod a+x /lib/systemd/system-sleep/sleep