B4R Question [solved]MQTT Client SSL?

BertI

Member
Licensed User
Longtime User
Is there a way to connect a B4R MQTT client to a broker using SSL of some form? Tried using WiFiSSLSocket for the client stream but that didn't seem to work. Testing using test.mosquitto.org port 8883.
 

BertI

Member
Licensed User
Longtime User
Nothing much by way of reporting that I can see as yet other than it does not connect. On the other hand if I use WiFiSocket and port 1883 it connects ok. I am using ALL for ssl setting in board selector.

All else being the same, the differences between the non SSL and SSL attempts are as below. Should also mention, in case it has any bearing, that I'm using B4R v3.31 as have some as yet unresolved issues compiling the overall code using B4R v3.90. Also, using rMQTT_ex version 1.02

B4X:
    Public MQClient As WiFiSocket
    Public MQClientS As WiFiSSLSocket


'    MQTT.Initialize2(MQClient.Stream,"test.mosquitto.org",1883,MQCLID,"Mqtt_MessageArrived","mqtt_Disconnected")
    MQTT.Initialize2(MQClientS.Stream,"test.mosquitto.org",8883,MQCLID,"Mqtt_MessageArrived","mqtt_Disconnected")
 
Upvote 0

BertI

Member
Licensed User
Longtime User
It seems that it is another one of those available RAM issues when it comes to using SSL on an esp8266 platform. Appears that the SSL connection needs at least 21k of free RAM (which my application didn't have). A stripped down test showed it did work after all. How I'm going to scrape enough margin above 21k is another matter...

Strange though that it didn't cause any symptoms such as self reset
 
Upvote 0
Top