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
Copy file name to clipboardExpand all lines: README.md
+15-2Lines changed: 15 additions & 2 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -59,7 +59,7 @@ Example implementations for all base features, mentioned above, can be found in
59
59
60
60
### No PROGMEM support causing crashes
61
61
62
-
All constant variables are per default in flash memory to decrease the memory footprint of the library, if the libraries used or the board itself don't support `PROGMEM`. This can cause crashes to mitigate that simply add a `#define THINGSBOARD_ENABLE_PROGMEM 0` before including the ThingsBoard header file.
62
+
If the device is crashing with an `Exception` especially `Exception (3)`, more specifically `LoadStoreError` or `LoadStoreErrorCause` this might be because, all constant variables are per default in flash memory to decrease the memory footprint of the library, if the libraries used or the board itself don't support `PROGMEM`. This can cause crashes to mitigate that simply add a `#define THINGSBOARD_ENABLE_PROGMEM 0` before including the ThingsBoard header file.
63
63
64
64
```c++
65
65
// If not set otherwise the value is 1 per default if the pgmspace include exists,
@@ -86,7 +86,7 @@ To remove the need for the `MaxFieldsAmt` template argument in the constructor a
86
86
The buffer size for the serialized JSON is fixed to 64 bytes. The SDK will not send data, if the size of it is bigger than the size originally passed in the constructor as a template argument (`PayLoadSize`). Respective logs in the `"Serial Monitor"` window will indicate the condition:
87
87
88
88
```
89
-
[TB] Buffer size (64) to small for the given payloads size (83), increase with setBufferSize accordingly
89
+
[TB] Buffer size (64) to small for the given payloads size (83), increase with setBufferSize accordingly or set THINGSBOARD_ENABLE_STREAM_UTILS to 1 before including ThingsBoard
90
90
```
91
91
92
92
If that's a case, the buffer size for serialization should be increased. To do so, `setBufferSize()` method can be used or alternatively the `bufferSize` passed to the constructor can be increased as illustrated below:
@@ -107,6 +107,19 @@ void setup() {
107
107
}
108
108
```
109
109
110
+
Alternatively it is possible to enable the mentioned `THINGSBOARD_ENABLE_STREAM_UTILS` option, which sends messages that are bigger than the given buffer size with a method that skips the internal buffer, be aware tough this only works for sent messages. The internal buffer size still has to be big enough to receive the biggest possible message received by the client that is sent by the server.
111
+
112
+
```cpp
113
+
// Enable skipping usage of the buffer for sends that are bigger than the internal buffer size
114
+
#defineTHINGSBOARD_ENABLE_STREAM_UTILS 1
115
+
116
+
// For the sake of example
117
+
WiFiEspClient espClient;
118
+
119
+
// The SDK setup with 64 bytes for JSON buffer
120
+
ThingsBoard tb(espClient);
121
+
```
122
+
110
123
### Too much data fields must be serialized
111
124
112
125
A buffer allocated internally by `ArduinoJson` library is fixed and is capable for processing not more than 8 fields. If you are trying to send more than that, you will get a respective log showing an error in the `"Serial Monitor"` window:
0 commit comments