What is the correct procedure to do before unplug an OpenWrt device from the power supply?

Well, I feel we are to far apart from each other to come to an agreement on this subject here and now so I give you a walkover on this oneπŸ˜ƒ

I think the real question is when is your device really not in use. For me the answer is never. It runs VPNs to two locations, provides a network logging server, my voice phone is VOIP, and even in the middle of the night I sometimes use the internet. I don't ever shut down my router, and I didn't ever unplug my old landline telephone 20 years ago. The internet is an always available service that is needed at all times even if only for emergency communications such as 911.

The savings of 20 or 40 kWh is a non savings compared to even one time in a year needing to call 911 and having to first reboot my network for 3 minutes

2 Likes

Comprehensible. Nearly everyone has a Handy or smartphone with GSM, LTE, 5G. I use it for the purpose you describe, also as a clock because I don't have one. VoIP / WLAN is disabled, I don't want "normal" calls in the middle of the night ;- )

Without knowing anything about your devices, most use JFFS2 or UBIFS (for newer NAND base routers), both file systems are designed to withstand power cuts. Of course there may be bugs that bite you, or the hardware can be badly designed.

Some devices use eMMC instead of raw flash, industrial quality eMMC "should" be safe, for cheap variants mileage vill vary. E.g. cheap USB flashdrives can completely die of a powercut at the wrong moment. On the eMMC you need a journalling filesystem, e.g. BTRFS.

Userland applications is a different story. On our units we for example have a patched opkg, as it may otherwise loose the package database or get invalid package information. It is just to common in userland to just overwrite files which of course will not work in the light of power cuts. To be compliant with posix one must instead write to a temporary file, sync it to disk and thereafter rename the temporary file to the name it should have. The rename is atomic, if a power cut occurs you have either the old or the new file content. There are probably a bunch of other programs that misbehaves and are used on OpenWrt.

The python interpreter is one that do not follow posix rules to be powercut safe. It misbehaves when storing compiled bytecode, after many bug reports it was fixed to work on ext4, but it works only because ext4 has a special hack for handling bad applications. UBIFS has not such a hack, so python may fail there.

1 Like

I often hear this from people who dont't want to change anything because "it is not meaningful", although they could do their share of something in many ways on many different subjects e.g. food, transportation, typ of energy consumend etc.

I consider this a personal attack. Do you have no real arguments? Your discussion style is strongly suggestive of Donald Trump.

"doing their share" must be quantified in numbers and actual effects. If you are doing "the good thing" but you are alone you fail and all effort you put into it is wasted no matter how good the intentions were.

An example of meaningful changes is laws that restrict use of bs technologies, stop waste of materials in packaging and so on. For example the "right to repair" laws that are in the news recently in the EU (yes I know they are not amazing but they are at least a shot in the right direction).

1 Like

My argument is that doing "feel good" measures that have no real benefit in practice (as mentioned by me and others above) is cargo culting.
Cargo culting is mimicking some action without understanding fully how things work.

Powering down an embedded device and telling yourself it matters for the environment is a lie, it simply does not and you can do the calculation yourself if you don't believe the numbers others posted above.

I'm personally sick and tired of people misunderstanding how environmental protection works and doing all sorts of weird rituals because they think they are "doing their part" to save the environment so I might have come off as angry at you but I assure I'm not, I'm just angry in general about this topic.

WRONG and if you think that you are FAKE NEWS

4 Likes

Sounds like both of you are more in agreement on general than not, if disagreeing highly on certain aspects.

To me, it seems that even 1 watt saved, is 1 watt saved. And if saving some power helps, of course that helps. To a extremely tiny and measurable amount, having no detectable effect on the world, overall. Your 1 watt isn't doing much.

OTOH, if you can get 1 million, or 100 million, or 1G people saving 1 watt, now your're making differences that will be noticeable, and influential.... If you can get 1 billion people to save a watt, that's making an impact on things.

