Unknown Error (-2) When Using MQTT Secure Client on SparkFun 9Dof DataLogger

Hello everyone,

I have been utilizing the SparkFun 9DoF DataLogger with secure client certs, ca, crt, and key files uploaded onto my datalogger via SD card. When I go through all of the procedures I keep receiving this error code

“[W] MQTT Secure Client disconnected - reconnecting … [E] MQTT Secure Client: Connection Error [-2]”

I searched through the Github and was not able to find anything on this specific error code or how to troubleshoot it given this device/firmware. Any tips or advice would be greatly appreciated!

Thank you!

MQTT Secure Client: Connection Error [-2], typically indicates a failure in the secure connection setup to the MQTT broker. Check the Certificates and Keys. The paths and names of the certificate and key files should match exactly with what your code expects. Incorrect paths or names can lead to errors in reading the files.

Hello! Thank you so much for your reply. I looked into it and I am unfortunately able to connect to the MQTT broker using MQTT explorer (app I am using) using the same certificate files and everything works. Even though I swapped the cert files (AKA Swap client and device) it still gives me the same -2 error on the 9DoF datalogger when I try to connect MQTT to my DataLogger via IoT. Any other directions would be greatly appreciated, thank you so much !

I’d maybe try another app/service to verify it isn’t a platform-specific issue

Are you using this guide? https://docs.sparkfun.com/SparkFun_Data … tion-setup