File tree Expand file tree Collapse file tree 4 files changed +7
-21
lines changed Expand file tree Collapse file tree 4 files changed +7
-21
lines changed Original file line number Diff line number Diff line change @@ -83,8 +83,8 @@ void Wippersnapper::provision() {
83
83
_nvs = new Wippersnapper_ESP32_nvs ();
84
84
_nvs->parseSecrets ();
85
85
#endif
86
- // Set credentials
87
- set_user_key ();
86
+
87
+ // Set WiFi credentials within network interface
88
88
set_ssid_pass ();
89
89
}
90
90
@@ -1194,8 +1194,6 @@ void Wippersnapper::errorWriteHang(String error) {
1194
1194
/* *************************************************************************/
1195
1195
void Wippersnapper::runNetFSM () {
1196
1196
WS.feedWDT ();
1197
- // MQTT connack RC
1198
- int mqttRC;
1199
1197
// Initial state
1200
1198
fsm_net_t fsmNetwork;
1201
1199
fsmNetwork = FSM_NET_CHECK_MQTT;
@@ -1250,7 +1248,7 @@ void Wippersnapper::runNetFSM() {
1250
1248
maxAttempts = 10 ;
1251
1249
while (maxAttempts >= 0 ) {
1252
1250
setStatusLEDColor (LED_IO_CONNECT);
1253
- mqttRC = WS._mqtt ->connect ();
1251
+ int8_t mqttRC = WS._mqtt ->connect (WS. _username , WS. _key );
1254
1252
if (mqttRC == WS_MQTT_CONNECTED) {
1255
1253
fsmNetwork = FSM_NET_CHECK_MQTT;
1256
1254
break ;
Original file line number Diff line number Diff line change @@ -100,15 +100,8 @@ class Wippersnapper_ESP32 : public Wippersnapper {
100
100
*/
101
101
/* *******************************************************/
102
102
void setupMQTTClient (const char *clientID) {
103
- WS_DEBUG_PRINT (" BROKER URL: " );
104
- WS_DEBUG_PRINT (WS._mqttBrokerURL );
105
-
106
- WS_DEBUG_PRINT (" USERNAME: " );
107
- WS_DEBUG_PRINT (WS._username );
108
- WS_DEBUG_PRINT (" KEY: " );
109
- WS_DEBUG_PRINT (WS._key );
110
-
111
103
if (WS._mqttBrokerURL == nullptr ) {
104
+ WS_DEBUG_PRINTLN (" IO ADAFRUIT TEST L114" );
112
105
WS._mqttBrokerURL = " io.adafruit.com" ;
113
106
_mqtt_client->setCACert (_aio_root_ca_prod);
114
107
} else {
Original file line number Diff line number Diff line change @@ -59,17 +59,12 @@ void Wippersnapper_ESP32_nvs::parseSecrets() {
59
59
;
60
60
}
61
61
62
- // optional NVS staging url
63
- _aioURL = nvs.getString (" wsAIOURL" , " " );
64
- if (_aioURL.length () == 0 )
65
- _aioURL = " io.adafruit.com" ;
66
-
67
62
// Set global configuration strings
68
63
WS._network_ssid = _ssid.c_str ();
69
64
WS._network_pass = _ssidPass.c_str ();
70
65
WS._username = _aioUser.c_str ();
71
66
WS._key = _aioPass.c_str ();
72
- WS._mqttBrokerURL = _aioURL. c_str () ;
67
+ WS._mqttBrokerURL = nullptr ;
73
68
}
74
69
75
70
#endif // ARDUINO_ARCH_ESP32
Original file line number Diff line number Diff line change @@ -340,7 +340,7 @@ void Wippersnapper_FS::parseSecrets() {
340
340
" effect" );
341
341
fsHalt ();
342
342
}
343
- WS._username = _fileSystem-> io_username ;
343
+ WS._username = io_username;
344
344
345
345
// Get io key
346
346
io_key = doc[" io_key" ];
@@ -350,7 +350,7 @@ void Wippersnapper_FS::parseSecrets() {
350
350
writeErrorToBootOut (" ERROR: invalid io_key value in secrets.json!" );
351
351
fsHalt ();
352
352
}
353
- WS._key = _fileSystem-> io_key ;
353
+ WS._key = io_key;
354
354
355
355
// next, we detect the network interface from the `secrets.json`
356
356
WS_DEBUG_PRINTLN (" Attempting to find network interface..." );
You can’t perform that action at this time.
0 commit comments