It's easier to do stuff like this on a large scale, by passing laws for electronics devices, like ones we have in the US, and I believe in the EU as well, where when a gizmo plugged in the wall is sleeping or not running, it had to be <1.5 watts consumption, then <1 or even .5W, as the newer laws have it. But, everyone reducing a little bit on their own helps, too.

1 Like

Now, that's the argument to make to those potential x86 guys who want to get some old >200W Xeon server that they could find cheap on ebay... "But I could get it for $30-40!!" Yeah, and that's probably what it will add to your yearly electric bill....
(Edit, really underestimated that one! Closer to monthly electric bill!)

Ooooh... bending the conversation back to OpenWRT.... (see what I did there?)

Lets see if I can go farther... I've wondered, about stress on disks, since I have a some years old C7 limping along as my AP, and even my little Zotac miniPC router runs off a SD disk (yeah, I should change it to boot of other media, I'm lazy, OK?) so, I have wondered how much wear over time happens. I know that generally, OpenWRT isn't supposed to do much disk thrashing, but I wonder if other apps one might add could up that a lot. One, that would be a memory wear, lifespan issue, but two, it also relates to how likely something gets hosed up when a power failure happens.

What tools are there that one can check the filesystem for how busy it is, or for errors on the disk, or for what is doing a lot of reading/writing on disk memory?

I've used iotop for this on raspbian and debian.

Also smartctl can help figure how much wear.

I've been using f2fs on a usb stick for logging for over a year now and still no failure. So that's pretty good

The only reason to get one of those is if you need 128GB or 256GB or more RAM, because they can do that. OpenWrt would NOT need anywhere near that in any circumstance.
EDIT: No wait. OpenWrt can be used as a hypervisor (run virtual machines), so yeah it can need that in some very specific circumstances that require an advanced user doing advanced user things, but quite frankly there are better operating systems for that, like Proxmox.

Although it's not that bad if you do some research. Servers with CPU socket 2011 and later idle at around 90W (with two CPUs ), which is around twice the idle power of a normal desktop PC. They sell for around 100 euro, but won't be as expensive to run as older ones.
But then again I'm talking to run virtual machines, not as a router. I have one because I'm an IT enthusiast and I run experiments and things on it, but it's not a router and is absolutely unnecessary for most people.

Many people will be happy to answer this if you post a new thread about it instead of hijacking this thread with an unrelated question, please open a new thread and edit that part out of your post.

While this is getting far away from the initial question, it is possible to select very power saving components for x86_64. Chosen correctly, it is possible to achieve <6-10 watts with x86_64 - which would be less than the requirements of most modern higher-end wireless routers. However you can rarely find anything like that on the used markets, and ex-servers or ex-gaming systems easily reach above the mid double-digit range of idle power consumption (single-voltage design, a decent (usually notebook-) PSU and no dedicated graphics (only CPU graphics) would be the easiest first steps, as well as a less-is-more approach (SOC-like boards, without heavy southbridge and PCI bridge, etc.)).

