<?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[Can&#x27;t change Node ID]]></title><description><![CDATA[<p dir="auto">HI Everyone,</p>
<p dir="auto">This is the fridge sensor that Bulldog and Pete B put together, I had it working but since the vera update any new mysensors loading always load with the same node id even when i try to change it manually as in the sketch below, any idea what I am doing wrong?  The node loads only as 254 node......</p>
<p dir="auto">Please help.</p>
<p dir="auto">#include &lt;DallasTemperature.h&gt;<br />
#include &lt;OneWire.h&gt;<br />
#include &lt;Bounce2.h&gt;</p>
<p dir="auto">//MySensors configuration options<br />
#define MY_DEBUG //Uncomment to enable MySensors related debug messages (additional debug options  are below)<br />
#define MY_RADIO_NRF24 // Enable and select radio type attached<br />
#define MY__ID 9  //Manually set the  ID here. Comment out to auto assign<br />
#include &lt;MySensors.h&gt;</p>
<p dir="auto">#define SKETCH_NAME "White Refrigerator Monitor"<br />
#define SKETCH_VERSION "1.1b"</p>
<p dir="auto">#define DWELL_TIME 20 //value used in all wait calls (in milliseconds) this allows for radio to come back to power after a transmission, ideally 0</p>
<p dir="auto">#define ONE_WIRE_BUS 3 // Pin where dallas sensors are connected<br />
#define TEMPERATURE_PRECISION 12  //The resolution of the sensor</p>
<p dir="auto">OneWire oneWire(ONE_WIRE_BUS); // Setup a oneWire instance to communicate with any OneWire devices (not just Maxim/Dallas temperature ICs)<br />
DallasTemperature dallasTemp(&amp;oneWire); // Pass our oneWire reference to Dallas Temperature.</p>
<p dir="auto">//MySensor gw;<br />
unsigned long tempDelay = 225000;<br />
float lastTemperature[2];<br />
unsigned long tempMillis;<br />
bool metric = false;</p>
<p dir="auto">// arrays to hold device addresses<br />
DeviceAddress dallasAddresses[] = {<br />
{0x28, 0xFF, 0x4F, 0x87, 0x70, 0x17, 0x4, 0x9D}, //Freezer Address -- 1 Modify for your sensors<br />
{0x28, 0xFF, 0x25, 0x59, 0x70, 0x17, 0x4, 0x25} //Fridge Address -- 2 Modify for your sensors<br />
};</p>
<p dir="auto">//Set up debouncer (used for door sensors)<br />
Bounce debouncer[] = {<br />
Bounce(),<br />
Bounce()<br />
};</p>
<p dir="auto">//Make sure to match the order of doorPins to doorChildren.<br />
//The pins on your Arduino<br />
int doorPins[] = {4, 5};<br />
//The child ID that will be sent to your controller<br />
int doorChildren[] = {32, 33};<br />
//Freezer temp will be Child 0 and Fridge temp will be Child 1</p>
<p dir="auto">//used to keep track of previous values contact sensor values<br />
uint8_t oldValueContact[] = {1, 1};</p>
<p dir="auto">uint8_t doorLedPins[] = {6, 7};</p>
<p dir="auto">// Initialize temperature message<br />
MyMessage dallasMsg(0, V_TEMP);<br />
MyMessage doorMsg(0, V_TRIPPED);</p>
<p dir="auto">void presentation()<br />
{<br />
// Send the sketch version information to the gateway<br />
sendSketchInfo(SKETCH_NAME, SKETCH_VERSION);</p>
<p dir="auto">// Register all sensors to gw (they will be created as child devices)<br />
// Present temp sensors to controller<br />
for (uint8_t i = 0; i &lt; 2; i++) {<br />
present(i, S_TEMP);<br />
wait(DWELL_TIME);<br />
}<br />
// Present door sensors to controller<br />
for (uint8_t i = 0; i &lt; 2; i++) {<br />
present(doorChildren[i], S_DOOR);<br />
wait(DWELL_TIME);<br />
}<br />
}</p>
<p dir="auto">void setup()<br />
{<br />
// Startup OneWire<br />
dallasTemp.begin();</p>
<p dir="auto">// set the temp resolution<br />
for (uint8_t i = 0; i &lt; 2; i++) {<br />
dallasTemp.setResolution(dallasAddresses[i], TEMPERATURE_PRECISION);<br />
}</p>
<p dir="auto">//  // Startup and initialize MySensors library. Set callback for incoming messages.<br />
//  gw.begin(NULL, NODE_ID);<br />
//<br />
//  // Send the sketch version information to the gateway and Controller<br />
//  gw.sendSketchInfo(SKETCH_NAME, SKETCH_VERSION);</p>
<p dir="auto">//Set up door contacts &amp; LEDs<br />
for (uint8_t i = 0; i &lt; 2; i++) {</p>
<pre><code>// Setup the pins &amp; activate internal pull-up
pinMode(doorPins[i], INPUT_PULLUP);

// Activate internal pull-up
//digitalWrite(doorPins[i], HIGH);

// After setting up the button, setup debouncer
debouncer[i].attach(doorPins[i]);
debouncer[i].interval(700); //This is set fairly high because when my door was shut hard it caused the other door to bounce slightly and trigger open.

//Set up LEDs
pinMode(doorLedPins[i], OUTPUT);
digitalWrite(doorLedPins[i], LOW);
</code></pre>
<p dir="auto">}</p>
<p dir="auto">}</p>
<p dir="auto">void loop()<br />
{<br />
unsigned long currentMillis = millis();</p>
<p dir="auto">if (currentMillis - tempMillis &gt; tempDelay) {<br />
// Fetch temperatures from Dallas sensors<br />
dallasTemp.requestTemperatures();</p>
<pre><code>// Read temperatures and send them to controller
for (uint8_t i = 0; i &lt; 2; i++) {

  // Fetch and round temperature to one decimal
  float temperature = static_cast&lt;float&gt;(static_cast&lt;int&gt;((metric ? dallasTemp.getTempC(dallasAddresses[i]) : dallasTemp.getTempF(dallasAddresses[i])) * 10.)) / 10.;
  // Only send data if temperature has changed and no error
  if (lastTemperature[i] != temperature &amp;&amp; temperature != -127.00) {

    // Send in the new temperature
    send(dallasMsg.setSensor(i).set(temperature, 1));
    lastTemperature[i] = temperature;
  }
}
tempMillis = currentMillis;
</code></pre>
<p dir="auto">}</p>
<p dir="auto">for (uint8_t i = 0; i &lt; 2; i++) {<br />
debouncer[i].update();<br />
// Get the update value<br />
uint8_t value = debouncer[i].read();<br />
if (value != oldValueContact[i]) {<br />
// Send in the new value<br />
send(doorMsg.setSensor(doorChildren[i]).set(value == HIGH ? "1" : "0"));<br />
digitalWrite(doorLedPins[i], value);<br />
oldValueContact[i] = value;<br />
}<br />
}</p>
<p dir="auto">}</p>
]]></description><link>https://forum.mysensors.org/topic/7888/can-t-change-node-id</link><generator>RSS for Node</generator><lastBuildDate>Wed, 12 Aug 2026 23:55:43 GMT</lastBuildDate><atom:link href="https://forum.mysensors.org/topic/7888.rss" rel="self" type="application/rss+xml"/><pubDate>Sun, 29 Oct 2017 19:45:55 GMT</pubDate><ttl>60</ttl><item><title><![CDATA[Reply to Can&#x27;t change Node ID on Mon, 30 Oct 2017 09:24:01 GMT]]></title><description><![CDATA[<p dir="auto">Thanks, that worked.</p>
]]></description><link>https://forum.mysensors.org/post/78493</link><guid isPermaLink="true">https://forum.mysensors.org/post/78493</guid><dc:creator><![CDATA[Newzwaver]]></dc:creator><pubDate>Mon, 30 Oct 2017 09:24:01 GMT</pubDate></item><item><title><![CDATA[Reply to Can&#x27;t change Node ID on Mon, 30 Oct 2017 01:39:33 GMT]]></title><description><![CDATA[<p dir="auto">try</p>
<pre><code>#define MY_NODE_ID 9

