diff --git a/apps/iot/src/iot_endpoint.erl b/apps/iot/src/iot_endpoint.erl index 466a903..efef8cc 100644 --- a/apps/iot/src/iot_endpoint.erl +++ b/apps/iot/src/iot_endpoint.erl @@ -261,7 +261,8 @@ create_postman(#endpoint{name = Name, config = Config = #{<<"protocol">> := <<"m {password, as_string(Password)}, {keepalive, Keepalive}, {auto_ack, true}, - {connect_timeout, 5}, + {connect_timeout, 5000}, + {proto_ver, v5}, {retry_interval, RetryInterval} ], diff --git a/apps/iot/src/iot_endpoint_sup.erl b/apps/iot/src/iot_endpoint_sup.erl index 38b790d..9b6aced 100644 --- a/apps/iot/src/iot_endpoint_sup.erl +++ b/apps/iot/src/iot_endpoint_sup.erl @@ -17,7 +17,7 @@ start_link() -> init([]) -> Specs = lists:map(fun child_spec/1, mnesia_endpoint:get_all_endpoints()), - {ok, {#{strategy => one_for_one, intensity => 1000, period => 3600}, []}}. + {ok, {#{strategy => one_for_one, intensity => 1000, period => 3600}, Specs}}. -spec ensured_endpoint_started(Name :: #endpoint{}) -> {ok, Pid :: pid()} | {error, Reason :: any()}. ensured_endpoint_started(Endpoint = #endpoint{}) ->