adafruit / Adafruit_IO_Arduino

Arduino library to access Adafruit IO from WiFi, cellular, and ethernet modules.
Other
208 stars 108 forks source link

getting data unreliable if datapoint is large #141

Open HannesZei opened 3 years ago

HannesZei commented 3 years ago

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 commented 3 years ago

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 commented 3 years ago

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 commented 3 years ago

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

What issues are you getting with your SSL certs?

HannesZei commented 3 years ago

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: https://github.com/espressif/arduino-esp32/issues/2733#issuecomment-625814342) 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.