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

Trying to connect with AWS iot Core using mqtt_as library but getting error #146

Open
meet1227 opened this issue Jul 17, 2024 · 2 comments

Comments

@meet1227
Copy link

I'm encountering an issue while using the tls.py example code with a library. I've configured the ca, cert, and key fields as per thing in AWS iot core. When attempting to connect to the server, I'm getting the following error:
OSError: (-17168, 'MBEDTLS_ERR_RSA_PRIVATE_FAILED+MBEDTLS_ERR_MPI_ALLOC_FAILED')

OUTPUT:

Checking WiFi integrity.
Got reliable connection
Connecting to broker.
Traceback (most recent call last):
  File "<stdin>", line 136, in <module>
  File "asyncio/core.py", line 1, in run
  File "asyncio/core.py", line 1, in run_until_complete
  File "asyncio/core.py", line 1, in run_until_complete
  File "<stdin>", line 111, in main
  File "mqtt_as.py", line 655, in connect
  File "mqtt_as.py", line 284, in _connect
OSError: (-17168, 'MBEDTLS_ERR_RSA_PRIVATE_FAILED+MBEDTLS_ERR_MPI_ALLOC_FAILED')
please help me in this issue

I am using ESPwroom32 hardware.

@meet1227 meet1227 changed the title Trying to connect with AWS iot Core using mqtt_as library but geting error Trying to connect with AWS iot Core using mqtt_as library but getting error Jul 17, 2024
@peterhinch
Copy link
Owner

It might be worth also posting in Discussions as there may be someone with experience of AWS iot core.

@bobveringa
Copy link
Contributor

The devices I work on also connect to AWS IoT core. We most often see this error when there is not enough (continuous) memory to allocate to storing some of the SSL things in memory. I think MicroPython v1.21 was the most problematic version, and more recent versions don't have this issue.

Try checking how much memory is used/available before you attempt to connect.

Also, are you using frozen bytecode?

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

3 participants