-
Notifications
You must be signed in to change notification settings - Fork 124
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
Sketches don't run with ArduinoJSON ver. 7.0.0 #186
Comments
This library doesn't support ArduinoJson This is the case because the version was only released yesterday For now the API has implemented stubs for old features that allow to still use the old names but the features under the hood have already been changed, so it could be that some methods in the library do not work anymore. Meaning it would require internal library changes to work correctly again. Sadly I also don't think that support for this version of ArduinoJson will be implemented any time soon. Especially for this library the version upgrade would be a downgrade in performance and memory usage, which is not acceptable in my opinion. First of all I do agree that the internal allocation and a lot of cool features, which ArduinoJson provided were sadly hard to use and sometimes misunderstood. I learned that part myself the hard way, because I completely misunderstood how the library worked in the background. After reading the very good documentation tough. I have to say that I love the Below I've listed the places where above mentioned features are required or cause massive improvements and what their removal in v6.X.X
Additionally even in dynamic mode those small allocation which really do not need to be on the heap are still on the stack, because we do always know the amount of key-value pair the ThingsBoard API excepts for certain calls and can therefore easily hardcore it into the library directly. v7.X.X
Because those features have been removed and replaced with copy and heap allocation. I will wait for newer versions which might bring other features which decrease this problematic, but for now as you can hopefully see the disadvantages far out way the advantages of upgrading to Especially if the main advantage currently is user friendliness. This because, it is already done by this library, because most of the internals with |
my Sketch compiles with ArduinoJson v7.0.0 I get many warnings eg: "Static JsonDocument is deprecated use JsonDocument".. but it compiles. |
This will only be for a while that it even compiles, because at the start of But in the background all components have been changed to reflect the changes mentioned above and what @PauloMtz10 might have meant is that the library does not work correctly anymore even if it compiles for certain features with ArduinoJson |
MathewHDYT hi, whats the timing on the release of the version to resolve this #186 , tks. |
@TPCQitek I hope soon, sadly I don't know either because the examples have to be adjusted accordingly. |
Hi, ok thanks, mostly my system is ok on the 6.21.4 , but the control
widgets are not updating the initial state , IE ThingsBoard Switch etc
particularly, it defaults to ON, was expecting that may be resolved in the
7.xx I had been very busy on other things, and was looking today, I
wanted to get the switch and RPC send buttons sorted,
thanks.
Regards:
Terence Curtis
CONTACTS:
SKYPE: terencepcurtis
Mobile: Australia +61 412 262 646
************************************************************************************
…On Mon, 5 Feb 2024 at 16:37, MathewHDYT ***@***.***> wrote:
@TPCQitek <https://github.com/TPCQitek> I hope soon, sadly I don't know
either because the examples have to be adjusted accordingly.
—
Reply to this email directly, view it on GitHub
<#186 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/ANLX6TYPTBDHTCJ2JRBUJGTYSBV2PAVCNFSM6AAAAABBNKRBSGVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMYTSMRWGI3DMNRYGA>
.
You are receiving this because you were mentioned.Message ID:
***@***.***>
|
Mathew, hi, apologies not sure what you mean ??
simply move the StaticJsonDocument into global scope an call clear at the
top of the method.
Regards:
Terence Curtis
CONTACTS:
SKYPE: terencepcurtis
Mobile: Australia +61 412 262 646
************************************************************************************
…On Mon, 5 Feb 2024 at 17:50, MathewHDYT ***@***.***> wrote:
That is because of another issue. As a quick fix until the PR is merged,
simply move the StaticJsonDocument into global scope an call clear at the
top of the method.
—
Reply to this email directly, view it on GitHub
<#186 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/ANLX6T2T56EOGVQQ4SLTMGDYSB6LVAVCNFSM6AAAAABBNKRBSGVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMYTSMRWGMZTCMJZGY>
.
You are receiving this because you were mentioned.Message ID:
***@***.***>
|
@TPCQitek See this #167 (comment). |
I did the workaround, as best I see it, the RPC Widget Button Send is OK and the processPower ON / OFF is ok, but the Widget Control Switch is not working, not reading the current state and see below. the [TB] was unable to serialize, data and not Send ON / OFF the code follows, can you suggest anything? thanks. 19:48:04.914 -> RPC_Response processPower Using the RPC Send Button : 19:59:54.128 -> RPC_Response processPower using LIB 6.21.5 // Define the capacity of the JSON document globally // Create a global JSON document for power RPC response RPC_Response processPower(const RPC_Data &data) { const size_t JSON_CAPACITY = JSON_OBJECT_SIZE(1); if (data[RPC_POWER_METHOD].isNull()) { // get the current state bool Power_temp = data[RPC_POWER_METHOD]; String strData; Serial.println("RPC_Response variant:"); |
Mathew, Hello, apologies, been off on another project,
doing a review of the ThingsBoard and ArduinoJson version..
was that completed to support version 7? , my code is on ver 6.21.5
I had reverted to using the telmentarySend method,
also
the ThingsBoard Switch Widget (typically) no longer updated the current
State when the Dashboard page opened..
I am assuming that the Dashboard version had changed? and did not work on
the older ver 6.21.5
any update? or timing / options.
thanks in advance...
Regards:
Terence Curtis
CONTACTS:
SKYPE: terencepcurtis
Mobile: Australia +61 412 262 646
************************************************************************************
On Tue, 6 Feb 2024 at 19:51, Terence Curtis ***@***.***>
wrote:
… Mathew, hi, apologies not sure what you mean ??
simply move the StaticJsonDocument into global scope an call clear at the
top of the method.
Regards:
Terence Curtis
CONTACTS:
SKYPE: terencepcurtis
Mobile: Australia +61 412 262 646
************************************************************************************
On Mon, 5 Feb 2024 at 17:50, MathewHDYT ***@***.***> wrote:
> That is because of another issue. As a quick fix until the PR is merged,
> simply move the StaticJsonDocument into global scope an call clear at the
> top of the method.
>
> —
> Reply to this email directly, view it on GitHub
> <#186 (comment)>,
> or unsubscribe
> <https://github.com/notifications/unsubscribe-auth/ANLX6T2T56EOGVQQ4SLTMGDYSB6LVAVCNFSM6AAAAABBNKRBSGVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMYTSMRWGMZTCMJZGY>
> .
> You are receiving this because you were mentioned.Message ID:
> ***@***.***>
>
|
You are still entering a Simply move the DynamicJsonDocument dynamicDoc(512);
RPC_Response processPower(const RPC_Data &data) {
dynamicDoc.clear();
...
} See this for more information #167 (comment). |
No description provided.
The text was updated successfully, but these errors were encountered: