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.

  1. WIFI KEY Features
  2. Checking basic connection
  3. Configuring WIFI station mode (1) - using [Configuration] Menu
  4. Configuring WIFI station mode (2) - using command line
  5. Configuring WIFI AP mode
  6. Configuring Suspend/Resume
  • 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

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

Turn on radio.

# nmcli radio wifi on

Check wifi list.

$ 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     

Add connection.

$ nmcli dev wifi con 'SSID_1' password 'password_of_ssid1'

Check ip configuration.

$ 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.

$ ping google.com

1. Update & Upgrade

$ sudo apt update -y
$ sudo apt upgrade -y

2. Install Packages

$ sudo apt install -y dhcpcd5
$ sudo apt install -y hostapd dnsmasq

Since the configurations are not ready yet, so display related services now.

$ 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.

$ vi /etc/dhcpcd.conf
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.

$ vi /etc/hostapd/hostapd.conf
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.

$ vi /etc/default/hostapd
# DAEMON_CONF=""
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.

#stop DNSmasq from using resolv.conf
no-resolv
#Interface to use
interface=wlan0
bind-interfaces
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 “#”.

allow-hotplug wlan0
iface wlan0 inet manual
#    wpa-conf /etc/wpa_supplicant/wpa_supplicant.conf

7. Start services

$ service dnsmasq start
$ service hostapd start

mmc1 node

$ 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

$ cat /sys/bus/sdio/devices/mmc1\:0001\:1/modalias 
sdio:c00v6666d1111

module

$ 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

/lib/systemd/system-sleep/sleep

#!/bin/bash

case $1 in
  pre)
       rmmod esp8089
       ;;
  post)
       modprobe -i esp8089
       ;;
esac
$ sudo chmod a+x /lib/systemd/system-sleep/sleep