-
Notifications
You must be signed in to change notification settings - Fork 11
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
AWS_IOT_ERROR ('Error Connection to AWS IoT: ', MQTTException('Repeated connect failures',)) #23
AWS_IOT_ERROR ('Error Connection to AWS IoT: ', MQTTException('Repeated connect failures',)) #23
Comments
for what it is worth, I'm having the exact same problem, exactly 1 year after this issue was created. I'm following the same demo code, getting the same 'repeated connect failures' error. It's the reason I found this issue. Did you have any luck fixing this? |
I would suggest passing in a logger and seeing if you get any more helpful errors |
@mlnrt and @jersu11 would you be willing to try this version of MiniMQTT? It's possible that you are getting auth errors that weren't being passed down correctly |
@justmobilize I should be able to test in a few days |
Awesome! |
Hi, I've had a chance to try with the new library tonight and I'm seeing what looks like the same error. This is with the PyPortal (M4 + ESP32) - I mention that only because I've tried to see if there is a difference connecting to wifi via the connection manager when the esp32 is a coprocessor. I don't think that's the issue. Here's the log output I get after boiling down the code to about the bare minimum
|
@jersu11 looks like after a timeout, it doesn't fully close out the socket. I will figure out how to reproduce this... |
Thanks @justmobilize - let me know if I can help. I'm happy to share my code or potentially the IoT thing certs for debugging. I did spend some time digging around documentation and hacking away at the libraries. Because it seems the CONNACK message never comes back, I double checked that the cert/key added via |
@jersu11 a few other small things to try:
|
@justmobilize, good suggestions for 1: I believe I have. when I print I've learned a bit more. I started my project with the example code, such as that found in the '/examples/aws_iot_simpletest.py' found in this library and also in the Plant Monitor code
When I ran this code initially, I would get an error I had been a little confused about why I needed to be explicit about the port, since within the MQTT library, MQTT_TLS_PORT should have already been set when 'is_ssl' is True. It occurred to me today that I should set It feels like we're a lot closer to finding a solution. However, the code still lands on the same MMQTTException of 'Repeated connect failures'. I've run this with both the latest release of the adafruit_minimqtt library and a second time with your recent changes/commit to adaruit_minimqtt.py. Same result for both.
|
Oh awesome. And with that error, we can fix that. For this:
In your And I'll go look at docs. How MiniMQTT and SSL evolved, some documentation needs some help... |
Woohoo! That pystack setting did the trick. Thanks for your commitment to this issue the last few days. I really appreciate that. I noticed a couple other things, now that it's executing code in this library (Adafruit_CircuitPython_AWS_IOT). There's probably been a little drift between this lib and the MQTT lib. This library calls a client.loop_forever() method which doesn't exist in MQTT, and the call to client.loop() inherits the default MQTT timeout value of zero, which causes an error. I've made the changes/fixes in my local copy, both of which were trivial. I'm happy to make a PR, which could also include the addition of the 'is_ssl=True' to the example code. |
@jersu11 please do, although once you help, you'll become like me and want to help more... ;) Both this one and the |
@jersu11 if you have time, would you be willing to open up 2 issues in MiniMQTT?
This way I can focus on each and get PRs into the main library. |
@tannewt Should we consider raising the default PYSTACK? |
@dhalbert do you know why you would get this exception on some devices but not all? |
Which devices have you tested that are fine and which aren't? Different boards have different PYSTACK limits, based on RAM. |
I will let you know. I'm setting stuff up this weekend to test the PR that's being put together. I'll test both this and AzureIoT to see which have errors and which don't. I have pretty much all the common boards. |
The default |
Do you know which common ones have no PSRAM? |
There are Feather ESP32-S3 boards with 8MB flash and no PSRAM, and other with 4MB flash and 2MB PSRAM. |
Dang it. The one type of board I don't think I have... |
@jersu11 when you have time, can you please share your code? I can't actually get the pystack error on my pyportal (or any device) |
Those of you who are having trouble: what version of NINA-FW are you running on the PyPortal ESP32? Try updating it to the latest. New root certificates have been added. This may be a cert issue, but with poor error recovery mixed in. |
@justmobilize , here's the code that hits the pystack error for me. It's a slightly modified version of the
|
My apologies for not being able to follow-up and test, but I ended up not having the time at all. Thank you for the follow-up. I'll try the fix. |
It was a quite some work to update everything in my old demo and I am not fully done yet, but updating everything on my Adafruit Pyportal allows me to subscribe successfully to my MQTT topic even without the CIRCUITPY_PYSTACK_SIZE=3072 parameter in the settings.toml file. Now I still have to update my Pyportal application code to make it fully work but that is another problem I think. Thank you for the help. |
Awesome! |
excuse me I am having the similar issue and I struggle following what the solution is here. can you explain please what I need to do to solve the issue. @justmobilize @mlnrt |
@Shek20 I just updated to CiryuitPython 9 and updated the ESP32 and nina firmware to the latest |
Thank you! got it. I was having another issue based on the SSL configuration. |
Hello,
5 months ago, I had build a demo reusing the code in the PyPortal IoT Plant Monitor with AWS IoT and CircuitPython which I had modified.
Everything was working fine.
I was trying to recreate this demo and now the Adafruit Pyportal is not able to connect to AWS IoT. Even when trying to recreate the PyPortal IoT Plant Monitor with AWS IoT and CircuitPython demo instead of my modified demo it fails with the same error:
Could it be because of this issue AWS IoT SDK Python V2 Support
Thank you in advance
The text was updated successfully, but these errors were encountered: