anchor.diff:  
   -include("lorawan_db.hrl").
   
  --record(state, {conn, pid, ready, streams, publish_uplinks, publish_events, auth, nc}).
  +-record(state, {conn, pid, mref, ready, streams, publish_uplinks, publish_events, auth, nc}).
   
   start_connector(#connector{connid=Id, received=Received}=Connector) ->
       case lorawan_connector:pattern_for_cowboy(Received) of
  
positive.code:         when PatPub == undefined; PatPub == ?EMPTY_PATTERN ->
      {noreply, State};
  handle_info({event, _Node, Vars0}, #state{conn=Conn}=State) ->
      case ensure_connected(State) of
          {ok, State2} ->
              {noreply, handle_event(Vars0, State2)};
          {error, State2} ->
  
negative.code:         publish_uplinks=PubUp, publish_events=PubEv, name=UserName, pass=Password}=Conn]) ->
      ok = pg2:join({backend, App}, self()),
      try
          {ok, ensure_gun(
              #state{conn=Conn,
                  publish_uplinks=lorawan_connector:prepare_filling(PubUp),
                  publish_events=lorawan_connector:prepare_filling(PubEv),
                  auth=lorawan_connector:prepare_filling([UserName, Password]),
                  nc=1})}
      catch
          _:Error ->
              lorawan_connector:raise_failed(Id, Error),
              {stop, shutdown}
      end.
  
  handle_call(_Request, _From, State) ->
      {reply, {error, unknownmsg}, State}.
  
  