<turbo-stream action="append" target="posts_list"><template>    <div class="postbit" id="258679" data-post-id="258679">
  <section>
    <div class="post-wrap">


					<div class="post-header">
		        <div class="user-avatar">
		          <img alt="brianmay" src="https://forum.elixirforum.com/user_avatar/forum.elixirforum.com/brianmay/120/19386_2.png" width="120" height="120" />
		        </div>
					
						<div class="user-details">
		          <div class="user-name">
		            <h3>
                  brianmay
                    <span class="op-star" title="Thread Starter">
                      <img alt="OP" class="op-star-icon" src="/assets/thread-icons/thread-icon-thread-starter-df91e872.png" />
                    </span>
                  </h3>
		          </div>
						
						</div>
					
					</div>

	        <div class="thread-main">
	            <div class="post-body" data-turbo="false">
								<p>The new client is the old one reconnecting after the old connection failed.</p> 
	            </div>

	            <div class="base-line">
	                <div class="thread-counters">
	                    <span class="thread-count count-likes js-likers-trigger" title="Likes" data-post-id="258679" data-batch-url="/posts/batch_likers">
                        0
                      </span>
                      <!-- <span class="thread-count js-solved-indicator" title="Marked as solution"></span> -->
	                </div>
	                <div class="go-to-post">
	                  <a title="Go to post" alt="Go to post" href="https://forum.elixirforum.com/t/any-recommendations-on-a-mqtt-client-for-elixir/41028/42">Post #41</a>
	                </div>
	            </div>
              <div id="likers-container-258679" 
                   class="likers-container"
                   data-first-post="false"
                   data-batch-url="/posts/batch_likers">
                   <div class="likers-placeholder" 
                     data-likers-post-id="258679"
                     data-batch-url="/posts/batch_likers">
                  <div class="post-likers"></div>
                </div>
              </div>
	        </div>
			

    </div>

    <div class="triangle-top-right type-standard-post cat-standard-post" title="Post #41"></div>
  </section>
</div>
    <div class="postbit" id="258680" data-post-id="258680">
  <section>
    <div class="post-wrap">


					<div class="post-header">
		        <div class="user-avatar">
		          <img alt="brianmay" src="https://forum.elixirforum.com/user_avatar/forum.elixirforum.com/brianmay/120/19386_2.png" width="120" height="120" />
		        </div>
					
						<div class="user-details">
		          <div class="user-name">
		            <h3>
                  brianmay
                    <span class="op-star" title="Thread Starter">
                      <img alt="OP" class="op-star-icon" src="/assets/thread-icons/thread-icon-thread-starter-df91e872.png" />
                    </span>
                  </h3>
		          </div>
						
						</div>
					
					</div>

	        <div class="thread-main">
	            <div class="post-body" data-turbo="false">
								<p>Looking at this more, I can see that after a publish it can be more then 30 seconds (the keep alive time) after sending a PUBLISH command and sending the ping. And sometimes (but not always) mosquitto complains and disconnects the client.</p>
<p>It seems that the timer code is triggered, but <code>should_ping(ConnMod, Sock, LastPktId)</code> returns false, so we don’t send the ping.</p>
<pre data-code-wrap="elixir"><code class="lang-elixir">should_ping(ConnMod, Sock, _LastPktId) -&gt;
    case ConnMod:getstat(Sock, [send_oct]) of
        {ok, [{send_oct, Val}]} -&gt;
            OldVal = put(send_oct, Val),
            OldVal == undefined orelse OldVal == Val;
        Error = {error, _Reason} -&gt;
            Error
    end.
