Skip to content
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

[BUG] some messages failed to report #1579

Closed
ppmll opened this issue Nov 2, 2024 · 5 comments
Closed

[BUG] some messages failed to report #1579

ppmll opened this issue Nov 2, 2024 · 5 comments
Assignees
Labels
can be closed If bug fixed or feature is implemented help wanted

Comments

@ppmll
Copy link

ppmll commented Nov 2, 2024

Describe the issue
I think this is a bug but I am not sure.
When more than one timestamped messages sent to the storage for the same device, the gateway only reports the last one to thingsboard,
I've made some debug and discovered that a method called _split_message is called with all the messages and just one is returned before it is beeing publish to mqtt.

Configuration (Attach your configuration file)
Not needed

Connector name (If you need help with some connector/converter):
I am using a simple custom connector that reads a specific file, each line of that file has a specific timestamp, it is then sending to the storage using gateway.send_to_storage

Error traceback (If it was raised):
Not raised

Versions (please complete the following information):

  • OS: Ubuntu 20.04
  • Thingsboard IoT Gateway version 3.6
  • Python version 3.12
@imbeacon
Copy link
Member

imbeacon commented Nov 4, 2024

Hi @ppmll,

You are particularly right, the gateway collects and send only last value from the converted data, it is done in the same way as implemented in ThingsBoard itself - data with the same ts cannot exists. To avoid this situation - you can add ts to your data and save ConvertedData with TelemetryEntry and ts, this will avoid overwriting of the data.

@imbeacon imbeacon added the can be closed If bug fixed or feature is implemented label Nov 4, 2024
@ppmll
Copy link
Author

ppmll commented Nov 4, 2024

Hi @imbeacon, I am sorry, maybe I did not explain correctly, what I mean is that if I send 3 consecutive messages with different timestamps only the last one is sent to thingsboard, please see the folllowing example:
Input of the _split_message method:
image

Only last one was sent to thingsboard.

Thanks.

@imbeacon
Copy link
Member

imbeacon commented Nov 4, 2024

I see and able to reproduce, let you know after fixing this point.

@imbeacon
Copy link
Member

imbeacon commented Nov 5, 2024

Hi @ppmll,

I have made some fix for this data loss, please try new version of the sdk - https://github.com/thingsboard/thingsboard-python-client-sdk/releases/tag/1.10.10, or the gateway from the master branch.

@ppmll
Copy link
Author

ppmll commented Nov 5, 2024

It seems ok now, thank you.

@ppmll ppmll closed this as completed Nov 5, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
can be closed If bug fixed or feature is implemented help wanted
Projects
None yet
Development

No branches or pull requests

3 participants