Skip to content

ESP32-7SEG: An embedded clock with network setup

ESP32-7SEG connects an ESP32 clock display to network configuration and an HTTP interface. The firmware startup decides whether saved Wi-Fi settings can be reused or whether the device needs its setup path.

Hardware and graphics
  • Updated
  • 1
  • Kotlin · 58.26%
  • MIT
Repository languagesKotlin 58.26%3

Shares calculated from GitHub Linguist bytes.

Language%Bytes
Kotlin58.26%62,877
C++39.56%42,693
C2.18%2,350

GitHub · README · Language statistics

Overview

Why it exists

Embedded microcontroller firmware and mobile controller for driving multi-digit 7-segment displays.

Best fit

Physical computing status dashboards and hardware displays.

Getting started

These commands come from the repository documentation. They were not run during this review.

Repository references

Excerpts from the repository’s guides, in their original language. Links open the inspected source revision.

Prerequisites and first run

Prerequisites

README.md

  • Hardware: ESP32 FireBeetle board (v1.0), Adafruit 7-segment display (I2C backpack), breadboard, and jumper wires.
  • Software: Git, PlatformIO or Arduino IDE, and necessary ESP32 libraries.
Read the full instructions ↗

Software Installation

README.md

  1. Clone the Repository:
  2. Open and Configure the Project: Load the project into PlatformIO or the Arduino IDE. Install any required libraries as specified in platformio.ini or the project documentation.
  3. Upload to the ESP32: Compile and upload the code to your ESP32 board to start the project.
Read the full instructions ↗

Prerequisites

readme.md

Hardware: ESP32 FireBeetle board (v1.0), Adafruit 7-segment display (I2C backpack), breadboard, and jumper wires. Software: Git, PlatformIO or Arduino IDE, and necessary ESP32 libraries.
Read the full instructions ↗

Software Installation

readme.md

  1. Clone the repository to your local machine.
  2. Open the project with your preferred IDE or editor that supports PlatformIO or the Arduino IDE.
  3. Install the necessary libraries mentioned in the platformio.ini file or the Arduino project.
  4. Upload the code to your ESP32 FireBeetle board.
Read the full instructions ↗
Configuration and usage

Hardware Setup

README.md

  1. Display Connections: Connect the Adafruit 7-segment display to the ESP32 using the I2C interface. Make sure to connect the SCL and SDA pins correctly, along with VCC and GND for power.
  2. Power Supply: Power the ESP32 board through USB or an external power supply to ensure stable operation.
Read the full instructions ↗

Usage

README.md

  • Access the Web Server: After booting, the ESP32 launches a web server. Find its IP address in the serial monitor and navigate to it using a web browser.
  • Update Display via Web Interface: Use the web interface to input and submit the content you want to be displayed. The ESP32 will update the 7-segment display in real-time.
Read the full instructions ↗

Hardware Setup

readme.md

  1. Connect the 7-segment display to the ESP32 according to the provided wiring diagram.
  2. Ensure a stable power supply for the ESP32 board.
Read the full instructions ↗

Usage

readme.md

After uploading the code to your ESP32 board:

  1. Connect the ESP32 to a power source.
  2. The ESP32 starts a web server accessible within your local network.
  3. Find the ESP32’s IP address from your serial monitor and visit the provided IP using a web browser.
  4. Use the web interface to update the 7-segment display’s content.
Read the full instructions ↗
Development and contributions

Contributing

README.md

We welcome contributions! If you have suggestions for improvements or find a bug, please feel free to fork the repository, make your changes, and submit a pull request.
Read the full instructions ↗

Contributing

readme.md

Contributions to improve the project are welcome. Please feel free to fork the repository and submit pull requests.
Read the full instructions ↗
Source documentation

2 documents read from 2 candidates.

Features and components 2

Boot and connectivity
setup initializes NVS and checks its result. It loads saved credentials, attempts a connection and falls back to setupWiFi if needed. The same fallback runs when no saved credentials exist.
Display and web modules
After connectivity setup, main.cpp calls startClockDisplay and setupWebServer. display.cpp, wifi.cpp and web_server.cpp keep hardware display, connection management and HTTP handling in separate modules.

Architecture

The components and their connections remain available as text. The diagram adds an interactive view.

System context Context
  1. ESP32 boot
  2. NVS saved settings
  3. Connect or setup Wi-Fi
  4. Clock display
  5. HTTP interface

Links verified in the repository.

Mermaid Interactive diagram (loads on open)

System overview of the components and connections verified in the repository.

Static architecture view for ESP32-7SEG
Static preview. The interactive diagram replaces it after Mermaid loads.
flowchart LR

subgraph group_firmware["ESP32 firmware"]
  node_boot["Firmware startup<br/>[main.cpp]"]
  node_wifi["Wi-Fi setup<br/>[wifi.cpp]"]
  node_credentials[("Wi-Fi credentials<br/>[wifi.cpp]")]
  node_timer_display["Timer display<br/>[display.cpp]"]
end

subgraph group_web["Web control"]
  node_http_server["HTTP and WebSocket server<br/>[web_server.cpp]"]
  node_web_pages["Browser interface<br/>[web_page.h]"]
end

subgraph group_android["Android app"]
  node_android_entry["Android navigation<br/>[MainActivity.kt]"]
  node_timer_ui["Timer controls"]
  node_wifi_ui["Wi-Fi onboarding"]
  node_settings_ui["Settings"]
  node_browser_ui["Embedded browser view"]
  node_stop_receiver["Timer stop receiver"]
  node_settings_adapter["Settings list adapter<br/>[SettingsAdapter.kt]"]
end

subgraph group_android_net["Android networking"]
  node_timer_api["Timer API contract<br/>[TimerApiService.kt]"]
  node_retrofit["HTTP client setup"]
  node_ws_client["WebSocket client<br/>[WebSocketClient.kt]"]
  node_preferences[("App preferences")]
end

node_operator(("User"))
node_browser(("Browser"))
node_display_hw{{"7-segment display"}}

node_operator -->|"controls"| node_browser
node_browser -->|"submits controls"| node_http_server
node_boot -->|"loads or configures"| node_wifi
node_boot -->|"starts display"| node_timer_display
node_boot -->|"starts server"| node_http_server
node_wifi -->|"reads and writes"| node_credentials
node_http_server -->|"handles Wi-Fi routes"| node_wifi
node_http_server -->|"dispatches timer updates"| node_timer_display
node_http_server -->|"serves pages"| node_web_pages
node_timer_display -->|"drives display"| node_display_hw
node_operator -.->|"uses app"| node_android_entry
node_timer_ui -->|"requests timer actions"| node_retrofit
node_timer_ui -->|"opens timer socket"| node_ws_client
node_wifi_ui -->|"sends credentials"| node_retrofit
node_settings_ui -->|"uses adapter"| node_settings_adapter
node_settings_ui -->|"loads device data"| node_retrofit
node_retrofit -->|"creates service"| node_timer_api
node_retrofit -->|"initializes preferences"| node_preferences
node_timer_ui -->|"registers timer events"| node_stop_receiver
node_timer_api -.->|"calls matching routes"| node_http_server
node_ws_client -.->|"connects to socket"| node_http_server


class node_boot,node_wifi,node_credentials,node_timer_display,node_operator,node_browser toneBlue
class node_http_server,node_web_pages toneAmber
class node_android_entry,node_timer_ui,node_wifi_ui,node_settings_ui,node_browser_ui,node_stop_receiver,node_settings_adapter toneMint
class node_timer_api,node_retrofit,node_ws_client,node_preferences toneRose
class node_display_hw toneIndigo

