MQTT publish (paho) not working with new firmware

Hello,

I have been using the MQTT publish example application, from mangOH git (paho_legato branch). I had it working somehow on WP7702, but had to import some SSL files to root folder.

Now again updated WP8548 with Release 15, and it seems to have different OpenSSL version as well. This might not be a bug in itself, but I do not know to what libraries I need to point the application for it to work again.

The application works as it should with Release 14 (OpenSSL 1.0.1p). On modules using newer OpenSSL 1.0.2n it does not work. I know @dfrey have been developing the paho_legato branch, but any help here would be great! Thanks!

Okay so I was able to solve this, I think. The libcrypto.so.* and libssl.so.* files are both located under /usr/lib, for previous versions libcrypto was found under /lib/.

Hi basti,

I am testing paho_mqtt version & I’m getting error like swi-mdm9x28 user.err Legato: =ERR= | supervisor[4340]/supervisor T=main | app.c CreateFileLink() 1588 | Failed to create link at ‘/lib/libcrypto.so’ in app ‘mqttClient’

How did you solved that problem?

Regards,
Kayathri

Hi @Kayathri,

If you are using a newer firmware, they have moved the libcrypto. Under pahoLegatoComponent → Component.cdef change:

/lib/libcrypto.so.1.0.0

to

/usr/lib/libcrypto.so.1.0.2

The /lib/libcrypto.so is just a symlink to the correct version.
You can also verify on the device that libcrypto.so.1.0.2 is present under /usr/lib with:

ls /usr/lib/libcrypto*

Hope this helped.

Hi basti,

Thank you,

I am able to run mqttClient app. I am getting error like mqttClientService[5233]/framework T=main | LE_FILENAME le_event_AddLayeredHandler() 1118 | Event handler name ‘MqttClient connection lost notification’ truncated to ‘MqttClient connection lost noti’.

I am able to ping 8.8.8.8 also

I am new to this environment. Help me to proceed further.

Regards,
Kayathri

Hi,

Difficult to tell from that alone. But are you using a working IP for the application? It needs to be able to send the messages to a MQTT broker.

Hello,
I ran into the same problem, i tried to change Component.cdef in pahoLegatoComponent but seems like my change doesn’t affect the program .
I am getting this error:

Jan  6 02:32:13 swi-mdm9x15 user.err Legato: =ERR= | supervisor[579]/supervisor 
   T=main | app.c CreateFileLink() 1593 | Failed to create link at 
  '/usr/lib/libssl.so.1.0.0' in app 'mqttClient'.

In Component.cdef i got :

 file:
{
    /usr/lib/ssl/openssl.cnf    /usr/lib/ssl/
    /usr/lib/libssl.so          /usr/lib/
    /usr/lib/libssl.so.1.0.2    /usr/lib/
    /usr/lib/libcrypto.so           /lib/
    /usr/lib/libcrypto.so.1.0.2     /lib/
    /lib/libnss_dns.so.2        /lib/
    /lib/libnss_dns-2.20.so     /lib/
    /lib/libresolv.so.2         /lib/
    /lib/libresolv-2.20.so      /lib/
}

I made sure that all of this lib’s exist on my device.

Any idea what i am doing worng ?

Hi,

It looks like the program is still trying to use libssl.so version 1.0.0. You have checked /usr/lib path and the version on the module is 1.0.2? Not 1.0.0?

Yes. Do you know what is the meaning of the second path ?

/usr/lib/ssl/ /usr/lib/ /lib/
i changed it to suite the first path and now my Component.cdef looks like this :
file:
{
/usr/lib/ssl/openssl.cnf /usr/lib/ssl/
/usr/lib/libssl.so /usr/lib/
/usr/lib/libssl.so.1.0.2 /usr/lib/
/usr/lib/libcrypto.so /usr/lib/
/usr/lib/libcrypto.so.1.0.2 /usr/lib/
/lib/libnss_dns.so.2 /lib/
/lib/libnss_dns-2.20.so /lib/
/lib/libresolv.so.2 /lib/
/lib/libresolv-2.20.so /lib/
}

But the program crashes and i am not able to connect to my board until i reset the power.

Thanks for your help !

I have this firmware installed on my WP77: SWI9X06Y_02.14.04.00

This is what my cdef looks like:

/usr/lib/ssl/openssl.cnf /usr/lib/ssl/
/usr/lib/libssl.so.1.0.2 /usr/lib/
/usr/lib/libcrypto.so.1.0.2 /lib/
/lib/libnss_dns.so.2 /lib/
/lib/libnss_dns-2.24.so /lib/
/lib/libresolv.so.2 /lib/
/lib/libresolv-2.24.so /lib/

This works fine for me. You can read more about CDEF here: Component Definition .cdef - Legato Docs

2 Likes

Thanks @basti

I think I will have to add some #if statements into the cdef.

1 Like

Do the location of these files also depend on the WP model? To my knowledge the slightly newer chipset on the WP76 might have newer firmware with a different library locations.

I modified the file section of Component.cdef as below and the app started running now.

file:
{
    /usr/lib/ssl/openssl.cnf    /usr/lib/ssl/
    /usr/lib/libssl.so.1.0.2    /usr/lib/
    /lib/libcrypt.so.1          /lib/
    /usr/lib/libcrypto.so.1.0.2 /lib/
    /lib/libnss_dns.so.2        /lib/
    /lib/libnss_dns-2.24.so     /lib/
    /lib/libresolv.so.2         /lib/
    /lib/libresolv-2.24.so      /lib/
}

I think the new path in the firmware is not updated in this particular Component.cdef file also I had to completely remove /usr/lib/libssl.so /usr/lib/ path to get it working.

Thank you all, @basti especially for pointing me towards solution!!

Regards,
Devaiah

I pushed an update to the use_paho_linux_version branch of the mqttClient which addresses the library path issues.

I have the same problem. Do you remember how did you solve it?

We added the following to our adef file of the app implementing the mqtt broker:

requires:
{
file:
{
// needed for networking:
/lib/libnss_compat.so.2 /lib/
/lib/libnss_files.so.2 /lib/
/etc/nsswitch.conf /etc/
/etc/hosts /etc/
/etc/resolv.conf /etc/
/lib/libnss_dns.so.2 /lib/
/lib/libresolv.so.2 /lib/
}

}