Skip to content

Support for MQTT with TLS/SSL on ESP32 #9675

Discussion options

You must be logged in to vote

I found a same similar here https://stackoverflow.com/questions/68481716/micropython-https-request-blocks-further-requests.

So the problem was, I am running out of RAM. When I only run a simple test script on my board, it works. I post my code below:

user = b"........"  # use binary is import! otherwise wont work
password_mqtt = b"........"
topic = ".../.../.../"

ssl_params = {}

client = MQTTClient(client_id,
                    host,
                    port,
                    user=user, password=password_mqtt,
                    keepalive=30, ssl=True, ssl_params=ssl_params)
client.connect()
while True:
    client.publish(topic,
                   json.dumps({"temp": 10})
         …

Replies: 1 comment

Comment options

You must be logged in to vote
0 replies
Answer selected by djs0109
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
1 participant