← Back to team overview

mqtt-users team mailing list archive

Re: Mosquitto not recognizing to messages coming from Arduino

 

Roger,

Thanks for your assistance. When I used your commands I was unable to
recreate the problem I was seeing the other day. I suspect that I had not
properly disabled (even though I could have sworn I did disable it)

I wonder would you consider updating the install program for the mosquitto
package so that it configures iptables if it is installed on the machine (as
it will often be). When I  did a bit more debugging I found to my surprise
that mosquitto is using UDP port 17500 as well as TCP port 1883 (obviously I
didn't read the MQTT spec fully).

These are the commands that I needed to get mosquitto running with iptables

$ sudo iptables -A  INPUT -p tcp -m tcp --dport 1883 -j ACCEPT
$ sudo iptables -A  INPUT -p udp -m udp --dport 17500 -j ACCEPT

An even better solution was to copy the following file into the
/etc/iptables.d/filter/INPUT directory and then restart the iptables service


Regards,
             Brian
http://www.brianodonovan.ie




On 27 October 2010 18:33, Roger Light <roger@xxxxxxxxxx> wrote:

> Hi Brian,
>
> Sorry to hear you're having problems!
>
> > I did a little bit more investigating and it seems that the Mosquitto
> broker
> > won't register any messages coming from another machine either using
> > mosquitto_pub command or using a test program I wrote using the IA92 Java
> > client
>
> Do you mean that mosquitto_pub will connect and seems to succeed, but
> nothing is received? It may be helpful to look at the debug output of
> mosquitto_pub when trying to send a message with QoS>0, so:
>
> mosquitto_pub -h remote_machine -t foo -m test -q 2 -d
>
> I'd expect something like this:
>
> Received CONNACK
> Sending PUBLISH (0, 2, 0, 1, 'foo', ... (4 bytes))
> Received PUBREC (Mid: 1)
> Sending PUBREL (Mid: 1)
> Received PUBCOMP (Mid: 1)
>
> Another thought, if the client simply isn't connecting properly, is
> that mosquitto could be listening on the local interface only. You can
> check this by using "netstat -atn" to display network connection
> information and then searching for the LISTEN line related to
> mosquitto on port 1883. If it's listening on 0.0.0.0:1883 then all
> should be fine. If on 127.0.0.1:1883 then it's only listening on to
> connections from the local machine.
>
> Cheers,
>
> Roger
>

Attachment: 3-mosuitto-allow.rule
Description: Binary data


Follow ups

References