# Machine times between reboots/lockups reducing

**URL:** <https://discourse.nodered.org/t/machine-times-between-reboots-lockups-reducing/46433>\
**Category:** General\
**Created:** [29 May 2021 00:49 UTC](https://discourse.nodered.org/t/machine-times-between-reboots-lockups-reducing/46433 "2021-05-29T00:49:17Z")\
**Posts on this page:** 19\
**Page:** 7

<div class="post-metadata">

**Author:** ![TotallyInformation](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/totallyinformation/32/31_2.png) [@TotallyInformation](https://discourse.nodered.org/u/TotallyInformation)\
**Post date:** [17 June 2021 08:12 UTC](https://discourse.nodered.org/t/machine-times-between-reboots-lockups-reducing/46433/121 "2021-06-17T08:12:17Z")

</div>

> [@Trying\_to\_learn](#):
>
> But then wouldn't it be _predictable_ ?

Typically not. Random corruption can happen for all sorts of reasons and is likely to only affect a few bytes out of the several GIGA-bytes on your computer. That code or data may only rarely be reached or the corruption may be to data that might still be understood - just wrong.

> [@Trying\_to\_learn](#):
>
> I use a node, it is _invoked_ at regular intervals and so would predictably fail?

Only if the corruption was IN node. You have probably 100's of thousands of files and gigabytes of code and data on even a Pi.

> [@Trying\_to\_learn](#):
>
> It is just I sometimes get _excited_ and try writing new things and may use _other_ nodes and so they get adopted.

That happens to most of us 😀 I recommend firing up a test instance of Node-RED and using that for experiments. Keep a "live" instance running with just the things you really need.

---

<div class="post-metadata">

**Author:** ![Trying\_to\_learn](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/trying_to_learn/32/28400_2.png) [@Trying\_to\_learn](https://discourse.nodered.org/u/Trying_to_learn)\
**Post date:** [17 June 2021 08:49 UTC](https://discourse.nodered.org/t/machine-times-between-reboots-lockups-reducing/46433/122 "2021-06-17T08:49:01Z")

</div>

Thanks.

Noted.

Anyway, things are a lot more quite than before, so that is good. 80% probable it is/was a power problem - so far based on things.

Though I would like to wait a couple of weeks just to be more sure.

---

<div class="post-metadata">

**Author:** ![Trying\_to\_learn](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/trying_to_learn/32/28400_2.png) [@Trying\_to\_learn](https://discourse.nodered.org/u/Trying_to_learn)\
**Post date:** [21 June 2021 09:14 UTC](https://discourse.nodered.org/t/machine-times-between-reboots-lockups-reducing/46433/123 "2021-06-21T09:14:22Z")

</div>

Ok, 21 June. Not exactly sure when - oh hang on..... about 13:00 today:

Only for the sake of **other** things happening, I put the _last_ of the three machines on an official power supply.

Let's see what happens.

But other things are happening. See other thread.

---

<div class="post-metadata">

**Author:** ![Trying\_to\_learn](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/trying_to_learn/32/28400_2.png) [@Trying\_to\_learn](https://discourse.nodered.org/u/Trying_to_learn)\
**Post date:** [24 June 2021 21:19 UTC](https://discourse.nodered.org/t/machine-times-between-reboots-lockups-reducing/46433/124 "2021-06-24T21:19:03Z")

</div>

I spoke too soon.

## Update:

Today - 25 Jun 2021 06:50

When I got up I saw that one of my wifi devices had been turned on.

So it kind of throws a brick through the window for the idea of "all is now fixed".

Observation:

It has been 3 weeks 5 days since I put a (the) machine onto an official power supply.  
Which is pretty good all things considered.

The machine is question is a RasPi 2 b Rev 1.1  
It also runs PiHole. Why do I mention this now? Hang on and I will explain/elaborate now.

Though slightly off topic I had _fallen_ for this when I was setting up PiHole originally. (Way back)

The modem/router did the `DHCP` stuff originally.  
This was good/bad for a whole set of reasons. Outside the scope.  
But it became evident that the `PiHole` machine should do this and so it was set as the `DHCP` server.

About a week ago - for reasons now unknown - I put the router back as `DHCP` and took `PiHole` off.  
Then I remembered why `PiHole` _needs to be_ the server and promptly put it back.

Interestingly this caused the wifi device mentioned above to be turned on.  
I'm not sure which _side_ (part?) of it did it. The making the router or making `PiHole` the `DHCP` server.

Although this isn't a reboot, it is one of the problems noticed originally with machines either locking up or going crazy and needing to be power cycled.

---

<div class="post-metadata">

**Author:** ![craigcurtin](https://avatars.discourse-cdn.com/v4/letter/c/94ad74/32.png) [@craigcurtin](https://discourse.nodered.org/u/craigcurtin)\
**Post date:** [25 June 2021 07:00 UTC](https://discourse.nodered.org/t/machine-times-between-reboots-lockups-reducing/46433/125 "2021-06-25T07:00:15Z")

</div>

You need to stay on track - you are veering off again (as you usually end up doing)

What does changing your DHCP server (PiHole/Router) have to do with CAUSING a device to turn on ?

Unless one of them is running as a PXE/WOL server and has a task set to wake this particular device - even so - this would make no difference if it was the DHCP server or not - as PXE/WOL is performed on MAC address not IP address.

I think you need to go back and read that post again and see how confusing it could be for someone outside your network ? Particularly introducing it at the end of a thread about troubleshooting PI reboot issues.

Are the PI reboot issues fixed now by moving to the proper power supplies ?

If so what is this mysterious WIFI device that has been powered on - would probably need its own thread rather than confusing this one further

Craig

---

<div class="post-metadata">

**Author:** ![Trying\_to\_learn](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/trying_to_learn/32/28400_2.png) [@Trying\_to\_learn](https://discourse.nodered.org/u/Trying_to_learn)\
**Post date:** [25 June 2021 07:09 UTC](https://discourse.nodered.org/t/machine-times-between-reboots-lockups-reducing/46433/126 "2021-06-25T07:09:34Z")

</div>

I think that by changing the DNS it caused the WIFI devices to rebroadcast their LWT and so the LWT told the device to turn on.

I'm saying this because when the RasPi was the DNS if there were power problems, it would re-negotiate all WIFI devices and they would (probably) re-send their LWT.

So:  
This was happening quite often originally. On non-standard power supply.

Putting it on the official one, things really settled down. No lock ups, no mysterious WIFI devices turning on.

So now for 3 weeks, 6 days 5 hours (at time of posting) things have been stable.

This recent thing with moving DNS from the Pi to the router and back only simulated what would/could happen if the DNS was the Pi and there was a power supply.

Would this concur?

---

<div class="post-metadata">

**Author:** ![craigcurtin](https://avatars.discourse-cdn.com/v4/letter/c/94ad74/32.png) [@craigcurtin](https://discourse.nodered.org/u/craigcurtin)\
**Post date:** [29 June 2021 01:06 UTC](https://discourse.nodered.org/t/machine-times-between-reboots-lockups-reducing/46433/127 "2021-06-29T01:06:59Z")

</div>

How does a LWT force a device to start ?? Do you have a flow somewhere that does this ?

You do realise LWT is only to do with MQTT - so unless the devices are all running MQTT then they will not be sending out LWT i.e.a normal PI without Mosquitto and/or NR would not have anything to do with MQTT/LWT ?

Craig

---

<div class="post-metadata">

**Author:** ![Trying\_to\_learn](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/trying_to_learn/32/28400_2.png) [@Trying\_to\_learn](https://discourse.nodered.org/u/Trying_to_learn)\
**Post date:** [29 June 2021 01:41 UTC](https://discourse.nodered.org/t/machine-times-between-reboots-lockups-reducing/46433/128 "2021-06-29T01:41:03Z")

</div>

Well, the _device_ is a TASMOTA thing. I am still new to that.

But from what I understand if it receives a LWT it sets itself to that.

It is WiFI and connecting to the MQTT broker.

If the DHCP _resets_ and its IP address is re-negotiated.... The LWT is sent. Or something like that.

It is controlled by MQTT. (Ok, I just said that 2 lines back)  
LWT and MQTT are associated. MQTT has a LWT and birth certificates when dis/connecting.

So (from a long time ago):  
All things would be **good**. I would go away.

I would come back and the WiFi device (controlled by MQTT) would be not as left.

I would reset it to what it should be and just continue. (Silly me, but I am dumb. That's a given)

The other day when I was playing with _who_ was the DHCP server, I took it from the RasPi and made it the router.

Then I remembered **WHY** it was on the Pi: it is also running PiHole.  
If the router is doing DHCP, it is a bit difficult to know which device connected via DHCP is doing what.

So I put it back to the Pi.  
Shortly there after I noticed the device afore mentioned had been set to how I was finding it after being away.

Though not conclusive: If the DHCP was somehow _reset_ while I was away, it would explain why said device was not as I left it.

So this kind of re-enforces the power supply suspicion to causing problems.

Clearer?  
It is difficult for me to remember what I have said; what I haven't and what is and not needed to be told.

Yes, I need work. Who doesn't?

---

<div class="post-metadata">

**Author:** ![Colin](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/colin/32/17040_2.png) [@Colin](https://discourse.nodered.org/u/Colin)\
**Post date:** [29 June 2021 06:22 UTC](https://discourse.nodered.org/t/machine-times-between-reboots-lockups-reducing/46433/129 "2021-06-29T06:22:12Z")

</div>

> [@Trying\_to\_learn](#):
>
> from what I understand if it receives a LWT it sets itself to that.

What does that mean?

---

<div class="post-metadata">

**Author:** ![Trying\_to\_learn](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/trying_to_learn/32/28400_2.png) [@Trying\_to\_learn](https://discourse.nodered.org/u/Trying_to_learn)\
**Post date:** [29 June 2021 06:38 UTC](https://discourse.nodered.org/t/machine-times-between-reboots-lockups-reducing/46433/130 "2021-06-29T06:38:21Z")

</div>

You missed the "from what I understand" part.

From what I understand (deja vous) and have seen: when a WiFi device connects, it sends a LWT.

In Tasmota that contains what the device is supposed to be set at.  
Yes, I can change the config of the device, but that is then reflected in the LWT.

So if the LWT is sent - because the DHCP server reset - the device is set to the _default_ condition. Which is **NOT** how I left it.

However: You seem intent on disproving this.  
I am reporting what I saw happen and what I did just before that.

So if it wasn't a faulty (for want of a better definition) power supply making the RasPi's DHCP reset / glitch every now and then, and **AFTER** I put it on a REAL supply and it was behaving itself more than it was........

I'm open to what else is wrong.  
I want this/these problems to stop. Kinda difficult to move forward if everything I post is said to be wrong.

---

<div class="post-metadata">

**Author:** ![Colin](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/colin/32/17040_2.png) [@Colin](https://discourse.nodered.org/u/Colin)\
**Post date:** [29 June 2021 14:15 UTC](https://discourse.nodered.org/t/machine-times-between-reboots-lockups-reducing/46433/131 "2021-06-29T14:15:06Z")

</div>

> [@Trying\_to\_learn](#):
>
> You missed the "from what I understand" part.

No I didn't. Virtually anything we write will be from what we each understand, what else could it be?

> [@Trying\_to\_learn](#):
>
> when a WiFi device connects, it sends a LWT.

What sends an LWT to what?

> [@Trying\_to\_learn](#):
>
> In Tasmota that contains what the device is supposed to be set at.

What aspect of the device settings do you mean?

---

<div class="post-metadata">

**Author:** ![PeteKnight](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/peteknight/32/18345_2.png) [@PeteKnight](https://discourse.nodered.org/u/PeteKnight)\
**Post date:** [29 June 2021 17:08 UTC](https://discourse.nodered.org/t/machine-times-between-reboots-lockups-reducing/46433/132 "2021-06-29T17:08:06Z")

</div>

When your (Tasmota) device connects to the MQTT broker it can use LWT to tell the broker “Please post this message, to this topic, if you happen to notice that I’ve dropped off the radar”

It’s a bit like telling your solicitor “Please post this envelope to the New York times if you’ve not heard from me in 48 hours” 😀

I use an LWT topic called ‘status’ and tell Mosquitto to post ‘dead’ to that topic if the device goes offline.  
Once this LWT instruction has been given to Mosquitto then the device posts an ‘alive’ message to the ‘status’ topic.

It takes around 20 seconds for Mosquitto to recognise that the device has gone AWOL (you can change this in the Mosquitto configuration) and at that point it posts the ‘dead’ message to the ‘status’ topic.

Looking at the ‘status’ topic for that device tells me whether it’s alive or dead (or at least that it was alive 20 seconds ago).

So, it’s not a case of the device sending the LWT **after** it disconnects (which would be impossible), it’s the device saying in advance to the broker “In the event that you can’t reach me, please do this…”

Pete.

---

<div class="post-metadata">

**Author:** ![craigcurtin](https://avatars.discourse-cdn.com/v4/letter/c/94ad74/32.png) [@craigcurtin](https://discourse.nodered.org/u/craigcurtin)\
**Post date:** [29 June 2021 23:48 UTC](https://discourse.nodered.org/t/machine-times-between-reboots-lockups-reducing/46433/133 "2021-06-29T23:48:58Z")

</div>

So in a nutshell Andrew we are trying to say we can not see how LWT can have any effect on the problem you have had.

When you flip flopped between DHCP servers - dependant on config of each of them - they may well have given different IP addresses to each of your devices, and then dependant on the config of your mosquitto broker they may have seen this as devices disappearing but unless you have a flow somewhere that is looking at the LWT from the broker and then performing specific actions based upon its state i think this may be a red herring.

Craig

---

<div class="post-metadata">

**Author:** ![Trying\_to\_learn](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/trying_to_learn/32/28400_2.png) [@Trying\_to\_learn](https://discourse.nodered.org/u/Trying_to_learn)\
**Post date:** [30 June 2021 00:07 UTC](https://discourse.nodered.org/t/machine-times-between-reboots-lockups-reducing/46433/134 "2021-06-30T00:07:51Z")

</div>

OK, maybe not the LWT, but the BIRTH CERTIFICATE.

I can say with confidence that when I power on a BULB (which isn't the device in question) I get messages which maybe a LWT and/or BIRTH CERTIFICATE.

Who published what: Dunno.

But - and this is based on past (18 or so months) things happening.

I would set the power board (Tasmota) to ALL OFF. One of the outlets is/was/is used to do things.

I would come back after 2 weeks and it was not as it was left.  
This would also happen quite frequently for the 2 weeks I was at home.  
The board would suddenly change to this wrong state/condition.

That is/was a problem on its own.

ITMT, the machines are/were locking up.

Power supply. That became the only thing not changed.

So, a couple of weeks back I powered down the RasPi.  
It is running NR, and PiHole. PiHole was the DHCP server.

I then connected it to a name brand RasPi PSU. It was working and the power board was behaving itself.

Granted it is is only 4 weeks, but that is 2 cycles of what I did for the past 18 months.

## NO PROBLEMS!

The other day for reasons outside the scope, I set the ~~modem~~ router as the DHCP server rather than PiHole.

Then I realised why PiHole needs to be the DHCP server. I put it back.

Though I can't say if it was both, but later as I walked past the power board, it had ~~become~~ taken the state I found it in after my trips away.

Given: It had been 3 weeks and it was behaving itself and only when I changed the DHCP server did it _fail_, makes me suspicious that when it re-negotiates its IP address that this problem happens....

## SO?

If a bad power supply was doing that intermittently that would explain a lot.

Now it is the name brand PSU and it has been behaving itself for 3 weeks....

That is re-enforcing that is **WAS** the PSU causing the problems.

---

<div class="post-metadata">

**Author:** ![Trying\_to\_learn](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/trying_to_learn/32/28400_2.png) [@Trying\_to\_learn](https://discourse.nodered.org/u/Trying_to_learn)\
**Post date:** [30 June 2021 00:12 UTC](https://discourse.nodered.org/t/machine-times-between-reboots-lockups-reducing/46433/135 "2021-06-30T00:12:47Z")

</div>

Thanks Peter.

I am still very much at the shallow end of the pool when it comes to Tasmota.

I was badly explaining my poor understanding of how things work.

But I do believe that when it negotiates an IP address the message/s are setup/sent and the device takes on the "default" status.

Though I can change that, it is more that it was fairly constantly change from what I told it to be to a _wrong_ state.

So I am suspicious that it was re-negotiating the IP address and so _resetting_ to the default state.

---

<div class="post-metadata">

**Author:** ![craigcurtin](https://avatars.discourse-cdn.com/v4/letter/c/94ad74/32.png) [@craigcurtin](https://discourse.nodered.org/u/craigcurtin)\
**Post date:** [30 June 2021 01:20 UTC](https://discourse.nodered.org/t/machine-times-between-reboots-lockups-reducing/46433/136 "2021-06-30T01:20:46Z")

</div>

OK check out the Tasmota console commands - you can setup a remote logging server in there.

Then force change the IP address of the power board - on your PiHole - reserve/remove the addess the power board has from the IP list and then reboot the power board.

See what messages it sends out to the logging server when it gets a new IP address - this might give you some ideas.

Having said all of that - i have a number of cheap power monitor (Kogan) plugs that have been flashed with tasmota - one of them has gone through 12,000 reboot cycles for no good reason - you may well find that your Tasmota is setup to restart the device if it loses IP connectivity

Craig

---

<div class="post-metadata">

**Author:** ![Trying\_to\_learn](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/trying_to_learn/32/28400_2.png) [@Trying\_to\_learn](https://discourse.nodered.org/u/Trying_to_learn)\
**Post date:** [30 June 2021 06:23 UTC](https://discourse.nodered.org/t/machine-times-between-reboots-lockups-reducing/46433/137 "2021-06-30T06:23:02Z")

</div>

Thanks.

I'm not quite sure how that is going to work, but I'll try.

If it isn't connected to my WiFi - for what ever reason - how can it send data to the `rsyslog`?

I shall see if I can get my head around what you say. A lot of that is way beyond what I use/understand.

But I'll try.

---

<div class="post-metadata">

**Author:** ![Trying\_to\_learn](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/trying_to_learn/32/28400_2.png) [@Trying\_to\_learn](https://discourse.nodered.org/u/Trying_to_learn)\
**Post date:** [30 June 2021 07:19 UTC](https://discourse.nodered.org/t/machine-times-between-reboots-lockups-reducing/46433/138 "2021-06-30T07:19:12Z")

</div>

[This link goes a long way to explaining the problem.](https://tasmota.github.io/docs/FAQ/#my-device-randomly-switches-on-and-off-do-i-have-ghosts-in-my-house)

I think I shall follow this thread first.

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/1X/d073cd938eafa2e558d7c2cd59003b3ef4963033.png) [@system](https://discourse.nodered.org/u/system)\
**Post date:** [29 August 2021 07:19 UTC](https://discourse.nodered.org/t/machine-times-between-reboots-lockups-reducing/46433/139 "2021-08-29T07:19:14Z")

</div>

Closed on 29 August 2021 07:19 UTC

This topic was automatically closed 60 days after the last reply. New replies are no longer allowed.

[Previous page](https://discourse.nodered.org/t/machine-times-between-reboots-lockups-reducing/46433.md?page=6)