</code></pre>
<p>I am finding it difficult to interpret what this does.</p>
<p>I am going to set the config option <code>force_ping</code> to true, which I believe bypasses that test, see if that helps.</p> 
	            </div>

	            <div class="base-line">
	                <div class="thread-counters">
	                    <span class="thread-count count-likes js-likers-trigger" title="Likes" data-post-id="258680" data-batch-url="/posts/batch_likers">
                        0
                      </span>
                      <!-- <span class="thread-count js-solved-indicator" title="Marked as solution"></span> -->
	                </div>
	                <div class="go-to-post">
	                  <a title="Go to post" alt="Go to post" href="https://forum.elixirforum.com/t/any-recommendations-on-a-mqtt-client-for-elixir/41028/43">Post #42</a>
	                </div>
	            </div>
              <div id="likers-container-258680" 
                   class="likers-container"
                   data-first-post="false"
                   data-batch-url="/posts/batch_likers">
                   <div class="likers-placeholder" 
                     data-likers-post-id="258680"
                     data-batch-url="/posts/batch_likers">
                  <div class="post-likers"></div>
                </div>
              </div>
	        </div>
			

    </div>

    <div class="triangle-top-right type-standard-post cat-standard-post" title="Post #42"></div>
  </section>
</div>
    <div class="postbit" id="258686" data-post-id="258686">
  <section>
    <div class="post-wrap">


					<div class="post-header">
		        <div class="user-avatar">
		          <img alt="brianmay" src="https://forum.elixirforum.com/user_avatar/forum.elixirforum.com/brianmay/120/19386_2.png" width="120" height="120" />
		        </div>
					
						<div class="user-details">
		          <div class="user-name">
		            <h3>
                  brianmay
                    <span class="op-star" title="Thread Starter">
                      <img alt="OP" class="op-star-icon" src="/assets/thread-icons/thread-icon-thread-starter-df91e872.png" />
                    </span>
                  </h3>
		          </div>
						
						</div>
					
					</div>

	        <div class="thread-main">
	            <div class="post-body" data-turbo="false">
								<p>The process which I said wasn’t working, may have actually been working fine, but coincidentally may not have  busy at same time mqtt connection went down to normal operation. Have more debugging added now, will watch and see what happens.</p>
<p>I think the mqtt connection isn’t down for long, so chances of missing out on messages is small, but it was annoying me - especially when trying to diagnose another bigger issue, so fingers crossed that is resolved now.</p> 
	            </div>

	            <div class="base-line">
	                <div class="thread-counters">
	                    <span class="thread-count count-likes js-likers-trigger" title="Likes" data-post-id="258686" data-batch-url="/posts/batch_likers">
                        0
                      </span>
                      <!-- <span class="thread-count js-solved-indicator" title="Marked as solution"></span> -->
	                </div>
	                <div class="go-to-post">
	                  <a title="Go to post" alt="Go to post" href="https://forum.elixirforum.com/t/any-recommendations-on-a-mqtt-client-for-elixir/41028/44">Post #43</a>
	                </div>
	            </div>
              <div id="likers-container-258686" 
                   class="likers-container"
                   data-first-post="false"
                   data-batch-url="/posts/batch_likers">
                   <div class="likers-placeholder" 
                     data-likers-post-id="258686"
                     data-batch-url="/posts/batch_likers">
                  <div class="post-likers"></div>
                </div>
              </div>
	        </div>
			

    </div>

    <div class="triangle-top-right type-standard-post cat-standard-post" title="Post #43"></div>
  </section>
</div>
    <div class="postbit" id="258688" data-post-id="258688">
  <section>
    <div class="post-wrap">


					<div class="post-header">
		        <div class="user-avatar">
		          <img alt="Sebb" src="https://forum.elixirforum.com/user_avatar/forum.elixirforum.com/Sebb/120/21818_2.png" width="120" height="120" />
		        </div>
					
						<div class="user-details">
		          <div class="user-name">
		            <h3>
                  Sebb
                  </h3>
		          </div>
						
						</div>
					
					</div>

	        <div class="thread-main">
	            <div class="post-body" data-turbo="false">
								<aside class="quote no-group" data-username="brianmay" data-post="42" data-topic="41028" data-full="true">
