Skip to content

Commit 9c43944

Browse files
author
Michael Ruettgers
committed
Merge branch 'release/2.1.3'
2 parents 85fa814 + 820496e commit 9c43944

File tree

5 files changed

+18
-4
lines changed

5 files changed

+18
-4
lines changed

CHANGELOG.md

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,13 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
66

77
## [Unreleased]
88

9+
## [2.1.3] - 2020-04-17
10+
### Changed
11+
- Added hint to change AP password to the docs
12+
- Moved WiFi default settings to `config.h`
13+
### Fixed
14+
- String initialization issues resulting in random MQTT username/passqord in UI
15+
916
## [2.1.2] - 2020-04-16
1017
### Changed
1118
- Updated the docs

README.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -63,6 +63,8 @@ static const SensorConfig SENSOR_CONFIGS[] = {
6363
WiFi and MQTT are configured via the web interface provided by [IotWebConf](https://github.com/prampec/IotWebConf) and which can be reached after joining the WiFi network named SMLReader and heading to http://192.168.4.1.
6464
If the device has already been configured, the web interface can be reached via the IP address obtained from your local network's DHCP server.
6565

66+
*Attention: You have to change the AP Password (empty by default), otherwise SMLReader won't work.*
67+
6668
---
6769

6870
### Flashing

src/MqttPublisher.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,8 +11,8 @@ struct MqttConfig
1111
{
1212
char server[128] = "mosquitto";
1313
char port[8] = "1883";
14-
char username[128];
15-
char password[128];
14+
char username[128] = "";
15+
char password[128] = "";
1616
char topic[128] = "iot/smartmeter/";
1717
};
1818

src/config.h

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,13 +4,17 @@
44
#include "Arduino.h"
55
#include "Sensor.h"
66

7-
const char *VERSION = "2.1.2";
7+
const char *VERSION = "2.1.3";
88

99
// Modifying the config version will probably cause a loss of the existig configuration.
1010
// Be careful!
1111
const char *CONFIG_VERSION = "1.0.2";
12+
1213
const uint8_t STATUS_PIN = LED_BUILTIN;
1314

15+
const char *WIFI_AP_SSID = "SMLReader";
16+
const char *WIFI_AP_DEFAULT_PASSWORD = "";
17+
1418
static const SensorConfig SENSOR_CONFIGS[] = {
1519
{.pin = D2,
1620
.name = "1",

src/main.cpp

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ WiFiClient net;
2121
MqttConfig mqttConfig;
2222
MqttPublisher publisher;
2323

24-
IotWebConf iotWebConf("SMLReader", &dnsServer, &server, "", CONFIG_VERSION);
24+
IotWebConf iotWebConf(WIFI_AP_SSID, &dnsServer, &server, WIFI_AP_DEFAULT_PASSWORD, CONFIG_VERSION);
2525
IotWebConfParameter params[] = {
2626
IotWebConfParameter("MQTT server", "mqttServer", mqttConfig.server, sizeof(mqttConfig.server), "text", NULL, mqttConfig.server, NULL, true),
2727
IotWebConfParameter("MQTT port", "mqttPort", mqttConfig.port, sizeof(mqttConfig.port), "text", NULL, mqttConfig.port, NULL, true),
@@ -73,6 +73,7 @@ void setup()
7373
DEBUG("Setting up WiFi and config stuff.");
7474
DEBUG("Setting status pin to %d.", STATUS_PIN);
7575
iotWebConf.setStatusPin(STATUS_PIN);
76+
7677
for (uint8_t i = 0; i < sizeof(params) / sizeof(params[0]); i++)
7778
{
7879
DEBUG("Adding parameter %s.", params[i].label);

0 commit comments

Comments
 (0)