Skip to main content

Create a WiFi Access Point and Control LED with the Glyph C3

Introduction

This guide will help you set up a WiFi access point using the GLYPH-C3 board, generate an IP address, and control switches via a web interface. Follow these steps carefully to ensure a smooth setup process. Glyph C3 as a Soft Access Point: A Soft Access Point (SoftAP) is a mode in which a Wi-Fi-enabled device, like the Glyph C3, creates its own wireless network, allowing other devices to connect directly to it without needing a router or external access point. This is different from the typical “station” mode, where the Glyph C3 connects to an existing network as a “client”. Key Features of SoftAP are:
  1. Direct Network Creation: The device generates its own Wi-Fi network (SSID) and can assign IP addresses to connected devices, creating a small, standalone network.
  2. Local Communication: Devices that connect to the SoftAP can communicate directly with it and with each other, enabling a range of applications without internet connectivity.
  3. Limited Range and Clients: SoftAPs are usually designed for local, small-scale connections and typically support fewer devices and have shorter ranges than traditional access points.
SoftAP is useful for Applications like:
  • Configuration Portals: Allowing users to configure IoT devices over Wi-Fi.
  • Local Data Exchange: For Smart Home setups or sensor data exchanges without internet.
  • Mobile Hotspots: Enabling one device to share its network connection with others.
For example, when using the Glyph C3 as a SoftAP, other devices like smartphones can connect to it, and you can access a web server running on the Glyph C3 to serve pages, collect data, or adjust settings locally.

Step 1: Hardware Required

  1. GLYPH-C3 Board
  2. External LED (Optional, as in this documentation we control only the GLYPH-C3 Onboard LED)

Step 2: Set Up the WiFi Access Point

Copy the Code

  1. Open Arduino IDE.
  2. Copy and paste the following code into the Arduino IDE:

Step 3: Upload the Code

  1. Upload the Code
  • Click the upload button (➡️ icon) or use the shortcut CTRL + U in Arduino IDE to upload the code to the board.

Step 4: Open the Serial Monitor to Check the IP Address

    • After uploading the code, open the Serial Monitor by clicking on the magnifying glass icon in the top right corner of Arduino IDE or by going to Tools > Serial Monitor.
  1. Set the Baud Rate
    • Ensure the baud rate is set to 115200.
  2. Check for IP Address
    • The Serial Monitor will display the IP address assigned to your WiFi access point. It will look something like 192.168.4.1.
pcbcupid_wifiaccess

Step 5: Connect to the WiFi Network

  1. Open WiFi Settings
    • On your computer or smartphone, go to the WiFi settings.
  2. Find Your Network
    • Look for the SSID you set in the code (e.g., Enter User SSID).
  3. Connect
    • Select the network and enter the password you set in the code.

Step 6: Control the LEDs via Web Interface

  1. Open a Web Browser
    • Open a web browser on your computer or smartphone.
  2. Enter the IP Address
    • In the address bar, enter the IP address displayed in the Serial Monitor (e.g., 192.168.4.1).
  3. Control the LEDs
    • You will see a web interface with buttons to control the onboard and external LEDs.
    • Click the buttons to turn the LEDs on and off.
pcbcupid_wifiaccesspoint

Step 7: Observe the Output States of the Glyph_C3_onboard_led on the Serial Monitor

pcbcupid_wifiaccess pcbcupid_wifiaccess pcbcupid_wifiaccess pcbcupid_wifiaccess