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

getting data unreliable if datapoint is large #141

Open
HannesZei opened this issue Nov 21, 2020 · 4 comments
Open

getting data unreliable if datapoint is large #141

HannesZei opened this issue Nov 21, 2020 · 4 comments

Comments

@HannesZei
Copy link

  • Arduino board: ESP32 from AZ-Delivery

  • Arduino IDE version (found in Arduino -> About Arduino menu): 1.8.13 (or/and plattform io)

  • List the steps to reproduce the problem below (if possible attach a sketch or
    copy the sketch code in too):
    Simple Sketch that inits a connection subscribes to a topic and requests that with feed->get() or gets the last data with feed->lastValue()
    If you enter data of more than 80-85 characters the value is not received. (with get() it will never call the handler and with lastValue() it will never finish the call) (That is true for feeds with history turned off and on)

It also happens with the example sketch:
https://github.com/adafruit/Adafruit_IO_Arduino/blob/master/examples/adafruitio_01_subscribe/adafruitio_01_subscribe.ino

@brentru
Copy link
Member

brentru commented Nov 23, 2020

Could you try increasing the MAXBUFFERSIZE in the Adafruit_MQTT_Library on your computer?

https://github.com/adafruit/Adafruit_MQTT_Library/blob/master/Adafruit_MQTT.h#L110

@HannesZei
Copy link
Author

HannesZei commented Nov 24, 2020

Thank you. Unfortunately it did not resolve my problem.
Since the problem does also occur if i use lastValue which uses http (as far as i can tell) i suppose it is a common problem.
I checked with http. It works if i manually enter the query in the browser as per the api. So currently i wrote my costume http implementation which does work, so it shows it schould be possible.
I did look into the problem a bit. But the errors/info i get are changing from try to try if i add some print statements for example. That is why i think an array overflow or something like that might be the cause. (But keep in mind i tried this with my whole code so it might be some unrelated issue as well).
I also get issues with ssl certificates (even using different/my own libraries). Maybe it is specific to my device only (I tested it with 2 esp32's). It would be nice if someone could confirm the behavior and/or provide a fix/suggestion for it.

I saw the AIO_DATA_LENGTH definition (https://github.com/adafruit/Adafruit_IO_Arduino/blob/master/src/AdafruitIO_Definitions.h#L131), which seemed to be the thing i am looking for, but it did not work as well. (I am curious: what is it for? because it was set to 45 but i used data values larger than that. Do I misunderstand that or did i just got lucky with memory placement or something.)

@brentru
Copy link
Member

brentru commented Nov 25, 2020

I also get issues with ssl certificates (even using different/my own libraries).

What issues are you getting with your SSL certs?

@HannesZei
Copy link
Author

I get An invalid SSL record was received. But i think that is an issue on my side. (This mentioned something similar although it did not resolve my problem: espressif/arduino-esp32#2733 (comment)) I have trouble locating the specific code that causes the issue however since the issue will not occur always and most of the times no issue will arise but the next step in code will not be executed as well. For now i use my own implementation because i only have very easy data manipulation. I will still try and see if i might find the issue but i am not equipped with a debugger and just started programming with the esp32 so im dont have a lot of hope.

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

2 participants