From b77b7b01982ae5cc3b7b58e247b27bfb10c5cec2 Mon Sep 17 00:00:00 2001 From: Oguz Bastemur Date: Mon, 16 Jul 2018 09:53:13 -0700 Subject: [PATCH 1/4] make buttonpress return value stringified boolean --- AZ3166/iotc.json | 7 ------- AZ3166/iotz.json | 3 +-- AZ3166/src/telemetry.cpp | 2 +- 3 files changed, 2 insertions(+), 10 deletions(-) delete mode 100644 AZ3166/iotc.json diff --git a/AZ3166/iotc.json b/AZ3166/iotc.json deleted file mode 100644 index 01db951..0000000 --- a/AZ3166/iotc.json +++ /dev/null @@ -1,7 +0,0 @@ -{ - "name": "iot central firmware example for AZ3166", - "toolchain": "arduino", - "target": "AZ3166:stm32f4:MXCHIP_AZ3166", - "filename": "iotCentral.ino", - "has_libs": false -} diff --git a/AZ3166/iotz.json b/AZ3166/iotz.json index 01db951..04a94a6 100644 --- a/AZ3166/iotz.json +++ b/AZ3166/iotz.json @@ -2,6 +2,5 @@ "name": "iot central firmware example for AZ3166", "toolchain": "arduino", "target": "AZ3166:stm32f4:MXCHIP_AZ3166", - "filename": "iotCentral.ino", - "has_libs": false + "filename": "iotCentral.ino" } diff --git a/AZ3166/src/telemetry.cpp b/AZ3166/src/telemetry.cpp index ea55178..20b8c85 100644 --- a/AZ3166/src/telemetry.cpp +++ b/AZ3166/src/telemetry.cpp @@ -117,7 +117,7 @@ void TelemetryController::loop() { // SEND EVENT example // build the event payload - const char * eventString = "{\"ButtonBPressed\": 1}"; + const char * eventString = "{\"ButtonBPressed\": \"occured\"}"; if (iothubClient->sendTelemetry(eventString)) { LOG_VERBOSE("Event successfully sent"); StatsController::incrementReportedCount(); From 630c8918fee55b084f8429a807dc736a3040cca8 Mon Sep 17 00:00:00 2001 From: Oguz Bastemur Date: Mon, 16 Jul 2018 11:33:54 -0700 Subject: [PATCH 2/4] accept empty WiFi password --- AZ3166/src/config.cpp | 6 +++++- AZ3166/src/onboarding.cpp | 6 +++--- 2 files changed, 8 insertions(+), 4 deletions(-) diff --git a/AZ3166/src/config.cpp b/AZ3166/src/config.cpp index 3ba0da3..5d3126e 100644 --- a/AZ3166/src/config.cpp +++ b/AZ3166/src/config.cpp @@ -17,7 +17,11 @@ void ConfigController::storeWiFi(AutoString &ssid, AutoString &password) { EEPROMInterface eeprom; eeprom.write((uint8_t*) *ssid, ssid.getLength(), WIFI_SSID_ZONE_IDX); - eeprom.write((uint8_t*) *password, password.getLength(), WIFI_PWD_ZONE_IDX); + if (password.getLength()) { + eeprom.write((uint8_t*) *password, password.getLength(), WIFI_PWD_ZONE_IDX); + } else { + eeprom.write((uint8_t*) "", 0, WIFI_PWD_ZONE_IDX); + } } void ConfigController::storeConnectionString(AutoString &connectionString) { diff --git a/AZ3166/src/onboarding.cpp b/AZ3166/src/onboarding.cpp index ae7886e..30aeea9 100644 --- a/AZ3166/src/onboarding.cpp +++ b/AZ3166/src/onboarding.cpp @@ -244,8 +244,8 @@ void OnboardingController::processResultRequest(WiFiClient &client, String &requ pch = strtok(NULL, "&"); } - if (ssid.getLength() == 0 || password.getLength() == 0 || connStr.getLength() == 0) { - LOG_ERROR("Missing ssid, password or connStr. Responsed with START page"); + if (ssid.getLength() == 0 || connStr.getLength() == 0) { + LOG_ERROR("Missing ssid or connStr. Responsed with START page"); processStartRequest(client); return; } else if (!pincodePasses) { @@ -254,7 +254,7 @@ void OnboardingController::processResultRequest(WiFiClient &client, String &requ } // store the settings in EEPROM - assert(ssid.getLength() != 0 && password.getLength() != 0); + assert(ssid.getLength() != 0); ConfigController::storeWiFi(ssid, password); assert(connStr.getLength() != 0); From c1d1312d18f558504d15d82e70de22902e7197a9 Mon Sep 17 00:00:00 2001 From: Oguz Bastemur Date: Mon, 16 Jul 2018 11:35:59 -0700 Subject: [PATCH 3/4] bump version and cleanup unnecessary gitignore file --- AZ3166/.gitignore | 12 ------------ AZ3166/inc/globals.h | 2 +- 2 files changed, 1 insertion(+), 13 deletions(-) delete mode 100644 AZ3166/.gitignore diff --git a/AZ3166/.gitignore b/AZ3166/.gitignore deleted file mode 100644 index 506473f..0000000 --- a/AZ3166/.gitignore +++ /dev/null @@ -1,12 +0,0 @@ -# Copyright (c) Microsoft. All rights reserved. -# Licensed under the MIT license. - -.vscode/ -package-lock.json - -# Arduino build files and folders -build/ - -# iotc default build folder -out/ -.iotc.mxchip.tweak diff --git a/AZ3166/inc/globals.h b/AZ3166/inc/globals.h index 07ea1d7..a0032d6 100644 --- a/AZ3166/inc/globals.h +++ b/AZ3166/inc/globals.h @@ -74,7 +74,7 @@ struct Globals #define IOT_CENTRAL_MAX_LEN STRING_BUFFER_128 #define AZIOTC_FW_MAJOR_VERSION 1 #define AZIOTC_FW_MINOR_VERSION 4 -#define AZIOTC_FW_PATCH_VERSION 1 +#define AZIOTC_FW_PATCH_VERSION 2 #define AZIOTC_FW_VERSION TO_STRING(AZIOTC_FW_MAJOR_VERSION AZIOTC_FW_MINOR_VERSION AZIOTC_FW_PATCH_VERSION) "-MSIOTC" #include "definitions.h" From 97606780a843ae12b1ad982be8546beb57a46c08 Mon Sep 17 00:00:00 2001 From: Oguz Bastemur Date: Mon, 16 Jul 2018 11:45:10 -0700 Subject: [PATCH 4/4] fix typo --- AZ3166/src/telemetry.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/AZ3166/src/telemetry.cpp b/AZ3166/src/telemetry.cpp index 20b8c85..428c17e 100644 --- a/AZ3166/src/telemetry.cpp +++ b/AZ3166/src/telemetry.cpp @@ -117,7 +117,7 @@ void TelemetryController::loop() { // SEND EVENT example // build the event payload - const char * eventString = "{\"ButtonBPressed\": \"occured\"}"; + const char * eventString = "{\"ButtonBPressed\": \"occurred\"}"; if (iothubClient->sendTelemetry(eventString)) { LOG_VERBOSE("Event successfully sent"); StatsController::incrementReportedCount();