You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
- Add createPermanentConnections argument to attemptAutoEncryptingTransmission method.
- Reduce risk of misinterpreting acks by adding check for ack sender MAC.
- Reduce _encryptionRequestTimeoutMs from 500 ms to 300 ms since this should give enough (100 %) margin to the level where problems start appearing (150 ms timeout) and also save a lot of time in case of request failure.
- Improve comments.
constchar exampleMeshName[] PROGMEM = "MeshNode_"; // The name of the mesh network. Used as prefix for the node SSID and to find other network nodes in the example networkFilter function below.
17
+
constchar exampleMeshName[] PROGMEM = "MeshNode_"; // The name of the mesh network. Used as prefix for the node SSID and to find other network nodes during ESP-NOW broadcasts and in the example networkFilter function below.
18
18
constchar exampleWiFiPassword[] PROGMEM = "ChangeThisWiFiPassword_TODO"; // The password has to be min 8 and max 64 characters long, otherwise an AP which uses it will not be found during scans.
19
19
20
20
// A custom encryption key is required when using encrypted ESP-NOW transmissions. There is always a default Kok set, but it can be replaced if desired.
@@ -35,16 +35,17 @@ unsigned int responseNumber = 0;
// Prevents the flash memory from being worn out, see: https://github.com/esp8266/Arduino/issues/1054 .
137
174
// This will however delay node WiFi start-up by about 700 ms. The delay is 900 ms if we otherwise would have stored the WiFi network we want to connect to.
@@ -173,6 +210,7 @@ void setup() {
173
210
174
211
// Storing our message in the EspnowMeshBackend instance is not required, but can be useful for organizing code, especially when using many EspnowMeshBackend instances.
175
212
// Note that calling espnowNode.attemptTransmission will replace the stored message with whatever message is transmitted.
213
+
// Also note that the maximum allowed number of ASCII characters in a ESP-NOW message is given by EspnowMeshBackend::getMaxMessageLength().
176
214
espnowNode.setMessage(String(F("Hello world request #")) + String(requestNumber) + String(F(" from ")) + espnowNode.getMeshName() + espnowNode.getNodeID() + String(F(".")));
177
215
}
178
216
@@ -188,18 +226,18 @@ void loop() {
188
226
EspnowMeshBackend::performEspnowMaintainance();
189
227
190
228
if (millis() - timeOfLastScan > 10000) { // Give other nodes some time to connect between data transfers.
// We can create encrypted connections to individual nodes so that all ESP-NOW communication with the node will be encrypted.
@@ -287,6 +339,7 @@ void loop() {
287
339
288
340
// Or if we prefer we can just let the library automatically create brief encrypted connections which are long enough to transmit an encrypted message.
289
341
// Note that encrypted responses will not be received, unless there already was an encrypted connection established with the peer before attemptAutoEncryptingTransmission was called.
342
+
// This can be remedied via the createPermanentConnections argument, though it must be noted that the maximum number of encrypted connections supported at a time is 6.
290
343
espnowMessage = "This message is always encrypted, regardless of receiver.";
* @returns True if latest transmission was successful (i.e. latestTransmissionOutcomes is not empty and all entries have transmissionStatus TS_TRANSMISSION_COMPLETE). False otherwise.
197
+
* @return True if latest transmission was successful (i.e. latestTransmissionOutcomes is not empty and all entries have transmissionStatus TS_TRANSMISSION_COMPLETE). False otherwise.
198
198
*/
199
199
staticboollatestTransmissionSuccessful();
200
200
@@ -217,15 +217,15 @@ class ESP8266WiFiMesh {
217
217
* If another instance takes control over the AP after the pointer is created,
218
218
* the created pointer will still point to the old AP instance.
219
219
*
220
-
* @returns A pointer to the ESP8266WiFiMesh instance currently in control of the ESP8266 AP,
220
+
* @return A pointer to the ESP8266WiFiMesh instance currently in control of the ESP8266 AP,
221
221
* or nullptr if there is no active AP controller.
222
222
*/
223
223
static ESP8266WiFiMesh * getAPController();
224
224
225
225
/**
226
226
* Check if this ESP8266WiFiMesh instance is in control of the ESP8266 AP.
227
227
*
228
-
* @returns True if this ESP8266WiFiMesh instance is in control of the ESP8266 AP. False otherwise.
228
+
* @return True if this ESP8266WiFiMesh instance is in control of the ESP8266 AP. False otherwise.
0 commit comments