Skip to content

Commit 7cea132

Browse files
committed
Merge branch 'dev' of github.com:mattzzw/MeshCore into dev
2 parents cb4468b + d1bbab9 commit 7cea132

File tree

1 file changed

+11
-0
lines changed

1 file changed

+11
-0
lines changed

examples/companion_radio/ui-new/UITask.cpp

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,8 @@
22
#include <helpers/TxtDataHelpers.h>
33
#include "../MyMesh.h"
44
#include "target.h"
5+
#include <WiFi.h>
6+
57

68
#ifndef AUTO_OFF_MILLIS
79
#define AUTO_OFF_MILLIS 15000 // 15 seconds
@@ -129,6 +131,8 @@ class HomeScreen : public UIScreen {
129131
bool sensors_scroll = false;
130132
int sensors_scroll_offset = 0;
131133
int next_sensors_refresh = 0;
134+
135+
char ipStr[20];
132136

133137
void refresh_sensors() {
134138
if (millis() > next_sensors_refresh) {
@@ -192,10 +196,17 @@ class HomeScreen : public UIScreen {
192196
sprintf(tmp, "MSG: %d", _task->getMsgCount());
193197
display.drawTextCentered(display.width() / 2, 20, tmp);
194198

199+
#ifdef WIFI_SSID
200+
IPAddress ip = WiFi.localIP();
201+
snprintf(ipStr, sizeof(ipStr), "IP: %d.%d.%d.%d", ip[0], ip[1], ip[2], ip[3]);
202+
display.setTextSize(1);
203+
display.drawTextCentered(display.width() / 2, 54, ipStr);
204+
#endif
195205
if (_task->hasConnection()) {
196206
display.setColor(DisplayDriver::GREEN);
197207
display.setTextSize(1);
198208
display.drawTextCentered(display.width() / 2, 43, "< Connected >");
209+
199210
} else if (the_mesh.getBLEPin() != 0) { // BT pin
200211
display.setColor(DisplayDriver::RED);
201212
display.setTextSize(2);

0 commit comments

Comments
 (0)