Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [mosquitto-dev] Fwd: Mosquitto Bridge Connection killed when client disconnectes

Do you use a last will message from your client?

If so, make sure it does not specify 'retained' or 'QoS2' or any '$...' topic.

In all these cases awsIOT kills the connection.

awsIOT is not MQTT-3.1.1 compliant but implements a (defined) subset

Christoph

Von meinem iPhone gesendet

Am 29.12.2015 um 11:20 schrieb Oegma2 <oegma2@xxxxxxxxx>:


Hi everybody

Almost end of 2015 - been an crazy push on IoT front with MQTT ^_^ and much more to come in 2016 looking at AWS now also supporting MQTT

My problem is actually linked to making IoT + Mosquitto + AWS Iot possible using a BRIDGE CONNECTION, but having troubles

Problem is as follow

I am busying doing some investigations to see if I can bridge a mosquitto V1.5 to amazon's AWS IoT

So far, I got it working and really happy, but the only downside is, if a client connected to the mosquitto broker, disconnects - I get an error stating "socket error....client [xxx], disconnected"

at the same time, the connection to the broker is also disconnected :(, which means any message from the AWS IOT side will not be pushed though until mosquitto reconnects

I've looked at the src code to see if I can ingore disconnects on TLS Bridge connections but my c is really rusty :)

The AWS IoT use secure TLS V1.2 connections and the bridge connection is thus also secure TLS

------------------------------------
Summary of the problem
------------------------------------
We a client connected to mosquitto broker disconnects, the bridge connection also disconnects

Below is the errors message in mosquito.log
Socket error on client 0d1fbdcc-9938-406d-b94f-be388b5789f6, disconnecting.
Socket error on client awsiobridge, disconnecting.

---------------------------------------------
Below is my mosquitto.conf file
---------------------------------------------
pid_file /var/run/mosquitto.pid

persistence true
#persistence_location /var/lib/mosquitto/

log_dest file /var/log/mosquitto/mosquitto.log

include_dir /etc/mosquitto/conf.d


#max_connections -1
#max_queued_messages 15000
#max_inflight_messages 0
log_timestamp true
#connection_messages true

#acl_file /etc/mosquitto/mosquitto.acl
allow_anonymous true

log_type debug
log_dest stdout

# BRIDGE SETUP BELOW TO AWS IoT
# Default but you should start the bridge automatically
# Connection name
connection awsiot

# Host and port of endpoint (your AWS IoT endpoint
address ____AWS IOT SERVER DNS:8883

start_type automatic

# Name of the user used to connect to local Mosquitto Broker
local_clientid awsiobridge

# Looks like AWS IoT Broker supports bridges, so we should enable this to for better loop detection
try_private true

# Set the mqtt protocoll to 3.1.1
bridge_protocol_version mqttv311

# AWS IoT Broker will only accept session with cleansession set to true
cleansession true

# AWS IoT Broker will immediately close connections if you try to publish to $SYS, therefore we need to turn off bridge notification (took me a while to find out!)
notifications false

# Topic configuration
# topic pattern [[[ out | in | both ] qos-level] local-prefix remote-prefix]
# topic clients/total in 0 test/mosquitto/org $SYS/broker/
topic # both

# Set client ID used on AWS IoT
remote_clientid Mosquittobroker

# Configure certificates like iot-root-ca.pem
bridge_cafile /etc/mosquitto/ca_certificates/iot-root-ca.pem
bridge_certfile /etc/mosquitto/certs/mosquittobroker-cert.pem
bridge_keyfile /etc/mosquitto/certs/mosquittobroker-private-key.pem

# Depending on system configuration, you might need deactivate hostname verification
bridge_insecure false


_______________________________________________
mosquitto-dev mailing list
mosquitto-dev@xxxxxxxxxxx
To change your delivery options, retrieve your password, or unsubscribe from this list, visit
https://dev.eclipse.org/mailman/listinfo/mosquitto-dev

Attachment: smime.p7s
Description: S/MIME cryptographic signature


Back to the top