Well chosen components can pay for themselves within short time (easily within 10-18 months) via your electricity bill (even quicker if you're living in a climate that profits from air-conditioning) and cheap second-hand components can quickly become expensive.

1 Like

Yes there are low-power and embedded x86 devices too, an obvious example are PCEngines APU2 https://pcengines.ch/apu2.htm

or any of the chinese industrial mini-pcs with multiple gigabit ethernet ports you can find on ebay or aliexpress if you search for "pfsense firewall aes-ni"

Both will wipe the floor with any modern high-end embedded routers, while using a similar amount of power.

1 Like

Yeah, on the server points, and yes you can find more efficient server hardware, but my point overall was just stay away from surplus large machines, no matter how cheap. It would be a beastly thing if it really used 200W, which almost anything wont, and yes you can find more efficient server hardware, but even if it used 100W 24/7, that's the same price in electricity, over a year, that my little Zotac CI327 miniPC costs ($220?) stocked with memory and a spare copy of Win10, at least down here in $0.25/kwh So CA.

Ah, you missed my subtle attempt to ask something (sort of) closer to the OP's topic... :wink: and knowing if I've got some very disk IO active addon or such running, would probably up the odds that a power cycle instead of reboot might cause mayhem. So then, I might want to always try a reboot or shutdown vs just grabbing the cord. Or I might want to try to move the default IO use to something less likely to have a power cycle issue, if that's possible.

1 Like

So how big does the impact need to be for you to "have a real benefit" ? 10% ? 50% ? Or do you just say "I cannot change anything, let the world stay as it is" ?

We can save > 50 Watts of standy-power consumption by switching off unused devices. So of course the question is valid: " Do I need that device running all the time or can I switch it off when it is unused ?

And these 50Watts sum up in a year to around 400 KWh. Is that still cargo culting ?

My "IT infrastructure" consists of a router, a raspi, 2 APs, a telephone system, a switch, a SAT/IP server, we do have 2 hifi systems, 2 TVs, xbox, several PCs, Monitors, ...

So the question should be allowed, which of all these should run all the time, and which do we switch on for using them.

As I said before: I would be glad, if my access points had some step down on idle mechanism that powers them down once they are not used.

So asking questions initiates change and technical progress.

2 Likes

All changes happen because a minority eventually becomes a majority. History is full of examples and we wouldn't (have) see(n) the succession of many social/cultural/economical systems if it wasn't like that... apparently, they were all doing the wrong thing for a long time, but in the end didn't fail.
Even laws, that you seem to take as ultimate goal for any possible change, are made by someone who was probably "practicing" his own "lifestlyle", way before he had enough numerical power and support among the people to "impose" a law.

Also, how is "doing the right thing and feeling good" worse than "doing the wrong thing because-everyone-does-so and feeling good". They are at least comparable approaches to me.
Or maybe you don't think it's a wrong thing, maybe just irrelevant? So what bothers you so much if someone wants to take the effort to do that? Maybe you are afraid that he would consider himself satisfied without seeing the big picture and fighting for a bigger chage? But how does that lead to the implication that if someone's conscience feels good with just this little step then he doesn't want a bigger and meaningful change as well? Are the two things mutually exclusive?
Do you personally know everyone in this thread so well to justify your opinion of them as

And you are so angry about this topic that the first thing you did was hijacking this thread into this topic?

3 Likes

It is not wasted, it saves ressources and CO2. You are always devalue what millions of individuals can archive before laws applies to come up with your bottom line: What I can do is too little, lets wait for laws and let us do nothing until than.

Hypothecical dialog:

Buy bio ecological vegetables? Nahh, too little effect and doesn't change anything and there is no law

Compost my kitchen vegetable waste? Nahh, too little effect and doesn't change anything and there is no law

Eat less meat? Nahh, too little effect and doesn't change anything and there is no law

Change my electricity provider from standard to renewable? Nahh, too little effect and doesn't change anything and there is no law

Walk by foot, bike or public transportation? Nahh, too little effect and doesn't change anything and there is no law

What can be tricky is the use of applications that create log files in permanent storage. A power cut during writing to flash can create problems.
In my case some routers are powered off by a timer at a fixed time every night, to reboot a minute later. Also there are some custom made scripts that do logging of traffic in persistent storage at certain time intervals.
As room is limited the log files are always cut to a certain max. size.
I have added to the scripts' logging part a check on the presence of a file in /tmp (a disk in RAM). If it is present no write is done.
The only purpose of the empty file is to flag the imminent power cut. It is set by a cron job some minutes before the power cut.
Working already for years without any problem.
So the answer to the question depends a bit on whether it is a basic OpenWrt install, no real problem to be expected, or that applications have been added that do writes into persistent storage that might happen on the moment you power off the devices.

Did you pay attention to what I said? Your Zotac mini PC does not support 128GB or 256GB of RAM (or more) so it's useless for most of those that buy an old server.
You are doing an apples and bananas comparison.

1 Like