<div class="title">
<div class="quote-controls"></div>
<img alt="" width="24" height="24" src="https://forum.elixirforum.com/user_avatar/forum.elixirforum.com/brianmay/48/19386_2.png" class="avatar"> brianmay:</div>
<blockquote>
<p>The new client is the old one reconnecting after the old connection failed.</p>
</blockquote>
</aside>
<p>100% sure? Thats all happening at the same time.</p> 
	            </div>

	            <div class="base-line">
	                <div class="thread-counters">
	                    <span class="thread-count count-likes js-likers-trigger" title="Likes" data-post-id="258688" data-batch-url="/posts/batch_likers">
                        0
                      </span>
                      <!-- <span class="thread-count js-solved-indicator" title="Marked as solution"></span> -->
	                </div>
	                <div class="go-to-post">
	                  <a title="Go to post" alt="Go to post" href="https://forum.elixirforum.com/t/any-recommendations-on-a-mqtt-client-for-elixir/41028/45">Post #44</a>
	                </div>
	            </div>
              <div id="likers-container-258688" 
                   class="likers-container"
                   data-first-post="false"
                   data-batch-url="/posts/batch_likers">
                   <div class="likers-placeholder" 
                     data-likers-post-id="258688"
                     data-batch-url="/posts/batch_likers">
                  <div class="post-likers"></div>
                </div>
              </div>
	        </div>
			

    </div>

    <div class="triangle-top-right type-standard-post cat-standard-post" title="Post #44"></div>
  </section>
</div>
    <div class="postbit" id="258691" data-post-id="258691">
  <section>
    <div class="post-wrap">


					<div class="post-header">
		        <div class="user-avatar">
		          <img alt="brianmay" src="https://forum.elixirforum.com/user_avatar/forum.elixirforum.com/brianmay/120/19386_2.png" width="120" height="120" />
		        </div>
					
						<div class="user-details">
		          <div class="user-name">
		            <h3>
                  brianmay
                    <span class="op-star" title="Thread Starter">
                      <img alt="OP" class="op-star-icon" src="/assets/thread-icons/thread-icon-thread-starter-df91e872.png" />
                    </span>
                  </h3>
		          </div>
						
						</div>
					
					</div>

	        <div class="thread-main">
	            <div class="post-body" data-turbo="false">
								<p>Yes, definitely. That name is based on the hostname, which is automatically generated by nerves based on the mac address - or something like that.</p>
<p>Remember timestamps here are 1 second precision. So everything happened within 1 second.</p> 
	            </div>

	            <div class="base-line">
	                <div class="thread-counters">
	                    <span class="thread-count count-likes js-likers-trigger" title="Likes" data-post-id="258691" data-batch-url="/posts/batch_likers">
                        0
                      </span>
                      <!-- <span class="thread-count js-solved-indicator" title="Marked as solution"></span> -->
	                </div>
	                <div class="go-to-post">
	                  <a title="Go to post" alt="Go to post" href="https://forum.elixirforum.com/t/any-recommendations-on-a-mqtt-client-for-elixir/41028/46">Post #45</a>
	                </div>
	            </div>
              <div id="likers-container-258691" 
                   class="likers-container"
                   data-first-post="false"
                   data-batch-url="/posts/batch_likers">
                   <div class="likers-placeholder" 
                     data-likers-post-id="258691"
                     data-batch-url="/posts/batch_likers">
                  <div class="post-likers"></div>
                </div>
              </div>
	        </div>
			

    </div>

    <div class="triangle-top-right type-standard-post cat-standard-post" title="Post #45"></div>
  </section>
</div>
    <div class="postbit" id="258697" data-post-id="258697">
  <section>
    <div class="post-wrap">


					<div class="post-header">
		        <div class="user-avatar">
		          <img alt="Sebb" src="https://forum.elixirforum.com/user_avatar/forum.elixirforum.com/Sebb/120/21818_2.png" width="120" height="120" />
		        </div>
					
						<div class="user-details">
		          <div class="user-name">
		            <h3>
                  Sebb
                  </h3>
		          </div>
						
						</div>
					
					</div>

	        <div class="thread-main">
	            <div class="post-body" data-turbo="false">
								<aside class="quote no-group" data-username="brianmay" data-post="46" data-topic="41028">
