Coder Social home page Coder Social logo

Comments (2)

MathewHDYT avatar MathewHDYT commented on May 27, 2024
  1. When i initial ThingsBoard. How is difference between
    ThingsBoardSized<128> tb(mqttClient, MAX_MESSAGE_SIZE);
    and
    ThingsBoard tb(mqttClient, MAX_MESSAGE_SIZE);

That is the MaxFieldsAmount template parameter with the default value of Default_Fields_Amount and an explanation can be found in the documentation on this GitHub page here.

  1. Maximum size of anything in below this
    What is Default_Max_Stack_Size , Default_Buffering_Size ,Default_Payload , Default_Fields_Amt

The documentation of the class should appear in VSCode when hovering over ThingsBoard constructor. More specifically you should see this comment. Which shows when the values are used.

/// @tparam MaxFieldsAmount Maximum amount of key value pair that we will be able to sent or received by ThingsBoard in one call, default = Default_Fields_Amount (8)
 /// @param bufferSize Maximum amount of data that can be either received or sent to ThingsBoard at once, if bigger packets are received they are discarded
/// and if we attempt to send data that is bigger, it will not be sent, the internal value can be changed later at any time with the setBufferSize() method
/// alternatively setting THINGSBOARD_ENABLE_STREAM_UTILS to 1 allows to send arbitrary size payloads if that is done the internal buffer of the MQTT Client implementation
/// can be theoretically set to only be as big as the biggest message we should every receive from ThingsBoard,
/// this will mean though that all messages are sent over the StreamUtils library as long as they are bigger than the internal buffer,
/// which needs more time than sending a message directly but has the advantage of requiring less memory.
/// So if that is a problem on the board it might be useful to enable the THINGSBOARD_ENABLE_STREAM_UTILS option
/// and decrease the internal buffer size of the mqtt client to what is needed to receive all MQTT messages,
/// that size can vary but if all ThingsBoard features are used a buffer size of 256 bytes should suffice for receiving most responses.
/// If the aforementioned feature is not enabled the buffer size might need to be much bigger though,
/// but in that case if a message was too big to be sent the user will be informed with a message to the Logger.
/// The aforementioned options can only be enabled if Arduino is used to build this library, because the StreamUtils library requires it, default = Default_Payload (64)
/// @param maxStackSize Maximum amount of bytes we want to allocate on the stack, default = Default_Max_Stack_Size (1024)
/// @param bufferingSize Amount of bytes allocated to speed up serialization, only used if THINGSBOARD_ENABLE_STREAM_UTILS is set to 1, default = Default_Buffering_Size (64)

I hope this somewhat helps explain the different values and possible template arguments to the class.

  1. If i would like to send multi telemetry in once time. What is the right way to config max telemetry size?

For that simply read the documentation linked in question 1. Shortly explained here, you have to specify the amount of json fields you will ever send or receive at once. With the first template parameter in ThingsBoardSized<128>.

from thingsboard-client-sdk.

sirapol avatar sirapol commented on May 27, 2024

That all
Thank you.

from thingsboard-client-sdk.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.