ESP32 firmware for a network-controlled seven-segment timer with an Android companion app. Firmware startup loads Wi-Fi, starts the display and web server, while browser and Android controls send timer and onboarding requests.

Components
20
Connections
21
Links supported by code or README
18/21
Text version of the diagram
  • ESP32 boot → NVS saved settings
  • NVS saved settings → Connect or setup Wi-Fi
  • Connect or setup Wi-Fi → Clock display
  • Connect or setup Wi-Fi → HTTP interface
Follow one path through the code

Follow the saved-credentials branch in setup. A stored network is attempted first, but failure still reaches setupWiFi. Only after that branch does the code start the display and web server.

Types and file structure

21 declared types, with 12 in the base-relationship overview.

Type diagram
classDiagram
direction TB
class t0f7089087495["Callbacks"] {
  <<struct>>
}
class tc0b1722c8a7f["ExampleInstrumentedTest"] {
  useAppContext()
}
class taaaa0937cb8a["ExampleInstrumentedTest"] {
  useAppContext()
}
class t0fd594821bdd["MainActivity"] {
  onCreate()
  setupNavigationUI()
  hasPermissions()
  onRequestPermissionsResult()
}
class tf36f30cd8e65["SettingsAdapter"] {
  onCreateViewHolder()
  onBindViewHolder()
  getItemCount()
}
class tb59d4cfbe0b1["SettingsViewHolder"] {
}
class tc5d344b351ed["SettingItem"] {
}
class tce24fcf8fc6e["TimerApiService"] {
  performTimerAction()
  resetWifiCredentials()
  connectToWiFi()
  scanForNetworks()
}
class t64725d5d3582["WebSocketClient"] {
  connect()
  send()
  close()
}
class t181736c31b5e["WebSocketEventListener"] {
  onOpen()
  onMessage()
  onClosing()
  onFailure()
}
class tf5e33f3603df["PreferencesHelper"] {
}
class t1902f7090575["SettingsFragment"] {
  onCreateView()
  onViewCreated()
  fetchDeviceInfo()
  checkWifiPermissionAndFetchSSID()
}
class b4be9ca085545["AppCompatActivity"] {
  <<unresolved_base>>
}
t0fd594821bdd ..> b4be9ca085545 : declared base
class bc58b80af594e["RecyclerView"] {
  <<unresolved_base>>
}
tf36f30cd8e65 ..> bc58b80af594e : declared base
tb59d4cfbe0b1 ..> bc58b80af594e : declared base
class b995bb1f4b9f4["Fragment"] {
  <<unresolved_base>>
}
t1902f7090575 ..> b995bb1f4b9f4 : declared base

Unresolved bases remain labelled; full signatures are not reconstructed.

Type index

Reference

36 / 36 eligible files read (113 in the tree); 0 oversized, 0 failed reads and 1 syntax diagnostics.

What the scan covers

Known dependency/build folders, credential files and binaries are excluded. The scan covers READMEs, recognized manifests and parser-supported source files.

Linguist statistics cover the whole repository and may include other languages.

File map
flowchart TD
  root["ESP32-7SEG"]
  f0["platformio.ini"]
  root --> f0
  f1["src/display.cpp"]
  root --> f1
  f2["src/main.cpp"]
  root --> f2
  f3["src/web_server.cpp"]
  root --> f3
  f4["README.md"]
  root --> f4
  f5["readme.md"]
  root --> f5
  f6["android/build.gradle.kts"]
  root --> f6
  f7["include/README"]
  root --> f7
  f8["include/ble.h"]
  root --> f8
  f9["include/config.h"]
  root --> f9
  f10["include/display.h"]
  root --> f10
  f11["include/web_page.h"]
  root --> f11
  f12["include/web_server.h"]
  root --> f12
  f13["include/wifi.h"]
  root --> f13
  f14["lib/README"]
  root --> f14
  f15["src/ble.cpp"]
  root --> f15

Files to read 4

References