<div class="title">
<div class="quote-controls"></div>
<img alt="" width="24" height="24" src="https://forum.elixirforum.com/user_avatar/forum.elixirforum.com/brianmay/48/19386_2.png" class="avatar"> brianmay:</div>
<blockquote>
<p>Remember timestamps here are 1 second precision.</p>
</blockquote>
</aside>
<p>OK, makes sense. You can set <code>log_dest syslog</code> to get precise timestamps. I’d want to be 100% sure that its the same client. Being on the same host does not mean its the same client.</p>
<p>You say you are using nerves. Is this an embedded device? Maybe hardware problems with ETH?</p>
<p>Can’t imagine that there is such a horrendous bug in emqttc.</p> 
	            </div>

	            <div class="base-line">
	                <div class="thread-counters">
	                    <span class="thread-count count-likes js-likers-trigger" title="Likes" data-post-id="258697" data-batch-url="/posts/batch_likers">
                        0
                      </span>
                      <!-- <span class="thread-count js-solved-indicator" title="Marked as solution"></span> -->
	                </div>
	                <div class="go-to-post">
	                  <a title="Go to post" alt="Go to post" href="https://forum.elixirforum.com/t/any-recommendations-on-a-mqtt-client-for-elixir/41028/47">Post #46</a>
	                </div>
	            </div>
              <div id="likers-container-258697" 
                   class="likers-container"
                   data-first-post="false"
                   data-batch-url="/posts/batch_likers">
                   <div class="likers-placeholder" 
                     data-likers-post-id="258697"
                     data-batch-url="/posts/batch_likers">
                  <div class="post-likers"></div>
                </div>
              </div>
	        </div>
			

    </div>

    <div class="triangle-top-right type-standard-post cat-standard-post" title="Post #46"></div>
  </section>
</div>
    <div class="postbit" id="258711" data-post-id="258711">
  <section>
    <div class="post-wrap">


					<div class="post-header">
		        <div class="user-avatar">
		          <img alt="brianmay" src="https://forum.elixirforum.com/user_avatar/forum.elixirforum.com/brianmay/120/19386_2.png" width="120" height="120" />
		        </div>
					
						<div class="user-details">
		          <div class="user-name">
		            <h3>
                  brianmay
                    <span class="op-star" title="Thread Starter">
                      <img alt="OP" class="op-star-icon" src="/assets/thread-icons/thread-icon-thread-starter-df91e872.png" />
                    </span>
                  </h3>
		          </div>
						
						</div>
					
					</div>

	        <div class="thread-main">
	            <div class="post-body" data-turbo="false">
								<p>I now have:</p>
<pre data-code-wrap="elixir"><code class="lang-elixir">log_timestamp_format %Y-%m-%dT%H:%M:%S
</code></pre>
<p>In my mosquitto.conf, which is better, but still only accurate to the second.</p>
<p>This is running on RPI3, although I have also seen the same problem running on my relatively fast desktop too.</p>
<p>The timeout errors disappeared when I set <code>force_ping=false</code>.</p>
<p>It definitely looks like a bug in emqtt to me. But possibly only causes problems for use with mosquitto broker, not sure.</p> 
	            </div>

	            <div class="base-line">
	                <div class="thread-counters">
	                    <span class="thread-count count-likes js-likers-trigger" title="Likes" data-post-id="258711" data-batch-url="/posts/batch_likers">
                        0
                      </span>
                      <!-- <span class="thread-count js-solved-indicator" title="Marked as solution"></span> -->
	                </div>
	                <div class="go-to-post">
	                  <a title="Go to post" alt="Go to post" href="https://forum.elixirforum.com/t/any-recommendations-on-a-mqtt-client-for-elixir/41028/48">Post #47</a>
	                </div>
	            </div>
              <div id="likers-container-258711" 
                   class="likers-container"
                   data-first-post="false"
                   data-batch-url="/posts/batch_likers">
                   <div class="likers-placeholder" 
                     data-likers-post-id="258711"
                     data-batch-url="/posts/batch_likers">
                  <div class="post-likers"></div>
                </div>
              </div>
	        </div>
			

    </div>

    <div class="triangle-top-right type-standard-post cat-standard-post" title="Post #47"></div>
  </section>
