-->
Page 1 of 1

WiFiClientSecure - Multiple connections are not working

PostPosted: Thu Jun 17, 2021 5:20 am
by roboticboyer
I'm programming an ESP8266 to connect to a MQTT Broker and Telegram for my IOT project in Arduino

Universal Telegram Bot library requires WiFiClientSecure.
I use the WiFiClientSecure also for the MQTT PubSubClient library because the MQTT broker (flespi.io) requires a secure connection

I'm not able to have the 2 connections active at the same time.
When the ESP is connected to the MQTT broker, the Telegram bot is not able to communicate, even if there aren't any error or warning during compilation or runtime.
The work around is to close the MQTT connection, connect to telegram and then go back to MQTT
Is there any chance to have the 2 connections in parallel? or is a limitation of the secure connect (only 1 connection at once)?

Only n case I use a standard connection for MQTT, I can have Telegram and MQTT working in parallel

Any idea or suggestion?
thank you
Gio

Re: WiFiClientSecure - Multiple connections are not working

PostPosted: Thu Jun 17, 2021 5:31 am
by roboticboyer
I can post my code as an example of the issue

Re: WiFiClientSecure - Multiple connections are not working

PostPosted: Fri Jun 18, 2021 2:27 am
by schufti
i think it is a problem with too little ram to support two secure connections