#273

  Рет қаралды 90,767

Andreas Spiess

Andreas Spiess

Күн бұрын

Пікірлер: 354
@dd0356
@dd0356 5 жыл бұрын
in my case, swap on the sdcard made the situation worse, by constant rewrite cheap sdcard "wearoff". better to make the sdcard readonly, use usb ssd (older ones which are on sale with smaller capacity) for the data write and swap. by the way, GPIO start method was particularly interesting. so maybe we could connect an esp8266 (with sonoff clone firmware) and use MQTT/Thingspeak or some other clound enabled method! and the cheapest use case is when the 5V lipo ups is atleast 40% charged, turn the pi on and and when it is below 15% charged, turn it off!
@twmbarlwmstar
@twmbarlwmstar 5 жыл бұрын
I have SATA SSD. I could have NVMe SSD but that would be wasteful as the Pi woudn't benefit because ultimately whatever you do you meet USB 2 as far as I can see/ work out/ understand- and that appears for everything- everything to one USB 2. There are benefits to a SATA SSD, it completely sturates USB2 obviously, you'd really want USB3 which I have in a partial sense but I haven't created anny cache and for many files whatever cache I did create would not be enough. No the benefit is resilence compared to cards or sticks. Big storage at very cheap prices (120Gb is under£20, 250 is £30, 500 is £50) and it can be my boot drive. I haven't done it, or even know if it can be done but if the sMC could be used as a sort of scratch card that might be cool- what ever I think it should be able to be used as a card reader, which would be handy for copying ile from the Pi to give to someone else.
@dd0356
@dd0356 5 жыл бұрын
@@twmbarlwmstar I think it is old news, for example watch prof Christopher's video from 2 years ago: kzbin.info/www/bejne/q5PRqKmue5h-osU I was talking about old ssd sold on ebay or possibly if you decide to upgrade your laptop ssd from 128GB to 1Tb as they are now more affordable than they were 2 years ago. for ssd vs sd card, have a look at linus tech tips video, kzbin.info/www/bejne/aZfVn3WlptZ8lbM ssd have a computer inside, sd cards are somewhat dumber. hence the difference in price. there are so many discussions on ssd vs sd card. For example, have a look at the review of the newly launched cheaper (but slower) qvo ssd from Samsung by anandtech: www.anandtech.com/show/13633/the-samsung-860-qvo-ssd-review and one of the popular nvme 970 evo vs 970 evo "plus" www.anandtech.com/show/13761/the-samsung-970-evo-plus-ssd-review
@nashaut7635
@nashaut7635 5 жыл бұрын
There are excellent tutorials on how to make the Raspberry Pi boot off a read-only card (e.g. hallard.me/raspberry-pi-read-only/ ). I tried that method in a heavily polluted industrial environment (e.g. tig welders, heavy motors aso) and I never had an SD card corruption, even though I had written a script to store data on a periodical basis. The trick is to enable write access only when actually writing to the card, to minimize corruption risks. Also, a GPIO can be used with an LED to indicate when the Pi writes to the SD card - although this is already done through the small, green board LED. All that matters is to have the *operating system* read-only, which Linux can do without an issue.
@ChrisMuncy
@ChrisMuncy 5 жыл бұрын
Going to build some shutdown/startup buttons today. Thanks for sharing Andreas.
@AndreasSpiess
@AndreasSpiess 5 жыл бұрын
You are welcome!
@limtbk
@limtbk 5 жыл бұрын
My 4 raspbery's work 2+ years as security cameras, and they have no problem you described - because they have read only filesystem. All files that need to be temporary stored was written to usb-stick drive (with fat32 to reduce rewrite cycles), and they synchronized with cloud storage. So I recommend to try RO filesystem.
@bwack
@bwack 5 жыл бұрын
This is what most wifi router vendors do too. Read only Squashfs and a small writeable storage area for settings.
@AndreasSpiess
@AndreasSpiess 5 жыл бұрын
Interesting idea. but is the problem not only shifted to the USB stick?
@limtbk
@limtbk 5 жыл бұрын
@@AndreasSpiess only for temporary data. USB storage is not used for booting, so I can handle that errors.
@MartinBgelund
@MartinBgelund 5 жыл бұрын
I typically use I2C in my Raspberry Pi projects, so GPIO3 is far from ideal for this purpose for me, since it's the RPi 's I2C Clock pin.
@AndreasSpiess
@AndreasSpiess 5 жыл бұрын
Good to know. I did not know that and I do not know why they used this pin then. At least for safe shutdown, I showed a second possibility. And maybe with an open collector transistor in parallel, you could even restart it without harming i2c
@CesarDanielLopez
@CesarDanielLopez 5 жыл бұрын
me too
@svenscheil902
@svenscheil902 6 ай бұрын
​@@AndreasSpiess Could you please show a small schematic for the pin 3 workaround with a transitor?
@BruceJSkelly
@BruceJSkelly 5 жыл бұрын
Thanks for the hints. The swap space probably explains why I had so many problems with my original Raspberry Pi B with 256MB of memory. The first time I did an apt-get upgrade on wheezy, it kept locking up. I just kept rebooting it until I got through all the upgrades.
@AndreasSpiess
@AndreasSpiess 5 жыл бұрын
Well possible...
@nicklaspersson4687
@nicklaspersson4687 5 жыл бұрын
Thanks for another great video and great tips. I would like to add a recommendation to type "man top" to get the 'man'ual for the 'top' command it is quite extensive. I now have a Rasp3B+ and a Wemos with some 18DS20's and a DHT22(humid +temp sensor). The video #255 was a great inspiration. The DHT22 has caused me some pain as it kept stopped working after 5-15 hours. The reason is probably because i used cheap unshielded wire of 5 meters(not recommended). But I resolved these annoying stopps by connecting the DHT22's 5v supply to a high GPIO on the Wemos and added code to go shortly go false (delay(100) ) on the GPIO if I receive a 'not a number' (if isnan(value)) this resets the DHT22 and it starts working again. The DHT22 is low cost and therefore quite very popular I have my doubts about it surviving Swedish winter it remains to be seen.
@AndreasSpiess
@AndreasSpiess 5 жыл бұрын
Thanks for the tip with "man". Resetting was already a good trick in the old Windows times ;-)
@CyclingSteve
@CyclingSteve 5 жыл бұрын
Finally a proper headless Pi tutorial!
@AndreasSpiess
@AndreasSpiess 5 жыл бұрын
:-)
@unusualpost6953
@unusualpost6953 4 жыл бұрын
I can't seem to find any of these tutorials that will work on a Pi 4. I fear I'm making things worse by following all of these various tutorials for a stupid shutdown switch and nothing works.
@tv175s3
@tv175s3 Жыл бұрын
That works fine on my PI 3B+. I saw other solutions with large script to be executed, but that is so simple and functional.
@AndreasSpiess
@AndreasSpiess Жыл бұрын
Thank you for sharing your experience!
@gerritkuilder2309
@gerritkuilder2309 3 жыл бұрын
Thank you for the best and simplest solution for a shutdown button
@AndreasSpiess
@AndreasSpiess 3 жыл бұрын
You're welcome!
@sharedinventions
@sharedinventions 5 жыл бұрын
Please note, that with the GPIO start/stop method, after recovering from a power-loss the pi will start up regardless it was ON or OFF before the power loss. (At least in my experience.)
@AndreasSpiess
@AndreasSpiess 5 жыл бұрын
You are right.
@Iceteavanill
@Iceteavanill 5 жыл бұрын
The headless setup is really useful already. Just tried it and it worked very nice. THX for sharing!
@AndreasSpiess
@AndreasSpiess 5 жыл бұрын
You are welcome!
@felixh.7501
@felixh.7501 5 жыл бұрын
Very good video. Do you think about a video on enabling grafana and influxdb on pizero? Everyone says it doesn't work long term, and hassio blocks it.
@AndreasSpiess
@AndreasSpiess 5 жыл бұрын
Watch my earlier videos. There, both run on a pi zero. But it is not an ideal solution. If you can afford, go for a bigger one.
@lubeda04
@lubeda04 5 жыл бұрын
I am using PIs for a long time, didnt know that shutdown is so easy. I will solder one button like shown! Thanx
@AndreasSpiess
@AndreasSpiess 5 жыл бұрын
You are welcome!
@ATLaboratory
@ATLaboratory 5 жыл бұрын
Great!!! I'm just playing with a Raspberryand a similar situation, so you saved my system from broken!! ;)
@AndreasSpiess
@AndreasSpiess 5 жыл бұрын
:-)
@AndrewBorrill1
@AndrewBorrill1 5 жыл бұрын
Hi Andreas, check out the Linear Technology LTC2954. This is a push button controller with uP interrupt. It can be used to start/shutdown an RPI as well as enable/disable the power supply to the RPi. Very useful for a headless RPi and ideally suited to an automotive application.
@AndreasSpiess
@AndreasSpiess 5 жыл бұрын
I looked at it and I am not sure. You do not need debouncing of the GPIO3 pin, and the power has to be cut off by the RPI after safe shutdown, not by an external IC, I think.
@AndrewBorrill1
@AndrewBorrill1 5 жыл бұрын
@@AndreasSpiess The bush button control is debounced, so no false triggering. The LTC2954 has an enable pin that is used for controlling the RPI's psu either on/off. Starting the RPi up, the press of the pushbutton re-enables the RPI's psu and this starts up the RPi. On shutdown, arrange for the KILL pin to be set low and the LTC2954 will disable the RPI's psu. Setting this pin has to be done as late as possible. I managed to do this by creating a delay from when the RPi o/s signals a terminate and then set the KILL pin low after about 10 seconds. This could be adjusted to a longer/shorter delay if required. The crucial component is having a PSU that has an enable/disable facility, I used an LM2596, which has enable/disable and provides 5v at up to 3 amps. I think the LTC2954 is a very usable device as it has a very efficient 6uA supply current so is ideal for battery use. The ability to switch off the RPI's psu is great as both the RPI and its psu are both effectively switched off. I believe the LM2596 will only consume around 80uA when in standby.
@LAGUY88
@LAGUY88 5 жыл бұрын
WiFi issue with Raspberry PI 3B+ can see the AP.LibreELEC with Kodi 18.1 and Xenon Already subscribed
@shuyangan3892
@shuyangan3892 5 жыл бұрын
was in Switzerland last month for first time, and wow, this is the land that Swiss accent guy living and making experiment !
@AndreasSpiess
@AndreasSpiess 5 жыл бұрын
I hope you liked it...
@shuyangan3892
@shuyangan3892 5 жыл бұрын
@@AndreasSpiess yeah of course, the amazing landscape
@877cms
@877cms 3 жыл бұрын
Finally got around to trying this, and it works! Thank you. I might investigate how to make it reboot instead of shutdown.
@AndreasSpiess
@AndreasSpiess 3 жыл бұрын
For rebooting you just have to switch power off and on...
@anvz6
@anvz6 5 жыл бұрын
It is better to have the root filesystem mounted read only. This way it may not be corrupted and you avoid reaching the writing cycles limit of the SD card. Another solution is to put all the root filesystem in a file in the DOS partition like in openelec. The boot is faster and it can never be broken.
@AndreasSpiess
@AndreasSpiess 5 жыл бұрын
Thank you for your information. So far I had no issues with the writing limitations but read about it. I usually use at least ram2disk to reduce some wear.
@gnom69
@gnom69 5 жыл бұрын
Some sd cards write when not in use, to move data to unused sectors as wear leveling. So you aren't completely safe.
@mcflapper7591
@mcflapper7591 5 жыл бұрын
@Alejandro Vargas: This is incorrect. The Pi is not corrupting the filesystem on the sdcard but it is physically destroying the sdcard. Sometimes you can be lucky and continue to use the sdcard but it is definitely going to break down sometime soon after this event. I had already like +10 sdcards of different manufacturers dying on me by exactly this Pi character trait. The underlying problem seems to be a physical write access when the voltage on the sdcard Vcc pin has already broken down or browned out. It also happens when spurious voltages of too high an amount is shortly present in the right (or bad) moment when power is lost. BTW, most of the corrupted sdcards still have a filesystem on it that can be used read-only. Sometimes the FS is completely done, but often you can at leas extract your data even if the sdcard is toast, write-access-wise. It is of particular nastiness if you got a Pi with Linux having panic'd. There's no way to shutdown via software. I ignore so far whether the dtoverlay=gpio3... trick would be a feasable solution in more cases than the one we're left with: unplug the power connector. I don't expect it to work in a case of kernel panic, there's just nothing left running to exec one more call to power off cleanly (especially regarding sdio shutdown).
@mcflapper7591
@mcflapper7591 5 жыл бұрын
Show me the system where "the boot can never be broken". Such a thing just does not exist. Particularly, when dealing with DOS partitions, as I understand you, you have to deal with vfat and consorts. Breaking a FAT is ****cking happening on it's own!
@mcflapper7591
@mcflapper7591 5 жыл бұрын
@@AndreasSpiess How is "ram2disk" reducing flash cell wear?
@typxxilps
@typxxilps 5 жыл бұрын
Great, but the pi 3 has a bit more than the 1 MB you mentioned though great way to remember FREUD by a Freudscher Versprecher 😉 switch button has turned dead ... sold out by vor blocked by the amount of traffic your video had "caused"
@benhetland576
@benhetland576 5 жыл бұрын
For the button hack I suggest you could make that a 4-pin long header instead of the 3p. Still make the connection at the 3rd pair, but now if you turn this around you don't hit the 3.3+5 shorts! well, provided you don't misalign the holes of course, but I understand you have already learnt to never do such a mistake again... ,;-) You could also ad one or two extra holes at the end, which you key shut so they can only be pushed down beyond the end of the Pi's connector, and then you cannot insert it the wrong way at all.
@AndreasSpiess
@AndreasSpiess 5 жыл бұрын
Good idea...
@joachimbaumann731
@joachimbaumann731 5 жыл бұрын
Dear Andreas, thanks for another nice video. Regarding the swap space configuration: First, you do not need to uncomment the swap file name, the name shown is the default and will be used if the line is still commented. This is cosmetic though. But you should also uncomment the last line of the config file to limit the maximum growth of the swap file using CONF_MAXSWAP. Otherwise you have no guarantees that the file does not grow too large. I personally also start with a CONF_SWAP_FACTOR of 1 instead of 2 but that depends on the Pi used and the amount of space you want to initially provide.
@AndreasSpiess
@AndreasSpiess 5 жыл бұрын
Thank you for your hints. Since I always have plenty of SD space I did not care about the (too big) swap size. Do I have to fear anything?
@joachimbaumann731
@joachimbaumann731 5 жыл бұрын
Hm, depending on the number of processes and their respective memory needs your swap space can grow - in theory - without bounds. In all practicality there‘s most probably nothing to fear, but for „production“ systems it is a conservative approach to nail down everything that might move. Ok, let me reformulate: For systems you use for experimenting, including e.g. tensorflow and other memory-costly apps, your approach might be the best. But if you have something that runs a well-defined number of applications in your home automation system installed somewhere you can‘t reach easily, you should use MAX_SWAP after you have watched the memory consumption of all your apps for some days. Calculate the maximum memory needed and use a factor of 2 or 3. That would be my approach, but ymmv.
@AndyPue
@AndyPue 5 жыл бұрын
That GPIO to shutdown thing is interesting, did not know about it until now. Thank you! However, I see the shutdown process initiated by the GPIO pin, but how is it supposed to restart the PI with the same button? (I think you mentioned it, but I cannot see where the functionality for this is implemented, I did not try it either yet, so maybe I am missing something obvious.)
@silasparker
@silasparker 5 жыл бұрын
You can get help on the overlay using the "dtoverlay -h gpio-shutdown" command. This also mentions the power on function: "This overlay only handles shutdown. After shutdown, the system can be powered up again by driving GPIO3 low. The default configuration uses GPIO3 with a pullup, so if you connect a button between GPIO3 and GND (pin 5 and 6 on the 40-pin header), you get a shutdown and power-up button."
@AndyPue
@AndyPue 5 жыл бұрын
@@silasparker So that restart works only after shutdown, I read that part in the documentation and assumed both functions are not enabled at the same time. (Force restart while shutting down would increase the danger of corruption, but makes sense its only active once the system is idle after shutdown.) Thank you!
@AndreasSpiess
@AndreasSpiess 5 жыл бұрын
They were both enabled in my case. I push the button once and it shuts down. After shutdown, I push it again and it restarts.
@MartinBgelund
@MartinBgelund 5 жыл бұрын
I searched and found some discussion on Stackoverflow on this: raspberrypi.stackexchange.com/questions/77905/raspberry-pi-3-model-b-dtoverlay-gpio-shutdown As mentioned by others, the behaviour is dependent on GPIOs setup wrt being default high or low.
@miriamramstudio3982
@miriamramstudio3982 4 жыл бұрын
Well, instead of using a 2x3 header, you could use a 2x4 header. If you put it the wrong way you will simply connect GPIO3 to 5V. Safe on the other side too (GPIO16-GPIO19 or GPIO20-GPIO26). Just my 2 cents. Anyway, great video. Thanks.
@AndreasSpiess
@AndreasSpiess 4 жыл бұрын
Good tip!
@hoggif
@hoggif 5 жыл бұрын
I didn't know about gpio shutdown. Now I think if 3.3V could be buffered with a super capasitor and when 5V disapears, RPI could shut down automatically. Something like that would give a clean shutdown when power fails. Now solve automatic restart after power recovery somehow and it would make a great setup.
@AndreasSpiess
@AndreasSpiess 5 жыл бұрын
I once made a video about this (without the gpio solution, but with super caps)
@hoggif
@hoggif 5 жыл бұрын
@@AndreasSpiess I know. I think super caps at the input could simplify the system more especially with gpio shutdown. No need for lithium chargers or battery monitoring circuits. Perhaps a diode and a resistor would be enough to sense power loss.
@danielkohwalter5481
@danielkohwalter5481 5 жыл бұрын
To be more safe, you can connect in series with the button a resistor. Probably an 1k resistor will work. Usually the internal pullup resistors are much higher and it still should provide the low voltage necessary to the IO pin. This way if you connect 5V and 3V3 and push the button the current should be around 1.7mA. It will not cause harm to the 5V part of the board, but I don't know the effect on the 3V3 regulator circuit. Probably (and I mean probably - I'm not sure) it will be ok.
@AndreasSpiess
@AndreasSpiess 5 жыл бұрын
I think it will be sure. But mechanically a little more challenging...
@danielkohwalter5481
@danielkohwalter5481 5 жыл бұрын
@@AndreasSpiess You can use a SMD resistor even below the button. Or a regular one if you partially breaks the top plastic part of the connector to fit it in.
@dorianeric
@dorianeric 3 жыл бұрын
Thank you so much, the reset button trick works so well and it was so easy.
@AndreasSpiess
@AndreasSpiess 3 жыл бұрын
You're welcome!
@bringamosa8480
@bringamosa8480 5 жыл бұрын
Have you ever had a corrupt sd card situation? I pulled the plug at least 50 times but still boots like a charm, maybe i am lucky? Will try the switch anyway, thanks!
@Electronieks
@Electronieks 5 жыл бұрын
Bringamosa 2times yes
@AndreasSpiess
@AndreasSpiess 5 жыл бұрын
I had issues but was not able to find the root cause. If you search the internet you for sure were lucky!
@zvpunry1971
@zvpunry1971 5 жыл бұрын
Most filesystems try to avoid unsafe states at all time. Some write new changes as planned changes into a journal, execute the changes on the real data and only if these changes are completed, they are removed from the journal. If a crash/poweroff happens in between, then it will just re-apply the changes that were written to the journal or it doesn't do anything to the data. This allows to always have a well defined state of the filesystem. This is called a journaling filessystem. Example: ext3/ext4/xfs Another variant is, if data is modified, to write a complete new data structure that references parts of the old data structure. If you change one byte of a large file, the following happens: It copies the block that contains the modified byte and applies the modification. Then it copies the data-structure that points to the many blocks of the large file, but it replaces the pointer to the modified block. And in a final atomic write operation, the new data-structure is written to some other data structure. This is called copy on write filesystem. Example: btrfs/zfs Both methods have some drawbacks. Journaling filesystems need to write data twice. Copy on write filesystems tend to be CPU-intensive when randomly accessing data in large files (Databases). So people sacrificed data integrity to speed. The typical solution is, to disable journaling or copy on write for data. These techniques are still used for meta-data, so your filesystem structure stays intact. File content can still be messed up. On ext4 this is the default, every write to data goes directly into the file. It is the responsibility of the program that writes files to do this safely. Data-journaling can be enabled with the mount option "data=journal". On btrfs, the default is data-integrity. Everything goes through the copy-on-write mechanism. But it is possible to set the 'C' attribute with chattr/lsattr to some specific directory prior to creating files in it, this disables the copy-on-write mechanism for the files in the directory. Typical directories für this are /var/lib/libvirt/images/ or /var/lib/mysql/. On ext4 you could mount / with data=journal and have a separate filesystem for the database that uses the faster defaults. Anyways, the filesystem metadata is relatively safe and data corruption is not directly visible. Programs like mysql can often repair their data files, but it is better to avoid these situations. Also, this has nothing to do with the SDCard. The SDCard can also be corrupted, some SDCards used unsafe methods for wear leveling (redirection of addresses depending on write cycles) and corrupted their own database where some block was stored. After power-loss they were unusable. I never had such a SDCard but I have read about these problems. If something like that happens, no filesystem wizardry will help you to recover your data. ;)
@macdroid53
@macdroid53 5 жыл бұрын
I have several pi's that have been shut down by power off regularly for years, no problems. But, I have also built others with an overlay and also no issues pulling the plug.
@bringamosa8480
@bringamosa8480 5 жыл бұрын
Thanks for the response. This button is so easy to be made it is almost stupid if i don't and risk the card to get corrupted
@Alan_UK
@Alan_UK 4 жыл бұрын
Hi Andreas. I enjoy your videos: well put together, clear & informative. The power off button looks an essential addition but how to remotely restart the Pi? Have you thought about making a video on NUT "Network UPS Tools" for the Rasp Pi? I'm thinking about this but I was wondering what happens after the Pi shutsdown should power be restored to the UPS before it has shut down. Presumably the Pi will not restart as it's power has not been lost. Or to put is another way, how to power up a Pi remotely - a sort of WOL?
@AndreasSpiess
@AndreasSpiess 4 жыл бұрын
If the Pi is without power and gets power it automatically starts. If you want to start a powered Pi you can do that as shown in hte video. And if you want to do that remotely you have to find a way to toggle this GPIO from remote. This can be done in many ways, for example with an ESP8266 or a 433 MHz button.
@Alan_UK
@Alan_UK 4 жыл бұрын
@@AndreasSpiess Thanks Andreas. One then shifts the problem to the ESP8266. How does the ESP8266 know that the UPS has lost power & the Pi has powered down (easy bit: the Pi NUT send a MQTT message to the ESP8266 before shutting down). Next the ESP8266 needs to know the UPS has not shut down as power has been restored so the ESP8266 can toggle the GPIO. Maybe the USP can tell the ESP8266 that power has been restored and then the ESP8266 can toggle the GPIO - but how can the UPS communicate this to the ESP8266? However, if the UPS has shut down (prolonged outage) then hasn't the ESP8266 also shut down? Maybe the ESP8266 is battery powered. Or maybe the ESP8266 has a start up routine when power is restored that checks if the PI had previously shut down (record written somewhere). Maybe the ESP8266 interrogates the Pi and if the Pi responds it knows the Pi has auto restarted after a prolonged power outage so there is no need to toggle the GPIO. I'm thinking aloud here but I think the key thing is that the logic has to be bullet proof for all scenarios.
@AndreasSpiess
@AndreasSpiess 4 жыл бұрын
An ESP has input pins to measure voltage or digital signals.
@veryboringname.
@veryboringname. 5 жыл бұрын
If your case allows it, you can use a 4-pin shell and leave the first column of pins hanging off the end of the Pi header. Fill the unused column that's hanging off the edge with hot glue or something similar. That way you can't connect it the wrong way round.
@AndreasSpiess
@AndreasSpiess 5 жыл бұрын
Good idea!
@HariWiguna
@HariWiguna 5 жыл бұрын
Andreas, could a resistor in series with the switch work as a safety precaution so we won't completely short 3V and 5V? It would make the switch a bit taller though. Also, I wonder how low the resistance needs to be to set the pin LOW and yet "open" enough when shorting 3V3 and 5V. 1K?
@AndreasSpiess
@AndreasSpiess 5 жыл бұрын
Yes, but maybe mechanically less elegant. For me, it was not necessary as I usually know what I do ;-) (I grew up when mistakes destroyed things and we had to think twice).
@fegoins
@fegoins 4 жыл бұрын
Perfect video and writeup on SENSORSIOT , a huge help to me.
@AndreasSpiess
@AndreasSpiess 4 жыл бұрын
Glad it helped!
@darrinpearce9780
@darrinpearce9780 5 жыл бұрын
Hey Andreas, thanks for the tips. I have a fleet of RPI's here and this will save me heaps of time.
@Conservator.
@Conservator. 5 жыл бұрын
Just curious: what is you ‘fleet’ used for?
@darrinpearce9780
@darrinpearce9780 5 жыл бұрын
@@Conservator. Hi Andrea's. Streaming server for LiveATC another for LoRaWAN on TTN (thanks for those video's), web server and node for portable FT8.
@AndreasSpiess
@AndreasSpiess 5 жыл бұрын
You are welcome!
@Conservator.
@Conservator. 5 жыл бұрын
Darrin Pearce Impressiv! 👍
@DavoShed
@DavoShed 2 жыл бұрын
Seem like making the pin header 3 pins wide creates as many problems as it solves? You also didn’t mention why you used those two pins. That is it will also wake the pi when pressed again while in a halt state. I only recently stumbled across this information and it works way back to the original pi version 1.
@AndreasSpiess
@AndreasSpiess 2 жыл бұрын
I thought I mentioned the reason (connector is flush to the end). And I also mentioned the rebooting.
@PhG1961
@PhG1961 5 жыл бұрын
Interesting tricks and tips. Great stuff !
@AndreasSpiess
@AndreasSpiess 5 жыл бұрын
Thank you!
@MGKday
@MGKday 5 жыл бұрын
thanks for this video ! is trick1 considered as a graceful shutdown ? i.e. will it save the status or something ? if no, is it at least considered as totally harmless (if done connected the right way) ?
@AndreasSpiess
@AndreasSpiess 5 жыл бұрын
It is the same as if you type „shutdown „
@toastrecon
@toastrecon 4 жыл бұрын
Great ideas and useful info! Thank you!
@AndreasSpiess
@AndreasSpiess 4 жыл бұрын
Glad it was helpful!
@jjordan73115
@jjordan73115 4 жыл бұрын
Power button works great on pi zero! Thanks for the easy steps!
@AndreasSpiess
@AndreasSpiess 4 жыл бұрын
You're welcome!
@patrichausammann
@patrichausammann 5 жыл бұрын
5:28 I guess Mr. Spiess meant one gigabyte of RAM, not a megabyte.
@AndreasSpiess
@AndreasSpiess 5 жыл бұрын
Yes
@patrichausammann
@patrichausammann 5 жыл бұрын
@@AndreasSpiess 😅 I try to be attentive. 😉
@WacKEDmaN
@WacKEDmaN 5 жыл бұрын
great tips Andreas...there is some there ive never heard of that ill definitely be using!
@AndreasSpiess
@AndreasSpiess 5 жыл бұрын
Glad to read that!
@rondamon4408
@rondamon4408 5 жыл бұрын
Great video!! Have you ever done a video about pine 64 and pine phone?
@AndreasSpiess
@AndreasSpiess 5 жыл бұрын
I am no SBC guy and because I am a Linux noob I stick with the Raspberry because of its community
@dave07drummer
@dave07drummer Жыл бұрын
i used the code in the vid, except i changed pin=25 and gpio works fine as a shutdown button on gpio pin 25 👌
@AndreasSpiess
@AndreasSpiess Жыл бұрын
Thank you for the feedback!
@NoxmilesDe
@NoxmilesDe 5 жыл бұрын
Wow - that are really new Tricks! Thanks a lot and Grüezi!
@AndreasSpiess
@AndreasSpiess 5 жыл бұрын
You are welcome!
@kwazar6725
@kwazar6725 5 жыл бұрын
Good starter hints. Listen to Andreas folks.
@AndreasSpiess
@AndreasSpiess 5 жыл бұрын
:-)
@svenboske844
@svenboske844 5 жыл бұрын
The gpio-shutdown won't work for me on Rasbian Buster any more; at first i blamed the Pi4 but after an Update of Moode on a Pi Zero theres the same problem (strangely enough starting via GPIO still works). Couldn't find anything on this Topic till now. Nonetheless a big Thanks to Andres for this Channel
@robatoto
@robatoto 5 жыл бұрын
Shorting the 3.3V and 5V Pin on the latest Raspberry Pi models 3B+ and 3A+ will destroy the power management IC (PMIC), a custom chip unavailable from any seller. So better be careful with the orientation of the button.
@AndreasSpiess
@AndreasSpiess 5 жыл бұрын
Thank you for your information!
@dd0356
@dd0356 5 жыл бұрын
I think that ic was there on AliExpress. I once killed the ic and looked for it on the internet. luckily it was loose solder so did not have to buy that.
@zaprodk
@zaprodk 5 жыл бұрын
@@dd0356 The chip is on Aliexpress. Problem is that it's not the correct one.
@robatoto
@robatoto 5 жыл бұрын
It’s not the standard version of the MXL7704 chip even tough the label doesn’t indicate it. Just google it. You’ll find plenty of stories about it...
@robatoto
@robatoto 5 жыл бұрын
Hackaday, 4 days ago: hackaday.com/2019/06/12/shorting-pins-on-a-raspberry-pi-is-a-bad-idea-pmic-failures-under-investigation/#more-355336
@twmbarlwmstar
@twmbarlwmstar 5 жыл бұрын
Handy vidjeo as I have to finish a Pi today, not a steak and kidney pi, with some chips and maybe some peas and a bit of extra gravy. Oh no, a Raspeberry Pi, fully loaded with SATA SSD, plenty of cooling and overclocked, plenty of power (up to 5, Amps), lots of USB even somewhat useless USB3, and a hardware safe shutdown but I still need the software safe shutdown. And I have to fit the UPS which has a few other features I can't currently recall, but it smooths the supply and based on testing should give me about 4 hours on battery. Again I will need to find some code because really I want the option to safely shut down like my grown-ups UPS from HP that looks after x86 stuff.
@AndreasSpiess
@AndreasSpiess 5 жыл бұрын
Seems to be a huge system ;-)
@johnblack6134
@johnblack6134 5 жыл бұрын
just one thing, do not add any files like ssh or wpa_supplicant.conf on a sd card that you have just copied from an img file until after the first boot. in my experience raspbian checks the file structure and thinks that it is corrupt and so will not boot. Some builds are ok about this and some are not.. of course after the first headless boot you can only switch it off but this seems to be ok only do wait a bit while it extends the partition and the green light has stopped flashing.
@AndreasSpiess
@AndreasSpiess 5 жыл бұрын
So far I did not experience those issues (I add the files on my PC)
@skvalen
@skvalen 5 жыл бұрын
Here is an idea I had: add an capasitor bank and a comparator that trip the shutdown when the power goes down. The capasitor bank (or a battery) must be large enough to power rPi during the shutdown sequence, it probably doesn't need to be very large.
@AndreasSpiess
@AndreasSpiess 5 жыл бұрын
I think I made a video about that.
@skvalen
@skvalen 5 жыл бұрын
@@AndreasSpiess Do you remember which?
@AndreasSpiess
@AndreasSpiess 5 жыл бұрын
No
@rickoosteen4943
@rickoosteen4943 2 жыл бұрын
@@AndreasSpiess Can you research and let everyone know? Would be helpful, thanks!
@crayzeape2230
@crayzeape2230 5 жыл бұрын
If you can set GPIO2 to output low and use that instead of ground, you'll be much safer in the case of accidental 180 degree rotation (both sides of the link then become 5v).
@AndreasSpiess
@AndreasSpiess 5 жыл бұрын
I am not sure. The real problem is pin 1 and 2.
@crayzeape2230
@crayzeape2230 5 жыл бұрын
@@AndreasSpiess I'm referring to using GPIO2 set to 0v output in place of the ground pin. You'd still use GPIO3 the same way so you'd be using pins 3,5 instead of 5,6. If accidentally reversed, the switch would connect pins 2,4 which are both at the same 5v potential so no problem. Pin 1 (reverses pin 6) no longer comes into the equation, so again, no problem.
@KunalGautam
@KunalGautam 5 жыл бұрын
Memory Split option (Under raspi-config advaced option) set to 16MB might also help
@AndreasSpiess
@AndreasSpiess 5 жыл бұрын
Thank you!
@Hasitier
@Hasitier 5 жыл бұрын
If I understood correctly you said that the button also can boot up the raspberry. Can you explain how this works? I did not try it yet but I would like to understand how it would work. Thanks for the great video. Greetings from Germany Michael
@AndreasSpiess
@AndreasSpiess 5 жыл бұрын
I do not know how it works. I just pressed the button and it booted. Must’ve part of Raspbian
@Hasitier
@Hasitier 5 жыл бұрын
Andreas Spiess ok. So if anyone else knows why please let us know. I will try it myself in the next days.
@meinsda5983
@meinsda5983 5 жыл бұрын
Always nice your Videos ;) One simple shutdown is to connect a power bank between the usb port and look if the original power goes down you will shutdown the Raspberry. if the power Comes back you can restart the Raspberry.I hope over the summer i have time to build a rack System with poe suppert with the same switch you have ;)
@AndreasSpiess
@AndreasSpiess 5 жыл бұрын
The shutdown has to start before the power goes down ;-)
@michim5661
@michim5661 5 жыл бұрын
Most power banks are not useable as USV/UPS, because they do not allow simultaneous charging and discharging.
@meinsda5983
@meinsda5983 5 жыл бұрын
yes i know! But i use one how can charge and running my pi at the same time. Some pi is running with the poe heat and powered over a switch with a ups behind.
@ailivac
@ailivac 5 жыл бұрын
you don't need to run the editor itself as root to edit a system file! use sudoedit, which is more secure and will use whatever command you have set in $EDITOR, with any settings in your user account rather than root's. it works by making a temporary copy of the file, opening that with the editor, and moving the edited copy over the original after the editor exits
@AndreasSpiess
@AndreasSpiess 5 жыл бұрын
Thank you for the tip! Tried it and it worked!
@DIYTechRepairs
@DIYTechRepairs 5 жыл бұрын
Using the swapspace is not Good practice. Especially not on SD card. You kill the card rather fast :) you can lower mem consumption in influxdb and also lower the writes There. Its highly recommended IF you going to run influx on SD card. Personally i would not run influx node and grafana on a zero. Its way to Little ram even with tweaks. Another trick to reduce writing on SD card is to disable logging or move it to ram.
@AndreasSpiess
@AndreasSpiess 5 жыл бұрын
AFAIK Swap is enabled by default. I usually use log2ram to avoid a lot of unnecessary writes (because I am a Linux noob and cannot disabler all logging). Many of our applications do not write a lot of data to the database, so it might be ok. Do you have information about the wear of (newer) SD cards (not only rumors)? I did not find any so far.
@DIYTechRepairs
@DIYTechRepairs 5 жыл бұрын
@@AndreasSpiess you can find the mtf in the datasheet or in some of them... but generally IF you use known brand cards it Will last all from half A year and upwards. .normal applications is generally not a problem but when you start to use time series data you suddenly want to log alot. I have killed many in My days as iot and Linux neerd and specially i use influx for datastore. But My applications and or systems log many 100 values per second :)
@x.X.x_.
@x.X.x_. 4 жыл бұрын
Hi all,good afternoon. Can you help me, please? I have a Raspberry Pi Zero W, I bought it yesterday and used the shutdown command to turn off and it won't turn on anymore. I watched your video, but if doesn't turn on, how else am I going to set it up for Putty? (sudo nano /boot/config.txt) I know that power is passing through the card, because the USB is leaving electrical current. If you can help I would be very grateful, Thank so much.
@AndreasSpiess
@AndreasSpiess 4 жыл бұрын
Raspberries do not switch on again after shutdown. You have to remove power first and then they boot
@prakashdutt1520
@prakashdutt1520 8 ай бұрын
suppose I am using Rusberry Pi 5 as a Ubuntu PC.. What will happen if suddenly it loose power from adapter... And what will happen if this happen many time.... As in our area there is limited time of power supply available...
@AndreasSpiess
@AndreasSpiess 8 ай бұрын
It can corrupt your SD card.
@prakashdutt1520
@prakashdutt1520 8 ай бұрын
@@AndreasSpiess what about my Rusberry pi will it damage?
@AndreasSpiess
@AndreasSpiess 8 ай бұрын
Usually not. If your power supply does not produce spikes when power comes back.
@aamiddel8646
@aamiddel8646 5 жыл бұрын
Nice tip, But did i miss something. In the introduction you said the system will restart (with the switch). But lateron you mention that after you use the switch it will not reboot..
@AndreasSpiess
@AndreasSpiess 5 жыл бұрын
It will only reboot if you use GPIO3. All other pins only shutdown
@MrFurriephillips
@MrFurriephillips 5 жыл бұрын
I was expecting some sort of momentary, rudimentary UPS, using a chunky capacitor and something to sense loss of the incoming power supply, that initiates an automatic shutdown, by bridging pins 5+6 :(
@AndreasSpiess
@AndreasSpiess 5 жыл бұрын
Maybe you watch my other videos about this topic. There you even find supercaps, if I remember right ;-)
@electronic7979
@electronic7979 5 жыл бұрын
👍👍👍
@AndreasSpiess
@AndreasSpiess 5 жыл бұрын
:-)
@send2gl
@send2gl 5 жыл бұрын
Useful, thank you.
@AndreasSpiess
@AndreasSpiess 5 жыл бұрын
You are welcome!
@fuzzy1dk
@fuzzy1dk 5 жыл бұрын
add the gpio-poweroff driver and an LED so you can see when the shut down is finished and it is safe to remove power
@AndreasSpiess
@AndreasSpiess 5 жыл бұрын
You see it if the RPI LED stops to blink
@GlennHamblin
@GlennHamblin 5 жыл бұрын
Great tips. Thank you!
@AndreasSpiess
@AndreasSpiess 5 жыл бұрын
You are welcome!
@jeremeyweeks5069
@jeremeyweeks5069 5 жыл бұрын
Great video. Thanks!
@AndreasSpiess
@AndreasSpiess 5 жыл бұрын
You are welcome!
@belenhedderich3330
@belenhedderich3330 5 жыл бұрын
Thank you Andreass I tried to apply it to the Octoprint without luck I wonder what is wrong
@AndreasSpiess
@AndreasSpiess 5 жыл бұрын
Maybe an old Firmware/operating system (This feature seems to be quite new)
@michaelharings9913
@michaelharings9913 5 жыл бұрын
You don't have to build a power on/off switch, you can buy them online for ~$2, then the 2 pins are just on 5/6 only.
@AndreasSpiess
@AndreasSpiess 5 жыл бұрын
Do you have a Link?
@michaelharings9913
@michaelharings9913 5 жыл бұрын
@@AndreasSpiess 3 for $5. on amazon: www.amazon.com/Warmstor-Desktop-Button-Computer-Switch/dp/B072FMVZJZ/ref=pd_cp_23_2?pd_rd_w=Pqsb2&pf_rd_p=ef4dc990-a9ca-4945-ae0b-f8d549198ed6&pf_rd_r=N7DXDY843CW9YJMCRCXH&pd_rd_r=761a2f44-a5b2-11e9-8f67-8fa59547a07e&pd_rd_wg=kYFXp&pd_rd_i=B072FMVZJZ&psc=1&refRID=N7DXDY843CW9YJMCRCXH
@AndreasSpiess
@AndreasSpiess 5 жыл бұрын
Aha. Very good idea to use the one used in PCs! Thank you!
@prebenborg
@prebenborg 5 жыл бұрын
I have just experienced a major sd-card crash due to power failure twice in a day. A question: Is it hard to make a small UPS power supply for a RPI? It should just power the RPI with 5 v. which is rather minor and if a power occurs the UPS should trigger the shutdown command
@AndreasSpiess
@AndreasSpiess 5 жыл бұрын
You can buy such devices if you want. I also made videos concerning this topic.
@mordinkainen1844
@mordinkainen1844 5 жыл бұрын
thank you for this.
@AndreasSpiess
@AndreasSpiess 5 жыл бұрын
You are welcome!
@chucktaylor5878
@chucktaylor5878 4 жыл бұрын
This worked for me on a PI 4B for octoprint. But I could not read what to change the code to at 3:18 from the video. Here is what to change it to... dtoverlay=gpio-shutdown,gpio_pin=3,active_low=1,gpio_pull=up
@AndreasSpiess
@AndreasSpiess 4 жыл бұрын
As usual, there is a link in the video description to the commands. It is the same as above.
@sharedinventions
@sharedinventions 5 жыл бұрын
I never use superglue any more on electronics. First of all it might blocks the connector. But the most problematic part is when you try to solder something that is covered with superglue: some very bad smell escapes, I bet it is very harmful for your helth.
@AndreasSpiess
@AndreasSpiess 5 жыл бұрын
You just have to pay attention where you use it ;-)
@lmarloe
@lmarloe 5 жыл бұрын
Just dtoverlay=gpio-shutdown will be enough, in old firmware there was dtoverlay=gpio-poweroff,active_low=y for low power consumption in stand by including turning off the LED, it seems this doesn't work anymore and RPi3B+ consume ~100mA after shutdown
@AndreasSpiess
@AndreasSpiess 5 жыл бұрын
Thank you for the tip. I did not measure the current when the RPI was off
@cmorda11
@cmorda11 5 жыл бұрын
If you use 5 pin shell, the pins will be in the center, and you can never be wrong! :)
@AndreasSpiess
@AndreasSpiess 5 жыл бұрын
Good idea!
@ThaRealChuckD
@ThaRealChuckD 3 жыл бұрын
You the man!!! 👍
@AndreasSpiess
@AndreasSpiess 3 жыл бұрын
You are welcome!
@JohnPitney
@JohnPitney 5 жыл бұрын
Something to watch out for: once an InfluxDB database gets too large, it can no longer function properly on 32-bit systems. The whole database is memory-mapped, so the address-space limitation applies. I ran into this limitation on my Raspberry Pi. github.com/influxdata/influxdb/pull/12362
@AndreasSpiess
@AndreasSpiess 5 жыл бұрын
Thank you for the warning. For my part, I only store small amounts of data on a RPi...
@nicklaspersson4687
@nicklaspersson4687 5 жыл бұрын
Useful = True Interesting = True Happiness = Happiness ^ 2;
@AndreasSpiess
@AndreasSpiess 5 жыл бұрын
Thank you!
@avejst
@avejst 5 жыл бұрын
Impressive tutorial Thanks for sharing :-)
@AndreasSpiess
@AndreasSpiess 5 жыл бұрын
You are welcome!
@FhargaZ
@FhargaZ 5 жыл бұрын
Whitout the scripts to turn it on was to use a outside switch. Now that i put a hifinerry i can't use those pins like i used to 😒 After trying so many things, bevause i have Recalbox i just use a wifi switch to cut power after the shutdown and to turn it on again.
@ajaybnl
@ajaybnl 5 жыл бұрын
Very Good Video. Please make a video on new esp32-s2.
@AndreasSpiess
@AndreasSpiess 5 жыл бұрын
For the moment it is not available. And I have to wait till it is supported by the Arduino IDE
@petermeiner3574
@petermeiner3574 5 жыл бұрын
True Story: yestetday in the evening i struggle on the issue, how to shutdown on headless System's. And the Magic happend again. The next Morning you solved it! Btw: i did not see in the video why gpio 3 also can do a startup, but other pin's not? What is the special on this gpio?
@AndreasSpiess
@AndreasSpiess 5 жыл бұрын
You have to ask the inventor. I do not know why.
@nicholasroos3627
@nicholasroos3627 5 жыл бұрын
Ah....Sunday mornings. Better with Andreas.
@AndreasSpiess
@AndreasSpiess 5 жыл бұрын
Thank you!
@vrjb100
@vrjb100 4 жыл бұрын
Better solution is to have the raspberry run with readonly filesystems and no swap filesystem. Then the shutdown is quite simple just unplug. An headless IoT device should write data via a network.
@AndreasSpiess
@AndreasSpiess 4 жыл бұрын
I want the raspberry the only computer running 24/7 in my home. And I do not trust the cloud for realtime stuff like a file system :-(
@olafbode7490
@olafbode7490 5 жыл бұрын
sorry, don't get it: why is PIN21 okay for shutdown but doesn't reboot the Pi?
@AndreasSpiess
@AndreasSpiess 5 жыл бұрын
I do not know the reason
@user-vn7ce5ig1z
@user-vn7ce5ig1z 5 жыл бұрын
• But I thought that Linux is supposed to be better than Windows and ext is supposed to be a journalling file-system. Shouldn't it be immune to sudden-shutdown data-loss? 🤨 • How does pressing the button _start_ the Pi? 🤔 • The Orange Pi has a built-in button and it works to shutdown in Raspbian but not Armbian. :-\
@GRBtutorials
@GRBtutorials 5 жыл бұрын
Well, for me the button works in Armbian (you need a recent version though). Are you sure you didn't mean the opposite?
@AndreasSpiess
@AndreasSpiess 5 жыл бұрын
You start by pressing the button.
@NorthernKitty
@NorthernKitty 4 жыл бұрын
It's not about Linux, it's about the Pi using an SD card as the boot drive and main drive. If Windows booted from SD cards and used them as the main drive, you'd have the same potential for problems. In fact, if you're not first choosing "eject" prior to yanking SD cards out of your Windows PC, you are just as likely to experience errors on your SD card. It's about how easy it is to corrupt flash memory.
@phizicks
@phizicks 5 жыл бұрын
I completely turn off swap on mine (no Pi zero though) and remove syslog, I can unplug every time without corruption as it barely writes now. syslog is sent to another server so no issues with logs. your website says "Save Shutdown" did you mean "Safe Shutdown"
@AndreasSpiess
@AndreasSpiess 5 жыл бұрын
Corrected. Thank you!
@totoskiller
@totoskiller Жыл бұрын
Sali du 😊
@Devin82m
@Devin82m 4 жыл бұрын
So why would sudo shutdown not work via SSH as opposed to using a keyboard? I've been doing this for years, am I missing something?
@AndreasSpiess
@AndreasSpiess 4 жыл бұрын
I to not think you missed anything. But if you switch the power off, you have no time for that.
@zvpunry1971
@zvpunry1971 5 жыл бұрын
About the shutdown switch: This is a good Idea. But the problem still exists when power is lost by accident. If it is possible, mount the filesystems read-only, write data to a tmpfs and replicate it to another machine. wiki.debian.org/ReadonlyRoot This can also be done with overlayfs, which is a union-filesystem that puts a tmpfs and some read-only directory together. Every write goes to the ram-disk and every read is first looked up in the tmpfs, and if nothing is there it reads it from the read-only filesystem. A short search for overlayfs and read-only root should bring up complete scripts. www.dinotools.de/2016/05/08/raspberry-pi-mit-read-only-root-dateisystem/ (in German) About swap: My recommendation is to completely disable swap. If the physical memory isn't enough for the intended use and you can't add RAM, then it is the wrong machine for the job. Reason: If the operating system writes to slow storage, everything has to wait. Then a currently swapped-out memory gets accessed and the whole procedure begins again. This is called thrashing and causes downtime. Without swap, the operating system makes a relatively fast decision to kill offending programs and maybe a watchdog reboots. This is much faster than thrashing. en.wikipedia.org/wiki/Thrashing_(computer_science)
@AndreasSpiess
@AndreasSpiess 5 жыл бұрын
Thank you for your information. With small computers, we always have to deal with some limitations and an RPI is far from being ideal. But this trick at least makes that it works, even slower and it made this project possible. The info might be interesting also for someone with a blocking RPI, even if he changes the board for a bigger one. At least he knows what the problem is. I searched quite a while ;-)
@gerardschepers3744
@gerardschepers3744 2 жыл бұрын
You should have used 2x 5-pin headers, and put the switch on the middle pin. The it would not matter how to connect the switch
@AndreasSpiess
@AndreasSpiess 2 жыл бұрын
Good idea!
@GarryMobi
@GarryMobi 5 жыл бұрын
Using the SD Card for constant writing - be it Swap space, syslog or stuff like databases - will relatively quickly kill most SDCards ... if you want to use a Pi for anything like that, get an external drive and run it off of it instead of SDCard ...
@AndreasSpiess
@AndreasSpiess 5 жыл бұрын
Do you have information about that fact? I see a lot of rumors, but no facts.
@NorthernKitty
@NorthernKitty 4 жыл бұрын
@Garry, there is a script available on github called "log2ram" which will redirect your /var/log directory to RAM, which then will use cron to copy the logs permanently to your SD on a less frequent basis. This will reduce the bulk of write activity to your SD by the Pi. I don't think most people need go as far as using an additional drive, unless they have a very demanding application using swap space. @Andreas, SD's certainly do have a lifespan that is, in part, limited by write cycles. Though I honestly think people will reach the meantime-between-failure of the physical media long before they actually hit the limit on write cycles, even if logs are constantly being written. Each individual bit can take like 100,000 writes. Given that the circuitry in SD cards have "wear-leveling" to evenly distribute data across the entire card, I believe you'd have to write over the entire card more than 1000 times per day for a year to reach that. Expect heat and aging to cause errors long before too many writes. Still, it doesn't hurt to use something like log2ram to reduce write activity for a host of reasons.
@aggese
@aggese 5 жыл бұрын
Sorry to have to tell you this but this is not true and haven't been true for close to 20 years. The whole point to have a journaling filesystem is to remove this problem and the kernel is built as standard to remove this system. This will only be a problem with some large server installations.
@AndreasSpiess
@AndreasSpiess 5 жыл бұрын
What exactly is not true?
@AltMarc
@AltMarc 5 жыл бұрын
The journaled filesystem is about data integrity, but cannot help on low level corruptions of the sd card itself. These SD fails are not about corrupted data, it simply doesn't work anymore, it's dead, no way to re-format the card.
@OndrejPopp
@OndrejPopp 4 жыл бұрын
Tx for the power button solution, however I am also looking for a solution to detect a proper shutdown. This to control a rpi from a microcontroller which will after detecting a proper shutdown of the rpi power down the whole system. Similar to what is happening on a PC motherboard where after the shutdown sequence the power supply is automatically switched off. Maybe this has something to do with the init script? I have actually never looked into that, so if anyone knows that would be great otherwise I am going to dive into this myself.
@AndreasSpiess
@AndreasSpiess 4 жыл бұрын
Maybe you watch the last video. There we try to build a UPS with such a function. And you can use a switch to GPOI3 to properly shutdown the Pi4
@OndrejPopp
@OndrejPopp 4 жыл бұрын
@@AndreasSpiess Ok tx Andreas I am going to watch it!
@michaelgraff6978
@michaelgraff6978 5 жыл бұрын
I really wish there was a simple way to boot from SD, and then change to a fully in-RAM filesystem where the SD card is re-mounted in a read only mode.
@AndreasSpiess
@AndreasSpiess 5 жыл бұрын
You can boot from a regular USB drive if you want. I made a video on how to do it.
@siskodata
@siskodata 5 жыл бұрын
The shutdown button powers off the Pi or just shuts down the OS? Cause how would you know when to power it down after you press the shutdown button?
@zaprodk
@zaprodk 5 жыл бұрын
The Pi has no way of doing that. You need external circuitry to have that functionality.
@siskodata
@siskodata 5 жыл бұрын
@@zaprodk I thought so then its useless to me at least I need an indication for powering it off.
@zaprodk
@zaprodk 5 жыл бұрын
@@siskodata Google "ATXRaspi" - Yeah, ATX is completely wrong in this context as it has nothing to do with the ATX configuration, but someone made a module that does what you want.
@tozinfo6448
@tozinfo6448 5 жыл бұрын
@@zaprodk : lowpowerlab.com/guide/atxraspi/ lowpowerlab has some interesing things to give, andreas did present something from there before, i guess...
@albertosapiens1
@albertosapiens1 5 жыл бұрын
You can notice by seeing that the Ethernet LEDs, if it's connected, and the green led next to the red power one are not blinking after a few seconds
@MeisterQ
@MeisterQ 5 жыл бұрын
Hello Andreas, is there a way with this commands to reduce the lag of motion on the zero? i want a security cam with a zero W and its stream is very very laggy.
@AndreasSpiess
@AndreasSpiess 5 жыл бұрын
I have to admit I am a Linux noob. Maybe somebody else knows it?
@laverdanick
@laverdanick 5 жыл бұрын
I use Motioneye OS and for my purposes it runs very well on a Zero W. The author has specific images for the different versions of Pi.
@thibaultbacle3609
@thibaultbacle3609 4 жыл бұрын
Can one use the button trick to wake noobs (multi boots) and shutdown in every installed OS ? I plan on running manjaro and retropie using noobs
@AndreasSpiess
@AndreasSpiess 4 жыл бұрын
I do not know as I do not use noobs.
@dj1encore
@dj1encore 3 жыл бұрын
Do you know how to add a shutdown command to influxdb during reboot or shutdown.
@AndreasSpiess
@AndreasSpiess 3 жыл бұрын
I never did something like that. I trust that it is shutdown automatically (gets a signal from the OS). But I do not know. So far I never had problems.
@linuxgamer2147
@linuxgamer2147 5 жыл бұрын
danke für das Video
@AndreasSpiess
@AndreasSpiess 5 жыл бұрын
Gern geschehen
@jeffschroeder4805
@jeffschroeder4805 3 жыл бұрын
Tried safe shutdown button and it didn't work....until I thought to check whether I2C was enabled....disabled it and the button worked as intended. Now how to use I2C without disabling restart feature?
@AndreasSpiess
@AndreasSpiess 3 жыл бұрын
I do not know. So far, I never used I2C on a Raspberry. I use MCUs for my sensors.
@dmitrysysoletin9967
@dmitrysysoletin9967 5 жыл бұрын
Well, probably most effective Raspberry Pi trick is... is to throw off Raspberry and get some good SBC, like Asus tinkerboard or Ordroid or something like. Pi has too low RAM and too slow CPU.
@AndreasSpiess
@AndreasSpiess 5 жыл бұрын
There are better boards, you are right. But the support for RPI is very good for noobs like me...
@wd269
@wd269 3 жыл бұрын
Can someone advise if the switch used for this project is momentary or held closed for power on?
@AndreasSpiess
@AndreasSpiess 3 жыл бұрын
I think it should be open, but I never tested what happens if closed during power-up.
@wd269
@wd269 3 жыл бұрын
@@AndreasSpiess Thanks - I did also find a few other sources that suggested a normally-open, momentary switch--apparently a normally-close switch can be used as well but the code would be a bit different.
#265 Pressure Monitoring incl. Fusion360 Tricks
16:36
Andreas Spiess
Рет қаралды 42 М.
Officer Rabbit is so bad. He made Luffy deaf. #funny #supersiblings #comedy
00:18
Funny superhero siblings
Рет қаралды 18 МЛН
Стойкость Фёдора поразила всех!
00:58
МИНУС БАЛЛ
Рет қаралды 7 МЛН
Part 5. Roblox trend☠️
00:13
Kan Andrey
Рет қаралды 2,7 МЛН
DON'T Use Raspberry Pis for Servers! (Use THIS)
16:23
Hardware Haven
Рет қаралды 1,1 МЛН
Raspberry Pi Power Switch Button - Safe Shutdown / Start Up
10:03
Raspberry Pi IoT Server Tutorial: InfluxDB, MQTT, Grafana, Node-RED & Docker
12:32
Learn Embedded Systems
Рет қаралды 229 М.
Every Developer Needs a Raspberry Pi
27:27
Sam Meech-Ward
Рет қаралды 724 М.
DIY Raspberry Pi Racecar Dashboard: The Ultimate Guide
15:11
BEAVIS Motorsport
Рет қаралды 760 М.
Build an Off Grid Wikipedia with #RaspberryPi
19:23
element14 presents
Рет қаралды 186 М.
#403 Simple Trick to protect your Raspberry SD card from Crashing
8:12
I Can Save You Money! - Raspberry Pi Alternatives
15:04
Linus Tech Tips
Рет қаралды 3,4 МЛН
Officer Rabbit is so bad. He made Luffy deaf. #funny #supersiblings #comedy
00:18
Funny superhero siblings
Рет қаралды 18 МЛН