</div>
    <div class="postbit" id="258718" data-post-id="258718">
  <section>
    <div class="post-wrap">


					<div class="post-header">
		        <div class="user-avatar">
		          <img alt="Sebb" src="https://forum.elixirforum.com/user_avatar/forum.elixirforum.com/Sebb/120/21818_2.png" width="120" height="120" />
		        </div>
					
						<div class="user-details">
		          <div class="user-name">
		            <h3>
                  Sebb
                  </h3>
		          </div>
						
						</div>
					
					</div>

	        <div class="thread-main">
	            <div class="post-body" data-turbo="false">
								<p>mosquitto can’t log more precise (which is odd) but syslog can (<code>log_dest syslog</code> in .conf).</p> 
	            </div>

	            <div class="base-line">
	                <div class="thread-counters">
	                    <span class="thread-count count-likes js-likers-trigger" title="Likes" data-post-id="258718" data-batch-url="/posts/batch_likers">
                        0
                      </span>
                      <!-- <span class="thread-count js-solved-indicator" title="Marked as solution"></span> -->
	                </div>
	                <div class="go-to-post">
	                  <a title="Go to post" alt="Go to post" href="https://forum.elixirforum.com/t/any-recommendations-on-a-mqtt-client-for-elixir/41028/49">Post #48</a>
	                </div>
	            </div>
              <div id="likers-container-258718" 
                   class="likers-container"
                   data-first-post="false"
                   data-batch-url="/posts/batch_likers">
                   <div class="likers-placeholder" 
                     data-likers-post-id="258718"
                     data-batch-url="/posts/batch_likers">
                  <div class="post-likers"></div>
                </div>
              </div>
	        </div>
			

    </div>

    <div class="triangle-top-right type-standard-post cat-standard-post" title="Post #48"></div>
  </section>
</div>
    <div class="postbit" id="301208" data-post-id="301208">
  <section>
    <div class="post-wrap">


					<div class="post-header">
		        <div class="user-avatar">
		          <img alt="emiltin" src="https://forum.elixirforum.com/user_avatar/forum.elixirforum.com/emiltin/120/31867_2.png" width="120" height="120" />
		        </div>
					
						<div class="user-details">
		          <div class="user-name">
		            <h3>
                  emiltin
                  </h3>
		          </div>
						
						</div>
					
					</div>

	        <div class="thread-main">
	            <div class="post-body" data-turbo="false">
								<p>I’m trying to use emqtt, on elixir 1.15.5, Erlang/OTP 26, following this example:</p><aside class="onebox allowlistedgeneric" data-onebox-src="https://www.emqx.com/en/blog/mqtt-for-elixir">
  <header class="source">
      <img src="https://www.emqx.com/favicon/favicon-96x96.png" class="site-icon" alt="" width="96" height="96">

      <a href="https://www.emqx.com/en/blog/mqtt-for-elixir" target="_blank" rel="noopener nofollow ugc">www.emqx.com</a>
  </header>

  <article class="onebox-body">
    <img width="512" height="512" src="https://assets.emqx.com/images/86ad4aeb59c189299820836c814132d6.png" class="thumbnail onebox-avatar" alt="">

<h3><a href="https://www.emqx.com/en/blog/mqtt-for-elixir" target="_blank" rel="noopener nofollow ugc">MQTT for Elixir</a></h3>

  <p>This article introduces the MQTT protocol and its advantages, and demonstrates the use of MQTT in Elixir.</p>


  </article>

  <div class="onebox-metadata">
    
    
  </div>

  <div style="clear: both"></div>
