Skip to content

Commit

Permalink
20240506
Browse files Browse the repository at this point in the history
Web UI:
- RU translation correction. Thanks to @artbrayko 🚀 PR #4

Code:
- Fix two gateways MQTT conflict
  • Loading branch information
xyzroe committed May 6, 2024
1 parent ceb6911 commit 5084adf
Show file tree
Hide file tree
Showing 7 changed files with 17 additions and 6 deletions.
3 changes: 3 additions & 0 deletions .gitmodules
Original file line number Diff line number Diff line change
Expand Up @@ -2,3 +2,6 @@
path = lib/WireGuard
url = https://github.com/Tinkerforge/WireGuard-ESP32-Arduino
branch = main
[submodule "lib/ESPAsyncTCP"]
path = lib/ESPAsyncTCP
url = https://github.com/me-no-dev/ESPAsyncTCP
Binary file not shown.
Binary file not shown.
5 changes: 3 additions & 2 deletions platformio.ini
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,8 @@ lib_deps =
sstaub/Ticker@>=4.4.0
Martin-Laclaustra/CronAlarms
;husarnet/Husarnet ESP32 @ 1.2.0-5 ;husarnet example
marvinroger/AsyncMqttClient@^0.9.0
marvinroger/AsyncMqttClient @ ^0.9.0
me-no-dev/[email protected]
;plerup/[email protected]
;marian-craciunescu/ESP32Ping@>=1.7
;me-no-dev/[email protected]
Expand Down Expand Up @@ -81,7 +82,7 @@ extra_scripts =


[env:debug]
platform = espressif32 @ 6.4.0
platform = espressif32 @ 6.6.0
;platform = [email protected] ;husarnet example
board = esp32dev
build_flags =
Expand Down
4 changes: 3 additions & 1 deletion src/main.cpp
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
#include <WiFi.h>
// #include <WiFiClient.h>
// #include <WiFiClientSecure.h>
//#define ASYNC_TCP_SSL_ENABLED 1
#include <WebServer.h>
#include <ArduinoJson.h>
#include <FS.h>
Expand All @@ -16,6 +15,9 @@
#include <WireGuard-ESP32.h>
#include <CronAlarms.h>

// NO SSL SUPPORT in current SDK
//#define ASYNC_TCP_SSL_ENABLED 1

#include "config.h"
#include "web.h"
#include "log.h"
Expand Down
9 changes: 7 additions & 2 deletions src/mqtt.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@
#include <WebServer.h>
#include <FS.h>
#include <LittleFS.h>
#include <AsyncMqttClient.h>

#include "config.h"
#include "web.h"
Expand All @@ -23,7 +22,9 @@ extern struct MqttConfigStruct mqttCfg;
extern struct SysVarsStruct vars;
extern struct BrdConfigStruct hwConfig;

#include <AsyncMqttClient.h>
AsyncMqttClient mqttClient;

TimerHandle_t mqttReconnectTimer;
TimerHandle_t mqttPubStateTimer;

Expand All @@ -37,13 +38,15 @@ const char *availabilityTopic = "/avty";
const char *configTopic = "/config";
const char *stateTopic = "/state";

/* NO SSL SUPPORT in current SDK
#if ASYNC_TCP_SSL_ENABLED
#define MQTT_SECURE true
#define MQTT_SERVER_FINGERPRINT \
{ \
0xAA, 0xD4, 0x06, 0x67, 0x05, 0xF2, 0xD3, 0x2E, 0xDD, 0x91, 0x76, 0x6F, 0xBE, 0xD5, 0xFB, 0xEC, 0x0A, 0x34, 0xC3, 0xBE \
}
#endif
*/

String getUptime()
{
Expand Down Expand Up @@ -264,18 +267,20 @@ void mqttConnectSetup()

mqttClient.setCredentials(mqttCfg.user, mqttCfg.pass);

String topic = String(mqttCfg.topic) + "/avty";
//String topic = String(mqttCfg.topic) + "/avty";
//mqttClient.setWill(topic.c_str(), 1, true, "offline");

mqttClient.setServer(mqttCfg.server, mqttCfg.port);

/* NO SSL SUPPORT in current SDK
#if ASYNC_TCP_SSL_ENABLED
mqttClient.setSecure(MQTT_SECURE);
if (MQTT_SECURE)
{
mqttClient.addServerFingerprint((const uint8_t[])MQTT_SERVER_FINGERPRINT);
}
#endif
*/

mqttClient.onConnect(onMqttConnect);
mqttClient.onDisconnect(onMqttDisconnect);
Expand Down
2 changes: 1 addition & 1 deletion src/version.h
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// AUTO GENERATED FILE
#ifndef VERSION
#define VERSION "20240505"
#define VERSION "20240506"
#endif

0 comments on commit 5084adf

Please sign in to comment.