-
Notifications
You must be signed in to change notification settings - Fork 12
Sparkfun AssetTracker: MQTT problem when connecting through LTE modem #50
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
Hi David, All I can suggest is checking that you are passing the certs and key correctly formatted as I did run into an issue where I had to use this exact formatting to define the certs and key in PROGMEM. IIRC, if I included a line break before the Code1 13 is the MQTT error class. Code2 8 is an "internal error"... Not much help... Are there any more clues in the debug messages ( I hope this helps, |
Thanks Paul for your prompt reply. Actually Code2 = 8 is "Cannot set secure socket" according to A.8.4.1 of AT commands manual. It seems related to some issue regarding certification chain. All I can say is that the same cert and key Is there any option on SARA R5 API to disable "SSL Secure" in the same way I can do on MQTTX or MQTT EXPLORER ? Anyway I tried your suggested format, and enabled debugging, got the same error (log tail):
David |
Comparing the debugging obtained from both test connections, that is, test.mosquitto.org:8883 and my_broker:8883, I got in the first case (test.mosquitto.org):
In the latter case (my MQTT broker):
It seems that the only difference is |
Hi David,
Agreed, Code2 == 8 is Cannot set secure socket. (I was looking at an old version of the AT Manual previously.) Maybe you need to change the SparkFun_u-blox_SARA-R5_Arduino_Library/src/SparkFun_u-blox_SARA-R5_Arduino_Library.h Lines 575 to 588 in cc961b2
SparkFun_u-blox_SARA-R5_Arduino_Library/src/SparkFun_u-blox_SARA-R5_Arduino_Library.h Lines 598 to 605 in cc961b2
I hope this helps, |
IT DOES WORK NOW! :-) I re-made all the certificates and changed the setting of param Thanks Paul again for your precious support! :-) |
No problem David - I'm glad it's working... Closing... Best wishes, |
Hi all,
As per previous related issues, I purchased a Sparkfun AssetTracker development kit with MicroMod ESP32 add-on, LTE/GNSS antennas and so on.
I developed an application which connects to a MOSQUITTO broker on port 8883 (in TLS/SSL mode) and sends some topics to it.
All works flawlessly when connecting to the MOSQUITTO test broker (test.mosquitto.org:8883) with both wifi and LTE connection.
Then I installed my MOSQUITTO broker on a remote server controlled by me (with public static IP 2.XXX.XXX.XXX) and certificates generated by me through OpenSSL. The MQTT connection runs ok when using wifi connection (library PubSubClient) while the problem occurs when using LTE.
I can say that same certificates work when using MQTT client as MQTTX or MQTT EXPLORER connecting to the same broker 2.XXX.XXX.XXX:8883.
I could verify that the source code written to set the modem and launch the MQTT connection works fine (result is always ok for each instruction). This is the code (which I had found as sample code around there):
All above instructions return
SARA_R5_error_t=0
(success). But when callinggetMQTTprotocolError()
insidemqttCallback()
, I got an error on commandSARA_R5_MQTT_COMMAND_LOGIN
(command=1) witherror codes 13 and 8
.According to SARA R5 AT commands documentation, the error code = 8 says "Cannot set secure socket".
This is the source code:
This is the output:
15:44:16.186 ---> mqttCallback(): command 1 protocol error code1 13 code2 8
I tried also to comment the following line:
configSecurityProfileString(LTE_SEC_PROFILE_MQTT, SARA_R5_SEC_PROFILE_PARAM_SNI, broker);
and to disable client certificate evaluation:
configSecurityProfile(LTE_SEC_PROFILE_MQTT, SARA_R5_SEC_PROFILE_PARAM_CERT_VAL_LEVEL, SARA_R5_SEC_PROFILE_CERTVAL_OPCODE_NO);
without success.
Any help would be very appreciated!
David
The text was updated successfully, but these errors were encountered: