Skip to content

fix provisioning sketch for opta lite #569

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 3 commits into from
Aug 21, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 12 additions & 3 deletions examples/utility/Provisioning_2.0/ClaimingHandler.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
#include <ArduinoBLE.h>
#include "utility/HCI.h"
#include <Arduino_HEX.h>
#include "ANetworkConfigurator_Config.h"

#define SLOT_BOARD_PRIVATE_KEY 1

Expand Down Expand Up @@ -148,8 +149,14 @@ void ClaimingHandlerClass::resetStoredCredReqHandler() {
}

void ClaimingHandlerClass::getBLEMacAddressReqHandler() {
uint8_t mac[6] = { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 };

/* Set the default MAC address as ff:ff:ff:ff:ff:ff for compatibility
* with the Arduino IoT Cloud WebUI
*/
uint8_t mac[6] = { 0xff, 0xff, 0xff, 0xff, 0xff, 0xff };

#ifdef ARDUINO_OPTA
if(_getPid_() == OPTA_WIFI_PID) {
#endif
bool activated = false;
ConfiguratorAgent * connectedAgent = _agentManager.getConnectedAgent();
if(!_agentManager.isAgentEnabled(ConfiguratorAgent::AgentTypes::BLE) || (connectedAgent != nullptr &&
Expand All @@ -168,7 +175,9 @@ void ClaimingHandlerClass::getBLEMacAddressReqHandler() {
if (activated) {
BLE.end();
}

#ifdef ARDUINO_OPTA
}
#endif
ProvisioningOutputMessage outputMsg;
outputMsg.type = MessageOutputType::BLE_MAC_ADDRESS;
outputMsg.m.BLEMacAddress = mac;
Expand Down
2 changes: 1 addition & 1 deletion examples/utility/Provisioning_2.0/Provisioning_2.0.ino
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
#include <utility/SElementArduinoCloudCertificate.h>
#include "utility/LEDFeedback.h"

const char *SKETCH_VERSION = "0.3.0";
const char *SKETCH_VERSION = "0.3.3";

enum class DeviceState {
HARDWARE_CHECK,
Expand Down