Hello community
I need your knowledge again.
The following code
r1= mqtt.setup("mqtts://test.mosquitto.org", 1) '
r2= mqtt.connect("", "")
wlog r1,r2
wait
under ESP 8266 1.44 it works fine, but
under ESP 32 1.48 it does not work at all.
What am I missing ?
the code is identical at the beginning.
Thanks for your help.
Michael
Esp 32 MQTT
- cicciocb
- Site Admin
- Posts: 2060
- Joined: Mon Feb 03, 2020 1:15 pm
- Location: Toulouse
- Has thanked: 439 times
- Been thanked: 1358 times
- Contact:
Re: Esp 32 MQTT
I think that it requires a certificate.
You can download the certificate from mosquitto test server here: Then, upload this file to Annex in the root folder (in the example below I left the original name "mosquitto.org.crt" and try the example below
You can download the certificate from mosquitto test server here: Then, upload this file to Annex in the root folder (in the example below I left the original name "mosquitto.org.crt" and try the example below
Code: [Local Link Removed for Guests]
' MQTT SSL test program
' Using mosquitto test server
a$ = file.read$("/mosquitto.org.crt") ' load the certificate
onmqtt mqtt_msg
print mqtt.certif(a$)
print mqtt.setup("mqtts://test.mosquitto.org", 1)
print mqtt.connect("", "") ' No login / pass required
print mqtt.subscribe("/AnnexTest") ' subscribe to the topic /AnnexTest
for z = 1 to 10
' send messages to the topic /AnnexTest
print mqtt.publish("/AnnexTest", "Annex"+str$(z))
pause 100
next z
print ramfree
wait
' receive messages from the server
mqtt_msg:
print "TOPIC : "; mqtt.topic$
print "MESSAGE: "; mqtt.message$
return
You do not have the required permissions to view the files attached to this post.
Re: Esp 32 MQTT
Thank you cicciocb
Thanks for the quick help
After seeing that it seems complicated to create a certificate, I used a Rapsi as a brocker.
Runs great and the data stays in house.
Michael
Thanks for the quick help
After seeing that it seems complicated to create a certificate, I used a Rapsi as a brocker.
Runs great and the data stays in house.
Michael