<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0"><channel><title><![CDATA[Make node look for new&#x2F;better parent without restarting]]></title><description><![CDATA[<p dir="auto">Hi</p>
<p dir="auto">In my MySensors network I have a ESP8288 MQTT gateway and two repeaters and a number of sensor nodes. One of these are a button-node that I like to move around in my house. This means that sometimes I move it from one end of the house to the other, so it can no longer connect to the parent node it used to use. I know how to request an acknowledgement in the send method so I can resend the button-press-message, but is there a way to "give up" a parent node after a number of failed transmissions, and broadcast for a new one?</p>
<p dir="auto">I know I can do this by pulling the battery and restarting the node, but I'd rather it just do it by itself :)</p>
]]></description><link>https://forum.mysensors.org/topic/9540/make-node-look-for-new-better-parent-without-restarting</link><generator>RSS for Node</generator><lastBuildDate>Tue, 08 Sep 2026 03:35:30 GMT</lastBuildDate><atom:link href="https://forum.mysensors.org/topic/9540.rss" rel="self" type="application/rss+xml"/><pubDate>Fri, 27 Jul 2018 18:24:58 GMT</pubDate><ttl>60</ttl><item><title><![CDATA[Reply to Make node look for new&#x2F;better parent without restarting on Fri, 10 Aug 2018 11:53:30 GMT]]></title><description><![CDATA[<p dir="auto">Sorry I haven't gotten back to you, been a busy week.</p>
<p dir="auto">The MY_TRANSPORT_MAX_TX_FAILURES seems to do the job perfectly, I adjusted it down to 1 for the node, and resend the message a couple of times if it fails.</p>
<p dir="auto">Thank you for your support :)</p>
<p dir="auto">Also thanks to berkseo, your code also works for me, but I do prefer the built in way now that I know of it. Less code for me to write and maintain :)</p>
]]></description><link>https://forum.mysensors.org/post/92382</link><guid isPermaLink="true">https://forum.mysensors.org/post/92382</guid><dc:creator><![CDATA[Henrik Nielsen]]></dc:creator><pubDate>Fri, 10 Aug 2018 11:53:30 GMT</pubDate></item><item><title><![CDATA[Reply to Make node look for new&#x2F;better parent without restarting on Sun, 05 Aug 2018 10:57:41 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="/user/henrik-nielsen" aria-label="Profile: henrik-nielsen">@<bdi>henrik-nielsen</bdi></a> said in <a href="/post/92010">Make node look for new/better parent without restarting</a>:</p>
<blockquote>
<p dir="auto">n my MySensors network I have a ESP8288 MQTT gateway and two repeaters and a number of sensor nodes. One of these are a button-node that I like to move around in my house. This means that sometimes I move it from one end of the house to the other, so it can no longer connect to the parent node it used to use. I know how to request an acknowledgement in the send method so I can resend the button-press-message, but is there a way to "give up" a parent node after a number of failed transmissions, and broadcast for a new one?<br />
I know I can do this by pulling the battery and restarting the node, but I'd rather it just do it by itself</p>
</blockquote>
<p dir="auto">It's part of my code, ... roughly so</p>
<pre><code>void check_parent() {
  _transportSM.findingParentNode = true;
  CORE_DEBUG(PSTR("MyS: SEND FIND PARENT REQUEST, WAIT RESPONSE\n"));
  tx_led ();
  _sendRoute(build(_msg, 255, NODE_SENSOR_ID, 3, 7).set(""));
  wait(2000, 3, 8);
  if (_msg.sensor == 255) {
    if (mGetCommand(_msg) == 3) {
      if (_msg.type == 8) {
        Ack_FP = 1;
        CORE_DEBUG(PSTR("MyS: PARENT RESPONSE FOUND\n"));
      }
    }
  }
  if (Ack_FP == 1) {
    CORE_DEBUG(PSTR("MyS: FIND PARENT PROCESS\n"));
    rx_led ();
    Ack_FP = 0;
    transportSwitchSM(stParent);
    flag_nogateway_mode = 0;
    flag_find_parent_process = 1;
    CORE_DEBUG(PSTR("MyS: STANDART TRANSPORT MODE IS RESTORED\n"));
  } else {
    bc_led ();
    _transportSM.findingParentNode = false;
    CORE_DEBUG(PSTR("MyS: PARENT RESPONSE NOT FOUND\n"));
    _transportSM.failedUplinkTransmissions = 0;
    fp_timer = millis();
  }
}
</code></pre>
]]></description><link>https://forum.mysensors.org/post/92220</link><guid isPermaLink="true">https://forum.mysensors.org/post/92220</guid><dc:creator><![CDATA[berkseo]]></dc:creator><pubDate>Sun, 05 Aug 2018 10:57:41 GMT</pubDate></item><item><title><![CDATA[Reply to Make node look for new&#x2F;better parent without restarting on Sat, 28 Jul 2018 17:50:14 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="/user/henrik-nielsen" aria-label="Profile: henrik-nielsen">@<bdi>henrik-nielsen</bdi></a> By default, a new parent it searched after 5 (regular node) or 10 (repeater) failed uplink transmissions - alternatively, you can be more restrictive, by setting <code>MY_TRANSPORT_MAX_TX_FAILURES</code> to anything smaller.</p>
]]></description><link>https://forum.mysensors.org/post/92027</link><guid isPermaLink="true">https://forum.mysensors.org/post/92027</guid><dc:creator><![CDATA[tekka]]></dc:creator><pubDate>Sat, 28 Jul 2018 17:50:14 GMT</pubDate></item><item><title><![CDATA[Reply to Make node look for new&#x2F;better parent without restarting on Sat, 28 Jul 2018 06:39:53 GMT]]></title><description><![CDATA[<p dir="auto">I guess another way would be like this:</p>
<pre><code>if ( !transportCheckUplink() ) {
   asm volatile ("  jmp 0"); // CRASH, BURN AND RESET
 }
