Skip to content

Commit

Permalink
Merge branch 'release/2.1.3'
Browse files Browse the repository at this point in the history
  • Loading branch information
Michael Ruettgers committed Apr 17, 2020
2 parents 85fa814 + 820496e commit 9c43944
Show file tree
Hide file tree
Showing 5 changed files with 18 additions and 4 deletions.
7 changes: 7 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,13 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0

## [Unreleased]

## [2.1.3] - 2020-04-17
### Changed
- Added hint to change AP password to the docs
- Moved WiFi default settings to `config.h`
### Fixed
- String initialization issues resulting in random MQTT username/passqord in UI

## [2.1.2] - 2020-04-16
### Changed
- Updated the docs
Expand Down
2 changes: 2 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,8 @@ static const SensorConfig SENSOR_CONFIGS[] = {
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.
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.

*Attention: You have to change the AP Password (empty by default), otherwise SMLReader won't work.*

---

### Flashing
Expand Down
4 changes: 2 additions & 2 deletions src/MqttPublisher.h
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,8 @@ struct MqttConfig
{
char server[128] = "mosquitto";
char port[8] = "1883";
char username[128];
char password[128];
char username[128] = "";
char password[128] = "";
char topic[128] = "iot/smartmeter/";
};

Expand Down
6 changes: 5 additions & 1 deletion src/config.h
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,17 @@
#include "Arduino.h"
#include "Sensor.h"

const char *VERSION = "2.1.2";
const char *VERSION = "2.1.3";

// Modifying the config version will probably cause a loss of the existig configuration.
// Be careful!
const char *CONFIG_VERSION = "1.0.2";

const uint8_t STATUS_PIN = LED_BUILTIN;

const char *WIFI_AP_SSID = "SMLReader";
const char *WIFI_AP_DEFAULT_PASSWORD = "";

static const SensorConfig SENSOR_CONFIGS[] = {
{.pin = D2,
.name = "1",
Expand Down
3 changes: 2 additions & 1 deletion src/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ WiFiClient net;
MqttConfig mqttConfig;
MqttPublisher publisher;

IotWebConf iotWebConf("SMLReader", &dnsServer, &server, "", CONFIG_VERSION);
IotWebConf iotWebConf(WIFI_AP_SSID, &dnsServer, &server, WIFI_AP_DEFAULT_PASSWORD, CONFIG_VERSION);
IotWebConfParameter params[] = {
IotWebConfParameter("MQTT server", "mqttServer", mqttConfig.server, sizeof(mqttConfig.server), "text", NULL, mqttConfig.server, NULL, true),
IotWebConfParameter("MQTT port", "mqttPort", mqttConfig.port, sizeof(mqttConfig.port), "text", NULL, mqttConfig.port, NULL, true),
Expand Down Expand Up @@ -73,6 +73,7 @@ void setup()
DEBUG("Setting up WiFi and config stuff.");
DEBUG("Setting status pin to %d.", STATUS_PIN);
iotWebConf.setStatusPin(STATUS_PIN);

for (uint8_t i = 0; i < sizeof(params) / sizeof(params[0]); i++)
{
DEBUG("Adding parameter %s.", params[i].label);
Expand Down

0 comments on commit 9c43944

Please sign in to comment.