</aside>

<p>But I keep getting this error:<br>
<code>22:41:33.452 [error] emqtt(rsmp): State: waiting_for_connack, Unexpected Event: (:info, {:EXIT, #Port&lt;0.10&gt;, :einval})</code></p>
<p>This issue on Github makes we think it could be an issue on OTP 26?<br>
<a href="https://github.com/emqx/emqtt/issues/203" class="onebox" target="_blank" rel="noopener nofollow ugc">https://github.com/emqx/emqtt/issues/203</a></p>
<p>Any experience/ideas? I just wanted to try mqtt on Elixir, but can’t really get past this roadblock.</p> 
	            </div>

	            <div class="base-line">
	                <div class="thread-counters">
	                    <span class="thread-count count-likes js-likers-trigger" title="Likes" data-post-id="301208" data-batch-url="/posts/batch_likers">
                        0
                      </span>
                      <!-- <span class="thread-count js-solved-indicator" title="Marked as solution"></span> -->
	                </div>
	                <div class="go-to-post">
	                  <a title="Go to post" alt="Go to post" href="https://forum.elixirforum.com/t/any-recommendations-on-a-mqtt-client-for-elixir/41028/50">Post #49</a>
	                </div>
	            </div>
              <div id="likers-container-301208" 
                   class="likers-container"
                   data-first-post="false"
                   data-batch-url="/posts/batch_likers">
                   <div class="likers-placeholder" 
                     data-likers-post-id="301208"
                     data-batch-url="/posts/batch_likers">
                  <div class="post-likers"></div>
                </div>
              </div>
	        </div>
			

    </div>

    <div class="triangle-top-right type-standard-post cat-standard-post" title="Post #49"></div>
  </section>
</div>
    <div class="postbit" id="301325" data-post-id="301325">
  <section>
    <div class="post-wrap">


					<div class="post-header">
		        <div class="user-avatar">
		          <img alt="emiltin" src="https://forum.elixirforum.com/user_avatar/forum.elixirforum.com/emiltin/120/31867_2.png" width="120" height="120" />
		        </div>
					
						<div class="user-details">
		          <div class="user-name">
		            <h3>
                  emiltin
                  </h3>
		          </div>
						
						</div>
					
					</div>

	        <div class="thread-main">
	            <div class="post-body" data-turbo="false">
								<p>Solved for now by downgrading Erlang from 26 to 25.</p> 
	            </div>

	            <div class="base-line">
	                <div class="thread-counters">
	                    <span class="thread-count count-likes js-likers-trigger" title="Likes" data-post-id="301325" data-batch-url="/posts/batch_likers">
                        0
                      </span>
                      <!-- <span class="thread-count js-solved-indicator" title="Marked as solution"></span> -->
	                </div>
	                <div class="go-to-post">
	                  <a title="Go to post" alt="Go to post" href="https://forum.elixirforum.com/t/any-recommendations-on-a-mqtt-client-for-elixir/41028/51">Post #50</a>
	                </div>
	            </div>
              <div id="likers-container-301325" 
                   class="likers-container"
                   data-first-post="false"
                   data-batch-url="/posts/batch_likers">
                   <div class="likers-placeholder" 
                     data-likers-post-id="301325"
                     data-batch-url="/posts/batch_likers">
                  <div class="post-likers"></div>
                </div>
              </div>
	        </div>
			

    </div>

    <div class="triangle-top-right type-standard-post cat-standard-post" title="Post #50"></div>
  </section>
</div>
</template></turbo-stream><turbo-stream action="replace" target="load-more-container"><template><div id="load-more-container" class="load-more-container">
    <a class="load-more-button" data-turbo-stream="true" href="/topics/41028/load_more?page=6">Load more posts (1 remaining)</a>
</div></template></turbo-stream>