Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Status GUI #54

Draft
wants to merge 52 commits into
base: main
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from 10 commits
Commits
Show all changes
52 commits
Select commit Hold shift + click to select a range
42ac6f9
added /status with uptime and heap
HendrikRauh Dec 15, 2024
5e1224a
elimination of sub-functions
HendrikRauh Dec 15, 2024
e5585da
added psram
HendrikRauh Dec 15, 2024
5938585
added a bunch of additional information
HendrikRauh Dec 15, 2024
34bffdb
switched to nested structure
HendrikRauh Dec 15, 2024
2c25932
added signal strength
HendrikRauh Dec 15, 2024
4ac0681
switched status logic to separate file
HendrikRauh Dec 15, 2024
c336e65
Added cpuTemperature
HendrikRauh Dec 18, 2024
b56a106
Merge branch 'HendrikRauh/issue33' into merge-MAIN-statusUI
HendrikRauh Dec 18, 2024
082a4a4
Merge pull request #55 from HendrikRauh/merge-MAIN-statusUI
HendrikRauh Dec 18, 2024
902448a
Merge branch 'main' into HendrikRauh/issue33
HendrikRauh Dec 18, 2024
90f8d7c
added class to form and added section to prepare next commit
RaffaelW Dec 19, 2024
9e83851
added status ui
RaffaelW Dec 19, 2024
b097f81
fixed input/output toggle
RaffaelW Dec 14, 2024
a3dc701
disabled automatic wifi scan when the configuration page loads to avo…
RaffaelW Dec 14, 2024
e4fb246
added slider for led brightness
RaffaelW Dec 14, 2024
003102f
adjust led brightness
RaffaelW Dec 15, 2024
a6500cb
extracted default config values
RaffaelW Dec 15, 2024
140d43f
corrected default values for ip addresses
RaffaelW Dec 15, 2024
53e42a0
made some input fields required
RaffaelW Dec 15, 2024
33bc277
moved onGetNetworks function to new file
RaffaelW Dec 15, 2024
7b0f0ac
cache available networks in setup
RaffaelW Dec 15, 2024
1278c01
Fixed typo and added 3V rail
HendrikRauh Dec 14, 2024
f173558
Reset protection
HendrikRauh Dec 13, 2024
6aff101
updated doc to match new reset
HendrikRauh Dec 13, 2024
66cf008
fixed and changed the reset protection
HendrikRauh Dec 14, 2024
0b0bf2f
fixed confusing syntax
HendrikRauh Dec 15, 2024
303a0ae
shortened wifi scan warning
RaffaelW Dec 15, 2024
b847fb3
select current ssid by default if connected via wifi-station
RaffaelW Dec 15, 2024
3ccae6d
Rework favicon
HendrikRauh Dec 16, 2024
2fd3a76
removed wrong semicolon
RaffaelW Dec 17, 2024
ceb3ce4
Added cpuTemperature
HendrikRauh Dec 18, 2024
7ad8af2
fixed led not blinking
HendrikRauh Dec 18, 2024
282b883
fixed error introduced through merging
RaffaelW Dec 19, 2024
2f4d46e
Merge branch 'HendrikRauh/issue33' of https://github.com/HendrikRauh/…
RaffaelW Dec 19, 2024
07dab3a
Add CPU temperature display
RaffaelW Dec 19, 2024
f38a915
added signal strength icons
HendrikRauh Dec 19, 2024
44eaecc
fixed whitespace and units
RaffaelW Dec 19, 2024
1d2f4a0
updated and added icons
HendrikRauh Dec 19, 2024
e3bc5f8
changed isome icons to white
HendrikRauh Dec 19, 2024
77b7143
Temperature converted to int
HendrikRauh Dec 19, 2024
b599936
Add connection icons for signal strength
RaffaelW Dec 19, 2024
a82934e
Merge pull request #58 from HendrikRauh:57-Temperature-seems-not-right
HendrikRauh Dec 20, 2024
babf7f4
Merge branch 'main' into HendrikRauh/issue33
HendrikRauh Dec 20, 2024
3723cb8
refactored MAC address formatting
RaffaelW Dec 20, 2024
39a8f50
Merge branch 'HendrikRauh/issue33' of https://github.com/HendrikRauh/…
RaffaelW Dec 20, 2024
1c78f3c
removed signal icon in status details
HendrikRauh Dec 20, 2024
0a7da09
switched the cards for better layout
HendrikRauh Dec 20, 2024
3fd0ae4
added small connection icon in status details
RaffaelW Dec 20, 2024
391ef3a
replaced text buttons with icons
RaffaelW Dec 20, 2024
2c83081
added hash to status UI
HendrikRauh Dec 20, 2024
fc30a22
Merge branch 'HendrikRauh/issue33' of https://github.com/HendrikRauh/…
HendrikRauh Dec 20, 2024
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
4 changes: 4 additions & 0 deletions src/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@
#include <LittleFS.h>
#include "routes/config.h"
#include "routes/networks.h"
#include "routes/status.h"

DMXESPSerial dmx1;
DMXESPSerial dmx2;
Expand Down Expand Up @@ -309,6 +310,9 @@ void setup()
server.on("/networks", HTTP_GET, [](AsyncWebServerRequest *request)
{ onGetNetworks(request); });

server.on("/status", HTTP_GET, [](AsyncWebServerRequest *request)
{ onGetStatus(request); });

server.onRequestBody([](AsyncWebServerRequest *request, uint8_t *data, size_t len, size_t index, size_t total)
{
if (request->url() == "/config" && request->method() == HTTP_PUT) {
Expand Down
45 changes: 45 additions & 0 deletions src/routes/status.cpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
#include "status.h"

float getTemperature()
{
float tempC = -1.0f;
temp_sensor_read_celsius(&tempC);
return tempC;
HendrikRauh marked this conversation as resolved.
Show resolved Hide resolved
}

int8_t getWiFiStrength()
{
try
{
return WiFi.RSSI();
}
catch (...)
{
return 0;
}
}

void onGetStatus(AsyncWebServerRequest *request)
{
JsonDocument doc;

doc["uptime"] = millis();
doc["chip"]["model"] = ESP.getChipModel();
doc["chip"]["mac"] = ESP.getEfuseMac();
doc["chip"]["revision"] = ESP.getChipRevision();
doc["chip"]["cpuFreqMHz"] = ESP.getCpuFreqMHz();
doc["chip"]["cycleCount"] = ESP.getCycleCount();
doc["chip"]["tempC"] = getTemperature();
doc["sdkVersion"] = ESP.getSdkVersion();
doc["sketch"]["size"] = ESP.getSketchSize();
doc["sketch"]["md5"] = ESP.getSketchMD5();
doc["heap"]["free"] = ESP.getFreeHeap();
doc["heap"]["total"] = ESP.getHeapSize();
doc["psram"]["free"] = ESP.getFreePsram();
doc["psram"]["total"] = ESP.getPsramSize();
doc["connection"]["signalStrength"] = getWiFiStrength();

String jsonString;
serializeJson(doc, jsonString);
request->send(200, "application/json", jsonString);
}
5 changes: 5 additions & 0 deletions src/routes/status.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
#include <AsyncWebServer_ESP32_W5500.h>
#include <ArduinoJson.h>
#include <driver/temp_sensor.h>

void onGetStatus(AsyncWebServerRequest *request);
Loading