← Back to team overview

mqtt-users team mailing list archive

Re: will_set() not working on cross compiled libmosquitto for ARM linux ..

 

Hi Paulo,

Thanks for getting in touch, it's good to hear from people using
slightly more unusual devices.

> On the host machine, and python environment, I'm very productive building
> what I need to do, and the broker and clients function without a hitch.

Good to hear! Did you see that I've produced a pure Python
implementation of libmosquitto? It's still in need of further testing
but might be of interest.
http://mosquitto.org/2012/05/python-client-module-available-for-testing/

> I also had to modify net_mosq.c such that #define AI_ADDRCONFIG 0 is enabled.
>
> Is this the correct approach?

uclibc has had support for AI_ADDRCONFIG since about 2008 from what
I've just found, so you shouldn't need to make that #define. It does
need support compiling in though, so it's possible your uclibc doesn't
include that option. Either way, I don't think it is a crucial
parameter. In your case in particular, I presume that the device
interface will be static and predictable.

> What I am finding is that the devices are able to connect, publish and
> subscribe to messages from the broker, however the mosquitto_will_set(..)
> method does not seem to be functioning at all. I am getting a success return
> code when initialising the will_set call (just prior to to the connect call
> as per the doco). But when power is cut and device drops out, the broker
> never sends the will message as expected..

What value are you setting for your keepalive on the client? It may
take up to keepalive*1.5 seconds for the broker to determine that the
client is no longer present. If you are testing locally the broker
will normally find out instantly and likewise if some wired network
connections drop it will be found very quickly, but on wireless
connections the TCP stack won't return a disconnect error for a long
time meaning the broker must rely on the keepalive.

Have you tested the will using two mosquitto_sub instances on a single
computer? That works for me so I'm presuming that your problem
something similar to what I have described above.

Cheers,

Roger


Follow ups

References