Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 1 addition & 2 deletions .github/workflows/package_main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -63,9 +63,8 @@ jobs:
run: |
# zip up just the files we uploaded for the release
zip_name="wireless-debug-display-${{ matrix.build.name }}_$(git describe --tags --dirty).zip"
cd ${{ matrix.build.path }}
zip -r -j $zip_name build/*.bin build/*.elf build/bootloader/bootloader.bin build/partition_table/partition-table.bin build/flasher_args.json build/flash_args
echo "artifact_path=${{ matrix.build.path }}/$zip_name" >> "$GITHUB_ENV"
echo "artifact_path=$zip_name" >> "$GITHUB_ENV"

- name: Attach files to release
uses: softprops/action-gh-release@v2
Expand Down
136 changes: 125 additions & 11 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,16 +8,32 @@ will print the data to a text log for display.

https://github.com/esp-cpp/wireless-debug-display/assets/213467/f835922f-e17f-4f76-95ee-5d6585e84656

## Configuration

You'll need to configure the build using `idf.py set-target <esp32 or esp32s3>`
and then `idf.py menuconfig` to then set the `Wireless Debug Display
Configuration` which allows you to set which hardware you want to run it on, as
well as the WiFi Access Point connection information (ssid/password). It also
allows customization of the port of the UDP server that the debug display is
running.

## Use
<!-- markdown-toc start - Don't edit this section. Run M-x markdown-toc-refresh-toc -->
**Table of Contents**

- [Wireless Debug Display](#wireless-debug-display)
- [Description](#description)
- [Use](#use)
- [Program](#program)
- [Configure](#configure)
- [Sending Data to the Display](#sending-data-to-the-display)
- [Commands](#commands)
- [Plotting](#plotting)
- [Logging](#logging)
- [Development](#development)
- [Environment](#environment)
- [Build and Flash](#build-and-flash)
- [Output](#output)
- [Console Logs:](#console-logs)
- [Python script:](#python-script)
- [ESP32-WROVER-KIT](#esp32-wrover-kit)
- [LILYGO T-DECK](#lilygo-t-deck)
- [ESP32-S3-BOX](#esp32-s3-box)
- [ESP32-S3-BOX-3](#esp32-s3-box-3)

<!-- markdown-toc end -->

## Description

This code receives string data from a UDP server. It will parse that string data
and determine which of the following three types of data it is:
Expand All @@ -44,6 +60,86 @@ discovery using mDNS.
send messages or a file to the debug display. NOTE: zeroconf may not be
installed / accessible within the python environment used by ESP-IDF.

## Use

You must first program your hardware. Afterwards, you can configure it via a USB
connection using its built-in CLI.

### Program

Download the release `programmer` executable from the latest [releases
page](https://github.com/esp-cpp/wireless-debug-display/releases) for `windows`,
`macos`, or `linux` - depending on which computer you want to use to perform the
one-time programming. There are a few programmers pre-built for the
`ESP-BOX`, the `LilyGo T-Deck`, or the `ESP32-Wrover-Kit`.

1. Download the programmer
2. Unzip it
3. Double click the `exe` (if windows), or open a terminal and execute it from
the command line `./wireless-debug-display-<hardware>_programmer_v2.0.0_macos.bin`,
where hardware is one of `esp-box` or `t-deck` or `wrover-kit`.

### Configure

To configure it, simply connect it to your computer via USB and open the serial
port in a terminal (e.g. `screen`, `PuTTY`, etc.) at 115200 baud. Once there,
you can use it as you would any other CLI - and the `help` command will provide
info about the commands available.

Any SSID/Password you set will be securely saved in the board's NVS, which is
managed by the ESP-IDF WiFi subsystem.

![CleanShot 2025-06-25 at 09 42 28](https://github.com/user-attachments/assets/680f2dbc-e75a-4359-8e18-752df31c42bd)

```console
sta> help
Commands available:
- help
This help message
- exit
Quit the session
- log <verbosity>
Set the log verbosity for the wifi sta.
- connect
Connect to a WiFi network with the given SSID and password.
- connect <ssid> <password>
Connect to a WiFi network with the given SSID and password.
- disconnect
Disconnect from the current WiFi network.
- ssid
Get the current SSID (Service Set Identifier) of the WiFi connection.
- rssi
Get the current RSSI (Received Signal Strength Indicator) of the WiFi connection.
- ip
Get the current IP address of the WiFi connection.
- connected
Check if the WiFi is connected.
- mac
Get the current MAC address of the WiFi connection.
- bssid
Get the current BSSID (MAC addressof the access point) of the WiFi connection.
- channel
Get the current WiFi channel of the connection.
- config
Get the current WiFi configuration.
- scan <int>
Scan for available WiFi networks.
- memory
Display minimum free memory.
- switch_tab
Switch to the next tab in the display.
- clear_info
Clear the Info display.
- clear_plots
Clear the Plot display.
- clear_logs
Clear the Log display.
- push_data <data>
Push data to the display.
- push_info <info>
Push info to the display.
```

## Sending Data to the Display

This display is designed to receive data from any other device on the network,
Expand Down Expand Up @@ -97,7 +193,25 @@ All other text is treated as a log and written out to the log
window. Note, we do not wrap lines, so any text that would go off the
edge of the screen is simply not rendered.

## Build and Flash
## Development

You'll need to configure the build using `idf.py set-target <esp32 or esp32s3>`
and then `idf.py menuconfig` to then set the `Wireless Debug Display
Configuration` which allows you to set which hardware you want to run it on, as
well as the WiFi Access Point connection information (ssid/password). It also
allows customization of the port of the UDP server that the debug display is
running.

### Environment

This project is an ESP-IDF project, currently [ESP-IDF
v.5.4](https://github.com/espressif/esp-idf).

For information about setting up `ESP-IDF v5.4`, please see [the official
ESP-IDF getting started
documentation](https://docs.espressif.com/projects/esp-idf/en/v5.4/esp32s3/get-started/index.html).

### Build and Flash

Build the project and flash it to the board, then run monitor tool to view serial output:

Expand Down
8 changes: 8 additions & 0 deletions components/gui/include/graph_window.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,14 @@ class GraphWindow : public Window {
void add_data(const std::string &plot_name, int new_data);
void remove_plot(const std::string &plot_name);

lv_obj_t *get_lv_obj(void) { return wrapper_; }

void invalidate() {
if (wrapper_) {
lv_obj_invalidate(wrapper_);
}
}

protected:
lv_chart_series_t *create_plot(const std::string &plotName);
lv_chart_series_t *get_plot(const std::string &plotName);
Expand Down
3 changes: 3 additions & 0 deletions components/gui/include/gui.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,9 @@ class Gui {

void switch_tab();

void clear_plots();
void clear_logs();

void push_data(const std::string &data);
std::string pop_data();

Expand Down
8 changes: 8 additions & 0 deletions components/gui/include/text_window.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,14 @@ class TextWindow : public Window {
void clear_logs(void);
void add_log(const std::string &log_text);

lv_obj_t *get_lv_obj(void) { return log_container_; }

void invalidate() {
if (log_container_) {
lv_obj_invalidate(log_container_);
}
}

private:
std::string log_text_{""};
lv_obj_t *log_container_{nullptr};
Expand Down
2 changes: 2 additions & 0 deletions components/gui/src/graph_window.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -118,6 +118,8 @@ void GraphWindow::clear_plots(void) {
while (lv_spangroup_get_child(legend_, 0)) {
lv_spangroup_delete_span(legend_, lv_spangroup_get_child(legend_, 0));
}
// invalidate
invalidate();
}

void GraphWindow::add_data(const std::string &plotName, int newData) {
Expand Down
10 changes: 10 additions & 0 deletions components/gui/src/gui.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,16 @@ void Gui::clear_info() {
info_window_.clear_logs();
}

void Gui::clear_plots() {
std::lock_guard<std::recursive_mutex> lk{mutex_};
plot_window_.clear_plots();
}

void Gui::clear_logs() {
std::lock_guard<std::recursive_mutex> lk{mutex_};
log_window_.clear_logs();
}

void Gui::add_info(const std::string &info) {
std::lock_guard<std::recursive_mutex> lk{mutex_};
info_window_.add_log(info);
Expand Down
6 changes: 4 additions & 2 deletions components/gui/src/text_window.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -14,10 +14,12 @@ void TextWindow::init(lv_obj_t *parent, size_t width, size_t height) {
}

void TextWindow::clear_logs(void) {
// clear all the logs off the page
lv_obj_clean(log_container_);
// set the string to the display
lv_label_set_text(log_container_, "");
// now empty the string
log_text_.clear();
// invalidate
invalidate();
}

void TextWindow::add_log(const std::string &log_text) {
Expand Down
Loading