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

rk_sendBytes() delivers a payload that ends with a random number of extra characters #12

Open
pedbry opened this issue Jun 2, 2021 · 0 comments

Comments

@pedbry
Copy link
Contributor

pedbry commented Jun 2, 2021

I'm using the RAK811 library (downloaded in may 2021) in my devices (Arduino Uno with a RAK811-shield) and I have had no problem sending simple payloads to my application in The Things Network. They are picked up by my two local TTIG:s and I can check them in the TTN-Console (V2).

But I did get a little problem when I wanted to read from a set of DS18B20 temperature-sensors with CayenneLPP and then send the resulting lpp.buffer to my application with the rk_sendBytes() function in the RAK811 library. When I checked in my TTN-Console the payloads were not decoded to temperature-fields etc. The payload seemed to end with a random number of extra characters.

Example

  • 016700E4026700E4036700E5 -> Correct string
  • 016700E4026700E4036700E500294A4 -> Delivered by rk_sendBytes()

When I saw the result and had a closer look at the code I realized that the problem might be that the function that converts the lpp.buffer to a string doesn't add a finishing zero.

I have now added the extra line indicated in the code below to my RAK811.cpp:

image

I have tested my solution and it seems to be stable.

Might this be something that @rbricheno can fix?

I have also made a comment about this here: #6 (comment)

Pedbry

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant