ESP32 - connect to Losant

Hello oh wise people of Losant!
I have now started dabbing into LoRa and the ESP32, specifically the “TTGO LORA ESP32 with display” board


I followed the ESP32 coding, some (A little old) from Losant at:


I tried compiling the latest example you sent me for ESP8266, and it is failing compilation on

BearSSL::WiFiClientSecure wifiClient;

It seems that Bear SSL is native to the ESP8266 branch of the Arduino compiler, but does not exist for other branches and specifically to the ESP32. Direct adding of the BearSSL c code from it’s website to the libraries directory of Arduino did not help.

Can your engineers help me connect to Losant once again?

Many thanks

Uri

Hi @Uri_Bear,

We are currently looking into this and will get back to you shortly with further information.

In the meantime, please let me know if you have any additional questions!

Thanks,
Julia

@Uri_Bear,

Since we are all working from home, I just ordered an ESP32 for testing on this. However, in the meantime, you don’t have to use our libraries to connect.

Our libraries are just tiny wrappers around MQTT Clients. In this case, if you can find an MQTT client that supports the ESP32, you can use that as well. Like this one:

You can find all the details on how to connect to the Losant Broker here:

Hi
Thank you for answering. I have used this library in the past for ESP8266 (based on Losant’s demo) but since Losant moved to SSL auth with a certificate, That solution has ceased working.

I am not much of a programmer, I need a complete solution that works. I am on the IoT device side… Please help!

I too am working from home, thank you for your support.

Uri

Hello
Is there any update on the ESP32 Losant demo?
reminder: The code on your official ESP32 walkthrough is old and does not support your new certificate based SSL.
Thanks
Uri

Hey @Uri_Bear,

Thanks for reaching back out.

It’s actually in our content pipeline to have that updated next couple of weeks! I’ll be sure to update this thread with the link to it when it’s out!

Thank you,
Heath

Hello
Is there any update on the ESP32 Losant demo?

My ESP32 project involves one ESP32 capturing data, transferring it to a second ESP32 which will serve as a LoRa aggregator. This will be the base for many other devices. The central ESP32 will connect to Losant … if you help me.
Most other SW and HW are ready & waiting for this final piece.
Uri

Hi @Uri_Bear,

We do have new example software for the ESP32 on github that connects to and sends state to the Losant platform with arduinojson v6.

Let me know if you have any other questions!

Thank you,
Heath

Thanks Heath!
The example seems to be working. I will start integration with my operational code.
My code does SSL accesses to Google cloud. Is there a way to shut down the Losant SSL tunnel (I don’t think 2 can exist simultaneously), then reopen it once the Google access is done?
I will need to loop through this process every a minute or so (One access to Losant, one to google … lather, rinse, repeat)
Thanks
Uri

@Uri_Bear,

Happy the example worked for you! For your second question, for that level of control of the connection, I’d suggest using an MQTT library directly over the Losant Arduino Library.

You may also find information about how to connect to the broker here: