This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

MSP432E401Y: MQTT SSL connection

Part Number: MSP432E401Y
Other Parts Discussed in Thread: SYSCONFIG

Hi, 

As discussion in original question i can not able to connect MQTT SSL connection for MSP432E401Y. I still get error -2021(SLNETERR_RET_CODE_FUNCTION_FAILED.

I disable 8883 and open port 1883 without ssl then MSP432E401Y connect successfully.

I use same Mqtt_Client_secure_file for CC3220 and successfully connect to same server.

Can any one help me?

Dinkar

  • Hi Dinkar,

    We will look into this and get back to you ASAP.

    Thanks,

    Alexis

  • Hello Dinkar,

    Which version of the SDK are you using?

    dinkar patel said:
    I disable 8883 and open port 1883 without ssl then MSP432E401Y connect successfully.

    Are you disabling this on the MSP432E4 or the MQTT broker? If disabling the port on MQTT broker, are you changing anything on the MSP432E4 Application?

    Thanks,

    Sai

  • Hi,

    I am using SDK version 3.20.00.10.

    Yes, i disable this on both side MSO432E4 and MQTT broker.

    After disabling on MQTT broker, I comment #define SECURE_CLIENT on MSP432E4.

    Thanks,

    Dinkar

  • dinkar patel said:
    After disabling on MQTT broker, I comment #define SECURE_CLIENT on MSP432E4

    Which MQTT broker are you using?

    Thanks,

    Sai

  • i am using mosquitto MQTT broker .

    Thanks

  • Hello Dinkar,

    Looks like the actual issue that you are facing is better described by this post from you.

    If you agree, I will close this post so that we can work on that post.

    Thanks,

    Sai

  • Hi sai,

    Thanks for reply but both are different problem.

    In this post i ask about MQTT SSL connection is not establish. here I use DHCP for device ip not  static IP.

    Thanks,

    Dinkar

  • Hi Dinkar,

    On the latest MSP432E4 v.3.30.0.22 SDK I do not have any issues running the mqttclient example with SECURE_CLIENT enabled.

    These were the steps I did after running the unmodified unsecure example to ensure my ethernet connection had internet connectivity:

    1. Follow the instructions in http://dev.ti.com/tirex/explore/node?node=AGiac10-yvbiz4HlO4xN0A__J4.hfJy__LATEST section "Secured Socket" to use sysconfig to setup the secure socket. Do not that you should name the secure object variable "externalCAPem" and the variable size "externalCAPemLen" as per the screenshot below:
    2. Open mqttClientHooks.c and paste in the certificate data into externalCAPem[]. You can find the certificate file on test.mosquitto.org, but I have included it here for your convenience:
      /* Certificate Authority certificate used to verify the server connection */
      uint8_t externalCAPem[] =
      "-----BEGIN CERTIFICATE-----\r\n"
      "MIIC8DCCAlmgAwIBAgIJAOD63PlXjJi8MA0GCSqGSIb3DQEBBQUAMIGQMQswCQYD\r\n"
      "VQQGEwJHQjEXMBUGA1UECAwOVW5pdGVkIEtpbmdkb20xDjAMBgNVBAcMBURlcmJ5\r\n"
      "MRIwEAYDVQQKDAlNb3NxdWl0dG8xCzAJBgNVBAsMAkNBMRYwFAYDVQQDDA1tb3Nx\r\n"
      "dWl0dG8ub3JnMR8wHQYJKoZIhvcNAQkBFhByb2dlckBhdGNob28ub3JnMB4XDTEy\r\n"
      "MDYyOTIyMTE1OVoXDTIyMDYyNzIyMTE1OVowgZAxCzAJBgNVBAYTAkdCMRcwFQYD\r\n"
      "VQQIDA5Vbml0ZWQgS2luZ2RvbTEOMAwGA1UEBwwFRGVyYnkxEjAQBgNVBAoMCU1v\r\n"
      "c3F1aXR0bzELMAkGA1UECwwCQ0ExFjAUBgNVBAMMDW1vc3F1aXR0by5vcmcxHzAd\r\n"
      "BgkqhkiG9w0BCQEWEHJvZ2VyQGF0Y2hvby5vcmcwgZ8wDQYJKoZIhvcNAQEBBQAD\r\n"
      "gY0AMIGJAoGBAMYkLmX7SqOT/jJCZoQ1NWdCrr/pq47m3xxyXcI+FLEmwbE3R9vM\r\n"
      "rE6sRbP2S89pfrCt7iuITXPKycpUcIU0mtcT1OqxGBV2lb6RaOT2gC5pxyGaFJ+h\r\n"
      "A+GIbdYKO3JprPxSBoRponZJvDGEZuM3N7p3S/lRoi7G5wG5mvUmaE5RAgMBAAGj\r\n"
      "UDBOMB0GA1UdDgQWBBTad2QneVztIPQzRRGj6ZHKqJTv5jAfBgNVHSMEGDAWgBTa\r\n"
      "d2QneVztIPQzRRGj6ZHKqJTv5jAMBgNVHRMEBTADAQH/MA0GCSqGSIb3DQEBBQUA\r\n"
      "A4GBAAqw1rK4NlRUCUBLhEFUQasjP7xfFqlVbE2cRy0Rs4o3KS0JwzQVBwG85xge\r\n"
      "REyPOFdGdhBY2P1FNRy0MDr6xr+D2ZOwxs63dG1nnAnWZg7qwoLgpZ4fESPD3PkA\r\n"
      "1ZgKJc2zbSQ9fCPxt2W3mdVav66c6fsb7els2W2Iz7gERJSX\r\n"
      "-----END CERTIFICATE-----";

    3. Go to your project properties and define SECURE_CLIENT in the predefined symbols screen, like so:

    That should allow you to connect to test.mosquitto.org securely on port 8883.

    Let me know if those steps don't work for you, or if you need further clarification.

    Regards,

    Michael

  • Hi Michael,

    thanks for reply.

    I install new sdk version 3.30.0.22.

    As per your suggestion i try to run mqttclient . but i can not able to open .syscfg file.

    there is a many error while open that file.

    if a add SECURE_CLIENT in predefined symbols. add certificate as you suggest but there is error.

    what is the problem?

    Thanks, 

    Dinkar 

  • Hi Dinkar,

    In order to properly access the mqttclient.sysconfig file, or any sysconfig files in v.3.30 projects, you will need to update to CCS 9.2. However, that version isn't quite released yet. It should be out soon, and at that point you should install it and use it instead of the current CCS you are using.

    Regards,

    Michael

  • Hi Dinkar,

    CCS version 9.2 just got released. You can find it online here: http://www.ti.com/tool/download/CCSTUDIO

    Please update to the latest version and see if you still run into sysconfig issues.

    Regards,

    Michael

  • Hi Michael,

    Now i am able to run mqttclient example of SDK3.30 on CCS9.2.

    My MSP432E401Y connect with secure connection on "test.mosquitto.org".

    But  but I am trying to connect with MY mqtt broker then its still return error -2021(SLNETERR_RET_CODE_FUNCTION_FAILED). However i connect with My mqtt broker using CC3220 successfully. I use same certificate for both MSP432E401Y and CC3220.

    Thanks, 

    Dinkar

  • Hi Dinkar,

    Have you verified that all of the other MQTT settings such as the client ID, authentication, etc. are all the same between your CC3220 project and your MSP432E4 project? 

    Without access to your server, I will not be able to directly debug your connection issue but perhaps there is some debug info you can collect yourself. I advise you get sniffer logs on the ethernet and wifi interfaces and see what difference is there in the MQTT connection. Also, does this behavior happen for both secured and non-secured MQTT?

    Regards,

    Michael

  • Hi Michael,

    All parameter related to MQTT are same for both MSP432E401Y and CC3220.

    There is a not problem with non_secure MQTT connection. only problem with secure connection.

    Which type of information you need for debug our server?

    Thanks,

    Dinkar 

  • Hi Dinkar,

    The most useful would be packet captures of the TLS handshake, both for the working CC3220 connection and the failing MSP432E4 connection. With the handshake, we might be able to see what is different and then get an idea of what needs to be fixed.

    Michael

**Attention** This is a public forum