# MQTT publish (paho) not working with new firmware

**URL:** <https://mangoh.discourse.group/t/mqtt-publish-paho-not-working-with-new-firmware/1373>\
**Category:** mangOH Red\
**Created:** [May 2, 2018, 11:14am UTC](https://mangoh.discourse.group/t/mqtt-publish-paho-not-working-with-new-firmware/1373 "2018-05-02T11:14:01Z")\
**Posts on this page:** 16\
**Page:** 1

<div class="post-metadata">

**Author:** ![basti](https://avatars.discourse-cdn.com/v4/letter/b/fbc32d/32.png) [@basti](https://mangoh.discourse.group/u/basti)\
**Post date:** [May 2, 2018, 11:14am UTC](https://mangoh.discourse.group/t/mqtt-publish-paho-not-working-with-new-firmware/1373/1 "2018-05-02T11:14:01Z")

</div>

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!

---

<div class="post-metadata">

**Author:** ![basti](https://avatars.discourse-cdn.com/v4/letter/b/fbc32d/32.png) [@basti](https://mangoh.discourse.group/u/basti)\
**Post date:** [May 2, 2018, 12:05pm UTC](https://mangoh.discourse.group/t/mqtt-publish-paho-not-working-with-new-firmware/1373/2 "2018-05-02T12:05:26Z")

</div>

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/.

---

<div class="post-metadata">

**Author:** ![Kayathri](https://avatars.discourse-cdn.com/v4/letter/k/e56c9b/32.png) [@Kayathri](https://mangoh.discourse.group/u/Kayathri)\
**Post date:** [May 18, 2018, 4:43am UTC](https://mangoh.discourse.group/t/mqtt-publish-paho-not-working-with-new-firmware/1373/3 "2018-05-18T04:43:55Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![basti](https://avatars.discourse-cdn.com/v4/letter/b/fbc32d/32.png) [@basti](https://mangoh.discourse.group/u/basti)\
**Post date:** [May 18, 2018, 5:51am UTC](https://mangoh.discourse.group/t/mqtt-publish-paho-not-working-with-new-firmware/1373/4 "2018-05-18T05:51:07Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![Kayathri](https://avatars.discourse-cdn.com/v4/letter/k/e56c9b/32.png) [@Kayathri](https://mangoh.discourse.group/u/Kayathri)\
**Post date:** [May 18, 2018, 7:38am UTC](https://mangoh.discourse.group/t/mqtt-publish-paho-not-working-with-new-firmware/1373/5 "2018-05-18T07:38:47Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![basti](https://avatars.discourse-cdn.com/v4/letter/b/fbc32d/32.png) [@basti](https://mangoh.discourse.group/u/basti)\
**Post date:** [May 18, 2018, 8:54am UTC](https://mangoh.discourse.group/t/mqtt-publish-paho-not-working-with-new-firmware/1373/6 "2018-05-18T08:54:02Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![david](https://avatars.discourse-cdn.com/v4/letter/d/aeb1de/32.png) [@david](https://mangoh.discourse.group/u/david)\
**Post date:** [June 3, 2018, 1:11pm UTC](https://mangoh.discourse.group/t/mqtt-publish-paho-not-working-with-new-firmware/1373/7 "2018-06-03T13:11:46Z")

</div>

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 ?

---

<div class="post-metadata">

**Author:** ![basti](https://avatars.discourse-cdn.com/v4/letter/b/fbc32d/32.png) [@basti](https://mangoh.discourse.group/u/basti)\
**Post date:** [June 3, 2018, 7:18pm UTC](https://mangoh.discourse.group/t/mqtt-publish-paho-not-working-with-new-firmware/1373/8 "2018-06-03T19:18:09Z")

</div>

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?

---

<div class="post-metadata">

**Author:** ![david](https://avatars.discourse-cdn.com/v4/letter/d/aeb1de/32.png) [@david](https://mangoh.discourse.group/u/david)\
**Post date:** [June 4, 2018, 6:20am UTC](https://mangoh.discourse.group/t/mqtt-publish-paho-not-working-with-new-firmware/1373/9 "2018-06-04T06:20:17Z")

</div>

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 !

---

<div class="post-metadata">

**Author:** ![basti](https://avatars.discourse-cdn.com/v4/letter/b/fbc32d/32.png) [@basti](https://mangoh.discourse.group/u/basti)\
**Post date:** [June 4, 2018, 7:19am UTC](https://mangoh.discourse.group/t/mqtt-publish-paho-not-working-with-new-firmware/1373/10 "2018-06-04T07:19:01Z")

</div>

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](https://docs.legato.io/16_10/defFilesCdef.html)

---

<div class="post-metadata">

**Author:** ![dfrey](https://sea2.discourse-cdn.com/flex016/user_avatar/mangoh.discourse.group/dfrey/32/303_2.png) [@dfrey](https://mangoh.discourse.group/u/dfrey)\
**Post date:** [June 4, 2018, 9:35am UTC](https://mangoh.discourse.group/t/mqtt-publish-paho-not-working-with-new-firmware/1373/11 "2018-06-04T09:35:28Z")

</div>

Thanks @basti

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

---

<div class="post-metadata">

**Author:** ![nick](https://sea2.discourse-cdn.com/flex016/user_avatar/mangoh.discourse.group/nick/32/1380_2.png) [@nick](https://mangoh.discourse.group/u/nick)\
**Post date:** [June 12, 2018, 10:01pm UTC](https://mangoh.discourse.group/t/mqtt-publish-paho-not-working-with-new-firmware/1373/12 "2018-06-12T22:01:49Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![devaiah](https://avatars.discourse-cdn.com/v4/letter/d/8edcca/32.png) [@devaiah](https://mangoh.discourse.group/u/devaiah)\
**Post date:** [June 23, 2018, 1:11pm UTC](https://mangoh.discourse.group/t/mqtt-publish-paho-not-working-with-new-firmware/1373/13 "2018-06-23T13:11:21Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![dfrey](https://sea2.discourse-cdn.com/flex016/user_avatar/mangoh.discourse.group/dfrey/32/303_2.png) [@dfrey](https://mangoh.discourse.group/u/dfrey)\
**Post date:** [July 11, 2018, 6:27pm UTC](https://mangoh.discourse.group/t/mqtt-publish-paho-not-working-with-new-firmware/1373/14 "2018-07-11T18:27:37Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![gavinoimparato1](https://avatars.discourse-cdn.com/v4/letter/g/f475e1/32.png) [@gavinoimparato1](https://mangoh.discourse.group/u/gavinoimparato1)\
**Post date:** [April 15, 2021, 3:06pm UTC](https://mangoh.discourse.group/t/mqtt-publish-paho-not-working-with-new-firmware/1373/15 "2021-04-15T15:06:02Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![jameswollaeger](https://avatars.discourse-cdn.com/v4/letter/j/e495f1/32.png) [@jameswollaeger](https://mangoh.discourse.group/u/jameswollaeger)\
**Post date:** [May 5, 2021, 3:29pm UTC](https://mangoh.discourse.group/t/mqtt-publish-paho-not-working-with-new-firmware/1373/16 "2021-05-05T15:29:04Z")

</div>

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/  
}

}
