|
1 |
| -# ESP++ Template |
| 1 | +# Wireless Debug Display |
| 2 | + |
| 3 | +This repository contains an example application designed for either |
| 4 | +ESP32-WROVER-KIT or ESP32-S3-BOX (selectable via menuconfig) which listens on a |
| 5 | +UDP socket for data. It then parses that data and if it matches a certain |
| 6 | +format, it will plot the data in a graph, otherwise it will print the data to a |
| 7 | +text log for display. |
| 8 | + |
| 9 | +https://github.com/esp-cpp/wireless-debug-display/assets/213467/f835922f-e17f-4f76-95ee-5d6585e84656 |
| 10 | + |
| 11 | +## Configuration |
| 12 | + |
| 13 | +You'll need to configure the build using `idf.py set-target <esp32 or esp32s3>` |
| 14 | +and then `idf.py menuconfig` to then set the `Wireless Debug Display |
| 15 | +Configuration` which allows you to set which hardware you want to run it on, as |
| 16 | +well as the WiFi Access Point connection information (ssid/password). It also |
| 17 | +allows customization of the port of the UDP server that the debug display is |
| 18 | +running. |
| 19 | + |
| 20 | +## Use |
| 21 | + |
| 22 | +This code receives string data from a UDP server. It will parse that string data |
| 23 | +and determine which of the following three types of data it is: |
| 24 | + |
| 25 | +* *Commands*: contain the prefix (`+++`) in the string. |
| 26 | +* *Plot data*: contain the delimiter (`::`) in the string followed by a |
| 27 | + single value which can be converted successfully to a number. If the |
| 28 | + conversion fails, the message will be printed as a log. |
| 29 | +* *Log / text data*: all data that is not a command and cannot be |
| 30 | + plotted. |
| 31 | + |
| 32 | +They are parsed in that priority order. |
| 33 | + |
| 34 | +Some example data (no commands) can be found in [test_data.txt](./test_data.txt). |
| 35 | + |
| 36 | +A couple python scripts are provided for sending data from a computer to your |
| 37 | +logger to showcase simple UDP socket sending, as well as automatic service |
| 38 | +discovery using mDNS. |
| 39 | + |
| 40 | +- [./send_to_display.py](./send_to_display.py): Uses simple UDP sockets to send |
| 41 | + messages or a file to the debug display. |
| 42 | +- [./send_to_display_mdns.py](./send_to_display_mdns.py): Uses python's |
| 43 | + `zeroconf` package to discover the wireless display on the network and then |
| 44 | + send messages or a file to the debug display. NOTE: zeroconf may not be |
| 45 | + installed / accessible within the python environment used by ESP-IDF. |
| 46 | + |
| 47 | +## Sending Data to the Display |
| 48 | + |
| 49 | +This display is designed to receive data from any other device on the network, |
| 50 | +though it is primarily intended for other embedded wireless devices such as |
| 51 | +other ESP-based systems. However, I have provided some scripts to help show how |
| 52 | +data can be sent from computers or other systems if you choose. |
| 53 | + |
| 54 | +Assuming that your computer is also on the network (you'll need to replace the |
| 55 | +IP address below with the ip address displayed in the `info` page of the |
| 56 | +display if you don't use the mDNS version): |
| 57 | + |
| 58 | +```console |
| 59 | +# this python script uses mDNS to automatically find the display on the network |
| 60 | +python ./send_to_display_mdns.py --file <file> |
| 61 | +python ./send_to_display_mdns.py --message "<message 1>" --message "<message 2>" ... |
| 62 | +# e.g. |
| 63 | +python ./send_to_display_mdns.py --file test_data.txt |
| 64 | +python ./send_to_display_mdns.py --message "Hello world" --message "trace1::0" --message "trace1::1" --message "Goodbye World" |
| 65 | + |
| 66 | +# this python script uses raw UDP sockets to send data to the display on the network |
| 67 | +python ./send_to_display.py --ip <IP Address> --port <port, default 5555> --file <file> |
| 68 | +python ./send_to_display.py --ip <IP Address> --port <port, default 5555> --message "<message 1>" --message "<message 2>" ... |
| 69 | +# e.g. |
| 70 | +python ./send_to_display.py --ip 192.168.1.23 --file additional_data.txt |
| 71 | +python ./send_to_display.py --ip 192.168.1.23 --message "Hello world" --message "trace1::0" --message "trace1::1" --message "Goodbye World" |
| 72 | +``` |
| 73 | + |
| 74 | +### Commands |
| 75 | + |
| 76 | +There are a limited set of commands in the system, which are |
| 77 | +determined by a prefix and the command itself. If the prefix is found |
| 78 | +_ANYWHERE_ in the string message (where messages are separated by |
| 79 | +newlines), then the message is determined to be a command. |
2 | 80 |
|
3 |
| -Template repository for building an ESP app with ESP++ (espp) components and |
4 |
| -ESP-IDF components. |
| 81 | +**PREFIX:** `+++` - three plus characters in a row |
5 | 82 |
|
6 |
| -## Development |
| 83 | +* **Remove Plot:** this command (`RP:` followed by the string plot name) will remove the named plot from the graph. |
| 84 | +* **Clear Plots:** this command (`CP`) will remove _all_ plots from the graph. |
| 85 | +* **Clear Logs:** this command (`CL`) will remove _all_ logs / text. |
7 | 86 |
|
8 |
| -This repository is designed to be used as a template repository - so you can |
9 |
| -sepcify this as the template repository type when creating a new repository on |
10 |
| -GitHub. |
| 87 | +### Plotting |
11 | 88 |
|
12 |
| -After setting this as the template, make sure to update the following: |
13 |
| -- [This README](./README.md) to contain the relevant description and images of your project |
14 |
| -- The [./CMakeLists.txt](./CMakeLists.txt) file to have the components that you |
15 |
| - want to use (and any you may have added to the [components |
16 |
| - folder](./components)) as well as to update the project name |
17 |
| -- The [./main/main.cpp](./main/main.cpp) To run the main code for your app. The |
18 |
| - [main folder](./main) is also where you can put additional header and source |
19 |
| - files that you don't think belong in their own components but help keep the |
20 |
| - main code clean. |
| 89 | +Messages which contain the string `::` and which have a value that |
| 90 | +successfully and completely converts into a number are determined to |
| 91 | +be a plot. Plots are grouped by their name, which is any string |
| 92 | +preceding the `::`. |
| 93 | + |
| 94 | +### Logging |
| 95 | + |
| 96 | +All other text is treated as a log and written out to the log |
| 97 | +window. Note, we do not wrap lines, so any text that would go off the |
| 98 | +edge of the screen is simply not rendered. |
21 | 99 |
|
22 | 100 | ## Cloning
|
23 | 101 |
|
@@ -51,6 +129,22 @@ See the Getting Started Guide for full steps to configure and use ESP-IDF to bui
|
51 | 129 |
|
52 | 130 | ## Output
|
53 | 131 |
|
54 |
| -Example screenshot of the console output from this app: |
| 132 | +### Console Logs: |
| 133 | + |
| 134 | + |
| 135 | + |
| 136 | +### Python script: |
| 137 | + |
| 138 | + |
| 139 | +### ESP32-WROVER-KIT |
| 140 | + |
| 141 | +https://github.com/esp-cpp/wireless-debug-display/assets/213467/395400f6-e677-464c-a258-df06049cc562 |
| 142 | + |
| 143 | +### ESP32-S3-BOX |
| 144 | + |
| 145 | + |
| 146 | + |
| 147 | + |
| 148 | + |
| 149 | +https://github.com/esp-cpp/wireless-debug-display/assets/213467/f835922f-e17f-4f76-95ee-5d6585e84656 |
55 | 150 |
|
56 |
| - |
|
0 commit comments