</code></pre>
<p dir="auto">You can also use the ClearEepromConfig sketch from the MySensors examples to reset your arduino saved settings.</p>
]]></description><link>https://forum.mysensors.org/post/78464</link><guid isPermaLink="true">https://forum.mysensors.org/post/78464</guid><dc:creator><![CDATA[Boots33]]></dc:creator><pubDate>Mon, 30 Oct 2017 01:39:33 GMT</pubDate></item><item><title><![CDATA[Reply to Can&#x27;t change Node ID on Sun, 29 Oct 2017 20:50:19 GMT]]></title><description><![CDATA[<p dir="auto">I meant the define is wrong</p>
]]></description><link>https://forum.mysensors.org/post/78445</link><guid isPermaLink="true">https://forum.mysensors.org/post/78445</guid><dc:creator><![CDATA[gohan]]></dc:creator><pubDate>Sun, 29 Oct 2017 20:50:19 GMT</pubDate></item><item><title><![CDATA[Reply to Can&#x27;t change Node ID on Sun, 29 Oct 2017 20:45:08 GMT]]></title><description><![CDATA[<p dir="auto">Hi<br />
Thanks and I have changed the ID as follows;<br />
#define MY__ID 9  //Manually set the  ID here. Comment out to auto assign<br />
//#define MY__ID 9  //Manually set the  ID here. Comment out to auto assign</p>
<p dir="auto">No matter what i do I still get node 254,.  Still most be something I am missing, any ideas?</p>
]]></description><link>https://forum.mysensors.org/post/78443</link><guid isPermaLink="true">https://forum.mysensors.org/post/78443</guid><dc:creator><![CDATA[Newzwaver]]></dc:creator><pubDate>Sun, 29 Oct 2017 20:45:08 GMT</pubDate></item><item><title><![CDATA[Reply to Can&#x27;t change Node ID on Sun, 29 Oct 2017 20:10:21 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="/user/newzwaver" aria-label="Profile: Newzwaver">@<bdi>Newzwaver</bdi></a> said in <a href="/post/78438">Can't change Node ID</a>:</p>
<blockquote>
<p dir="auto">#define MY__ID 9  /</p>
</blockquote>
<p dir="auto">I'd look here for your problem</p>
]]></description><link>https://forum.mysensors.org/post/78442</link><guid isPermaLink="true">https://forum.mysensors.org/post/78442</guid><dc:creator><![CDATA[gohan]]></dc:creator><pubDate>Sun, 29 Oct 2017 20:10:21 GMT</pubDate></item></channel></rss>