WiFi & Bluetooth

The Nagami System-on-Module features an integrated ESP32 module that provides both WiFi and Bluetooth functionality. The ESP32 communicates with the main processor via UART and SDIO, and runs the Espressif esp-hosted-ng firmware. All required kernel modules are preloaded in the default system image. This guide outlines how to connect to a WiFi network using NetworkManager and how to manage Bluetooth connections via bluetoothctl.

Key Features

  • WiFi Interface: Exposed as wlan0 via esp-hosted-ng
  • Bluetooth Interface: Listed as hci0
  • Firmware: Runs Espressif’s esp-hosted-ng firmware stack

Using WiFi with NetworkManager

The Nagami module leverages NetworkManager to manage WiFi connectivity. Here’s how to connect your device to a wireless network and verify access.

Checking the WiFi Interface

First, confirm that the ESP32 WiFi interface is available:

nmcli device status

If the wlan0 interface is listed as disconnected or unavailable, you may need to manually bring it up:

ip link set wlan0 up

Scanning for Available Networks

To list nearby WiFi networks:

nmcli device wifi list

This will show available SSIDs. Choose the one you want to connect to.

Connecting to a WiFi Network

Use the following command to initiate a connection:

nmcli device wifi connect "<SSID>" password "<password>"

Replace <SSID> and <password> with the appropriate credentials. Once connected, you can confirm the active connection with:

nmcli connection show

Verifying Internet Access

Test network connectivity by pinging a public DNS server:

ping 8.8.8.8

A successful response confirms both connection and routing.

Using Bluetooth (hci0)

The ESP32 also enables Bluetooth functionality, accessible via the hci0 interface and managed by the BlueZ stack.

Bringing Up the Bluetooth Interface

To activate the Bluetooth controller:

hciconfig hci0 up

Scanning for Bluetooth Devices

Search for nearby devices:

hcitool scan

Note the MAC address of any device you'd like to pair with.

Pairing with a Bluetooth Device

Use bluetoothctl to interactively manage devices:

bluetoothctl

Once inside:

agent on
default-agent
scan on

When your device appears:

pair XX:XX:XX:XX:XX:XX
connect XX:XX:XX:XX:XX:XX
trust XX:XX:XX:XX:XX:XX
exit

Replace XX:XX:XX:XX:XX:XX with the actual MAC address.

Verifying the Bluetooth Connection

Check Bluetooth status with:

hciconfig hci0

This command will show link status and active connections.

Summary

The Nagami module provides seamless WiFi and Bluetooth connectivity via its onboard ESP32. Whether you’re provisioning a wireless connection or pairing with Bluetooth devices, standard Linux tools like NetworkManager and bluetoothctl make setup straightforward. This dual-mode wireless capability is well-suited for embedded projects requiring remote communication or local wireless interaction.

For deeper integration, refer to: