Skip to content

Commit

Permalink
feat: add MQTT configuration options to build flags
Browse files Browse the repository at this point in the history
  • Loading branch information
AllanOricil committed May 5, 2024
1 parent 58e665b commit 2e21013
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 8 deletions.
4 changes: 4 additions & 0 deletions platformio.ini
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,10 @@ build_flags =
-Wall
-D WIFI_SSID=\"${sysenv.WIFI_SSID}\"
-D WIFI_PASSWORD=\"${sysenv.WIFI_PASSWORD}\"
-D MQTT_PORT=\"${sysenv.MQTT_PORT}\"
-D MQTT_SERVER=\"${sysenv.MQTT_SERVER}\"
-D MQTT_USERNAME=\"${sysenv.MQTT_USERNAME}\"
-D MQTT_PASSWORD=\"${sysenv.MQTT_PASSWORD}\"
-D PIN_HASH=\"${sysenv.PIN_HASH}\"
-D PIN_KEY=\"${sysenv.PIN_KEY}\"
-D USER_SETUP_LOADED=1
Expand Down
9 changes: 1 addition & 8 deletions src/constants.h
Original file line number Diff line number Diff line change
Expand Up @@ -17,16 +17,9 @@

#define KEYS_FILE_PATH "/keys.txt"

// MQTT Broker
#define MQTT_SERVER "192.168.31.198"
#define MQTT_PORT 1883
#define MQTT_USERNAME "MQTT_USERNAME"
#define MQTT_PASSWORD "MQTT_PASSWORD"
// MQTT
#define MQTT_RECONNECT_INTERVAL 5000
#define MQTT_MAX_PAYLOAD_SIZE 1024

// MQTT Topics
// NOTE: this topic is used to create new secrets in the sd card
#define MQTT_WRITE_NEW_SECRET_TOPIC "esp32-totp-write-new-secret"

// PIN
Expand Down

0 comments on commit 2e21013

Please sign in to comment.