anchor.diff:      DeviceID = proplists:get_value(clientid, P),
       User     = proplists:get_value(username, P),
       Pwd      = proplists:get_value(password, P),
  -    KeepAlive = proplists:get_value(keepalive, P, ?DEFAULT_KEEPALIVE) * 1000,
  +    Ka       = case proplists:get_value(keepalive, P, ?DEFAULT_KEEPALIVE) of
  +        0   -> infinity;
  +        _Ka -> round(_Ka * 1000 * 1.5)
  +    end,
       Clean    = proplists:get_value(clean, P, 1),
   
       % load device settings from db
  
positive.code:             {stop, normal};
  
          ok ->
              {next_state, connected, StateData, round(Ka*1.5)}
      end;
  
  %
  
negative.code:     {ok, MsgWorker} = mqtt_message_worker:start_link(),
      mqtt_message_worker:publish(MsgWorker, self(), Msg), % async
  
      {reply, undefined, connected, StateData, Ka};
  
  % qos > 0
  connected(Msg=#mqtt_msg{type='PUBLISH', payload=P}, _,
  