</code></pre>
<p dir="auto">It does the trick ... though it really bothers my developer-heart ;)</p>
]]></description><link>https://forum.mysensors.org/post/92020</link><guid isPermaLink="true">https://forum.mysensors.org/post/92020</guid><dc:creator><![CDATA[Henrik Nielsen]]></dc:creator><pubDate>Sat, 28 Jul 2018 06:39:53 GMT</pubDate></item><item><title><![CDATA[Reply to Make node look for new&#x2F;better parent without restarting on Sat, 28 Jul 2018 06:34:00 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="/user/henrik-nielsen" aria-label="Profile: henrik-nielsen">@<bdi>henrik-nielsen</bdi></a> nice work. I am not sure about the internal functions. Pinging <a class="plugin-mentions-user plugin-mentions-a" href="/user/tekka" aria-label="Profile: tekka">@<bdi>tekka</bdi></a>, maybe he can assist.</p>
]]></description><link>https://forum.mysensors.org/post/92019</link><guid isPermaLink="true">https://forum.mysensors.org/post/92019</guid><dc:creator><![CDATA[mfalkvidd]]></dc:creator><pubDate>Sat, 28 Jul 2018 06:34:00 GMT</pubDate></item><item><title><![CDATA[Reply to Make node look for new&#x2F;better parent without restarting on Fri, 27 Jul 2018 21:42:25 GMT]]></title><description><![CDATA[<p dir="auto">It sort of works, I get a ping and a missing pong:</p>
<p dir="auto">(254 is button node, 252 is repeater I turned off after the button node was started up)</p>
<pre><code>64442 TSF:PNG:SEND,TO=252
64479 !TSF:MSG:SEND,254-254-252-252,s=255,c=3,t=24,pt=1,l=1,sg=0,ft=0,st=NACK:1
66488 TSF:CKU:FAIL
</code></pre>
<p dir="auto">But no looking for a new parent.</p>
<p dir="auto">I tried calling some functions I thought sounded like they would help me, without really knowing. I guess it is not functions that a user like me really should use?:</p>
<pre><code>if ( !transportCheckUplink() ) {
  stParentTransition();
  while ( isTransportSearchingParent() ) {
    stParentUpdate();
  }
}
</code></pre>
<p dir="auto">This starts what appears to be a new parent search, but it never completes:</p>
<pre><code>151171 TSF:MSG:SEND,254-254-255-255,s=255,c=3,t=7,pt=0,l=0,sg=0,ft=0,st=OK:
153180 !TSM:FPAR:NO REPLY
153182 TSM:FPAR
153219 TSF:MSG:SEND,254-254-255-255,s=255,c=3,t=7,pt=0,l=0,sg=0,ft=0,st=OK:
155228 !TSM:FPAR:NO REPLY
155230 TSM:FPAR
155267 TSF:MSG:SEND,254-254-255-255,s=255,c=3,t=7,pt=0,l=0,sg=0,ft=0,st=OK:
157276 !TSM:FPAR:NO REPLY
157278 TSM:FPAR
157315 TSF:MSG:SEND,254-254-255-255,s=255,c=3,t=7,pt=0,l=0,sg=0,ft=0,st=OK:
159324 !TSM:FPAR:FAIL
159326 TSM:FAIL:CNT=7
159328 TSM:FAIL:DIS
159330 TSF:TDI:TSL
161333 !TSM:FPAR:NO REPLY
161335 TSM:FPAR
</code></pre>
<p dir="auto">At this point I have started my repeater again, and I think it should also find either the gateway or another node.</p>
]]></description><link>https://forum.mysensors.org/post/92013</link><guid isPermaLink="true">https://forum.mysensors.org/post/92013</guid><dc:creator><![CDATA[Henrik Nielsen]]></dc:creator><pubDate>Fri, 27 Jul 2018 21:42:25 GMT</pubDate></item><item><title><![CDATA[Reply to Make node look for new&#x2F;better parent without restarting on Fri, 27 Jul 2018 21:11:42 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="/user/henrik-nielsen" aria-label="Profile: henrik-nielsen">@<bdi>henrik-nielsen</bdi></a> welcome to the forum!<br />
I am not sure, but I think calling <a href="https://www.mysensors.org/apidocs/group__MyTransportgrp.html#ga98a43827552c9cbe40a746baf5f2c748" rel="nofollow ugc">transportCheckUplink(true)</a> before sending the message will verify connection to the gateway, and establish new parent if needed. Could you try it?</p>
]]></description><link>https://forum.mysensors.org/post/92012</link><guid isPermaLink="true">https://forum.mysensors.org/post/92012</guid><dc:creator><![CDATA[mfalkvidd]]></dc:creator><pubDate>Fri, 27 Jul 2018 21:11:42 GMT</pubDate></item></channel></rss>