The Raspberry Pi Thread

A bit of a fresher here (I am a programmer, but zero experience with raspi)
I want to set up a pi-hole (to eliminate all ads on devices within local network)
We are a family of 4 with 2 laptops, 2 PCs, 5-6 mobiles at the most active at once.

Which Raspberry Pi should I go with? Would the zero be enough or need something like 3B/4?
A Pi Zero W should be enough. I used to run mine off the USB port on a Asus RT-AC68U router.
 
Ok. Just wondering what is rationale behind this.

Recommended requirement for the pi is 3A. https://www.raspberrypi.org/documentation/hardware/raspberrypi/power/README.md
The dash charger supplies 5V @ 4A which fulfills the need. So should not be an issue ... unless there is any component drawing more current, which would then fry the board. The flash drive doesn't seem to be drawing more power. And if they does then it is the pen drive issue.
To put it in short, the phone chargers are chargers not powersupplies, their current is not even, it goes up and down. Everything from wire guage, to the quality of components inside decide the voltage & current it will out put. Plus its not an exact fit, so you dont know what level is the charger providing to the Pi.
RPI4 is uniquely sensitive about power. You can check the voltage being provided.

Check if these commands can help you diagnose the issue -> https://www.raspberrypi.org/forums/viewtopic.php?t=190584

The reason I tell you this is cause when i bought the pi4 in 2019, I had done extensive research as I was going to make a NAS with it. I tried it with other powesupplies from Amazon plus current ones I had. The cpu was throttled and voltage varied a lot. Even on my Oneplus 3T charger. Also the 4 volt oneplus delivers is in proprietary tech, not sure its reaching the RPI4. I got 2 original powersupplies for both my rpi4s in 2019 and I have my NAS on since 2019, its never had any issue. Its connected to usb hdd all the time.

Check the above, try the commands and see if you find a problem.


"vcgencmd get_throttled" tells you (amongst other things) all the Pi knows about the quality of its power. To get any more you need an analogue to digital convertor to measure the key voltages -- mainly the 5V rail, possibly battery if you run from one.
 
To put it in short, the phone chargers are chargers not powersupplies, their current is not even, it goes up and down. Everything from wire guage, to the quality of components inside decide the voltage & current it will out put. Plus its not an exact fit, so you dont know what level is the charger providing to the Pi.
RPI4 is uniquely sensitive about power. You can check the voltage being provided.

Check if these commands can help you diagnose the issue -> https://www.raspberrypi.org/forums/viewtopic.php?t=190584

The reason I tell you this is cause when i bought the pi4 in 2019, I had done extensive research as I was going to make a NAS with it. I tried it with other powesupplies from Amazon plus current ones I had. The cpu was throttled and voltage varied a lot. Even on my Oneplus 3T charger. Also the 4 volt oneplus delivers is in proprietary tech, not sure its reaching the RPI4. I got 2 original powersupplies for both my rpi4s in 2019 and I have my NAS on since 2019, its never had any issue. Its connected to usb hdd all the time.

Check the above, try the commands and see if you find a problem.
Got it. Let me first arrange the official power supply. Thx
 
No first run those commands and check the voltage and if its being throttled.
1625154311693.png


Oneplus dash charger + raspbian lite on samsung evo 64gb sdcard.

2nd charger
1625155197015.png


Update .. the throttling shown above happens when I attach a usb tester to the link. It shows fluctuating voltage + current .. Although once I removed it, the vcgencmd shows 0x0 as throttled
 
Last edited:
View attachment 108278

Oneplus dash charger + raspbian lite on samsung evo 64gb sdcard.
Pi 4 on official Raspberry charger. The total runtime on this Pi+charger should be the same as my SSD's On time value. My 32 GB card is still alive and well.

1625154746276.png


BTW I use dietpi which writes system logs to ramlog by default. Saves a lot of writes to the SD card which adds to the life expectancy as well.

1625154991571.png
 
Pi 4 on official Raspberry charger. The total runtime on this Pi+charger should be the same as my SSD's On time value. My 32 GB card is still alive and well.

View attachment 108279

BTW I use dietpi which writes system logs to ramlog by default. Saves a lot of writes to the SD card which adds to the life expectancy as well.

View attachment 108280
Thx. Will try Dietpi. My future usage will include running
- containers ( pihole + cloud scripts )
- SMB for LAN share
- DLNA

Is this overkill for Pi4 or will it be able to handle it ?
 
View attachment 108278

Oneplus dash charger + raspbian lite on samsung evo 64gb sdcard.

2nd charger
View attachment 108281

Update .. the throttling shown above happens when I attach a usb tester to the link. It shows fluctuating voltage + current .. Although once I removed it, the vcgencmd shows 0x0 as throttled
View attachment 108278

Oneplus dash charger + raspbian lite on samsung evo 64gb sdcard.

2nd charger
View attachment 108281

Update .. the throttling shown above happens when I attach a usb tester to the link. It shows fluctuating voltage + current .. Although once I removed it, the vcgencmd shows 0x0 as throttled
Simply put one conclusion could be that the headroom for spikes is very less with the charger. So whenever there is a spike, say high cpu usage, or usb drive usage etc, there are power issues.
Get the original power supply, your issues should be gone. It will also be cheaper than any further testing or equipment purchase.
Thx. Will try Dietpi. My future usage will include running
- containers ( pihole + cloud scripts )
- SMB for LAN share
- DLNA

Is this overkill for Pi4 or will it be able to handle it ?
Apart from DLNA, it should handle rest easily. Pihole and smb both take very little power. I would suggest you install Open Media Vault, it has options for containers, use that for pi hole. OMV is by far the least hassle option for creating a NAS. For rest you can use its containers. And if you want hassle free working, just get another PI. These are cheap and very reliable.

DLNA should depend on whether it involves any re-encoding/decoding. If it does, you can forget it.
 
Simply put one conclusion could be that the headroom for spikes is very less with the charger. So whenever there is a spike, say high cpu usage, or usb drive usage etc, there are power issues.
Get the original power supply, your issues should be gone. It will also be cheaper than any further testing or equipment purchase.

Apart from DLNA, it should handle rest easily. Pihole and smb both take very little power. I would suggest you install Open Media Vault, it has options for containers, use that for pi hole. OMV is by far the least hassle option for creating a NAS. For rest you can use its containers. And if you want hassle free working, just get another PI. These are cheap and very reliable.

DLNA should depend on whether it involves any re-encoding/decoding. If it does, you can forget it.
I think I can skip Dlna. I've an android TV and other having android box. Both have VLC player which can pick up media from SMB.
Will get original power supply.

Have 2 Pi 3B+ running pihole + SMB server.. Need to restructure the entire setup.

Thanks for your inputs.
 

Pi NAS with UPS and display.
The most interesting part was the 18650 cell holder! With integrated bms and ports, use 18650 cells like regular batteries!
 
I think I can skip Dlna. I've an android TV and other having android box. Both have VLC player which can pick up media from SMB.
Will get original power supply.

Have 2 Pi 3B+ running pihole + SMB server.. Need to restructure the entire setup.

Thanks for your inputs.
Yes, I was going to say that, you just need to point those players to SMB share. I too have 2 Pis, one running NAS, other running webservices. I might retire both and get a proper new Proxmox server.
 
I've a waveshare 2.7 display hat .. the kind that mounts itself on all gpio pins.

  1. How can I split the GPIO to connect a servo motor + LEDs simultaneously.
  2. Also where to look / how to check what pins the hat uses ? I'm assuming some of them would be free
 
@codelad @Marcus Fenix

I got the new HDD today and I plugged in to the 2nd USB 3 port of the RPi4 and after reboot, my original external HDD also vanished from the list under drive manager of diet pi. I saw that /etc/fstab, the entry of my original HDD's entry under PHYSICAL DISKS was missing.

So I removed both HDDs and reconnected only the new WD one and it was detected in drive manager as unmounted as expected against /dev/sda1 at which point I could go ahead and reformat it and all.

So now I disconnected everything and reconnected my original HDD but it would not mount so from this thread only, where I had copy pasted my fstab contents, I copied that last line starting with UDID and rebooted Pi and when I got to drive manager, it gets stuck for few minutes at..

Code:
[ INFO ] DietPi-Drive_Manager | Detecting drives, please wait...

and then I get error as

Code:
df: /mnt/seagatehdd: No such device



Is the UUID generated at run time the first time we mount the drive and if I remove the fstab line and reconnect the drive and reboot, the drive should still be detected as a new ext4 drive with contents and it should offer me to mount to a certain location right?
 
@codelad @Marcus Fenix

I got the new HDD today and I plugged in to the 2nd USB 3 port of the RPi4 and after reboot, my original external HDD also vanished from the list under drive manager of diet pi. I saw that /etc/fstab, the entry of my original HDD's entry under PHYSICAL DISKS was missing.

So I removed both HDDs and reconnected only the new WD one and it was detected in drive manager as unmounted as expected against /dev/sda1 at which point I could go ahead and reformat it and all.

So now I disconnected everything and reconnected my original HDD but it would not mount so from this thread only, where I had copy pasted my fstab contents, I copied that last line starting with UDID and rebooted Pi and when I got to drive manager, it gets stuck for few minutes at..

Code:
[ INFO ] DietPi-Drive_Manager | Detecting drives, please wait...

and then I get error as

Code:
df: /mnt/seagatehdd: No such device
You are using a combination of manually editing fstab which has messed up drive_manager. :p

Not an issue as your old drive still has the full data.

Try restarting without any drive connected, clean up the entries in drive_manager and then add the old drive and set it to seagatehdd mountpoint.

Once this is done, attach the new HDD and add it as say/mnt/newhdd.

Then rsync the full /mnt/seagatehdd to /mnt/newhdd.

Once you are done with these steps remove the seagatehdd from drive_manager and reboot.

Then in drive_manager again rename newhdd to seagatehdd and reboot.
 
How do I exactly clean up entries in drive manager? I did refresh inside drive manager and this is how my fstab looks now...

Code:
root@DietPi:~# root@DietPi:~# cat /etc/fstab
# You can use "dietpi-drive_manager" to setup mounts.
# NB: It overwrites and re-creates physical drive mount entries on use.
#----------------------------------------------------------------
# NETWORK
#----------------------------------------------------------------


#----------------------------------------------------------------
# TMPFS
#----------------------------------------------------------------
tmpfs /tmp tmpfs size=1938M,noatime,lazytime,nodev,nosuid,mode=1777
tmpfs /var/log tmpfs size=50M,noatime,lazytime,nodev,nosuid,mode=1777

#----------------------------------------------------------------
# MISC: ecryptfs, vboxsf (VirtualBox shared folder), gluster, bind mounts
#----------------------------------------------------------------


#----------------------------------------------------------------
# SWAP SPACE
#----------------------------------------------------------------


#----------------------------------------------------------------
# PHYSICAL DRIVES
#----------------------------------------------------------------
PARTUUID=9730496b-02 / ext4 noatime,lazytime,rw 0 1
PARTUUID=9730496b-01 /boot vfat noatime,lazytime,rw 0 2
root@DietPi:~#



I did as you said, attached the old HDD again and rebooted the Pi and went to drive manager but that drive isn't being detected at all. I keep doing refresh under drive manager but nothing changes. Also nothing is changed in fstab file.
 
Last edited:
How do I exactly clean up entries in drive manager? I did refresh inside drive manager and this is how my fstab looks now...

Code:
root@DietPi:~# root@DietPi:~# cat /etc/fstab
# You can use "dietpi-drive_manager" to setup mounts.
# NB: It overwrites and re-creates physical drive mount entries on use.
#----------------------------------------------------------------
# NETWORK
#----------------------------------------------------------------


#----------------------------------------------------------------
# TMPFS
#----------------------------------------------------------------
tmpfs /tmp tmpfs size=1938M,noatime,lazytime,nodev,nosuid,mode=1777
tmpfs /var/log tmpfs size=50M,noatime,lazytime,nodev,nosuid,mode=1777

#----------------------------------------------------------------
# MISC: ecryptfs, vboxsf (VirtualBox shared folder), gluster, bind mounts
#----------------------------------------------------------------


#----------------------------------------------------------------
# SWAP SPACE
#----------------------------------------------------------------


#----------------------------------------------------------------
# PHYSICAL DRIVES
#----------------------------------------------------------------
PARTUUID=9730496b-02 / ext4 noatime,lazytime,rw 0 1
PARTUUID=9730496b-01 /boot vfat noatime,lazytime,rw 0 2
root@DietPi:~#



I did as you said, attached the old HDD again and rebooted the Pi and went to drive manager but that drive isn't being detected at all. I keep doing refresh under drive manager but nothing changes.
It seems that your drives are already cleaned up.

This is my fstab
1625555340954.png



The PARTUUID entries are for the SD card partitions.

This one is the external drive and I guess you can copy permissions from here if you want to edit fstab directly but I would suggest you to do it via drive_manager.

UUID=0ec34982-1152-4226-9e39-e4674fa3e5b0 /mnt/usb1 ext4 noatime,lazytime,rw,nofail,noauto,x-systemd.automount

1625555387210.png
 
@Marcus Fenix after editing fstab manually using my own entry (posted on this thread's page 7), the initialization of drive manager get stuck for few minutes and then I get df:/mnt/seagatehdd not found.

It is as if the drive is no longer being recognized at all by the Pi somehow.
 
I did as you said, attached the old HDD again and rebooted the Pi and went to drive manager but that drive isn't being detected at all. I keep doing refresh under drive manager but nothing changes. Also nothing is changed in fstab file.
:( . This is something that will be tricky for me to debug remotely.
This seems like a hail Mary.

Open /boot/config.txt.


You will see a line like this.
1625556746162.png


Enter the following line.

max_usb_current=1

Reboot and run lsusb with the drive attached and paste output here.

1625556831235.png


Then run lsblk and paste the output here.

1625556859561.png
 
Last edited:
Here you go...as you can see the disk attached is not displayed anywhere.

Code:
root@DietPi:~# lsusb
Bus 002 Device 001: ID 1d6b:0003 Linux Foundation 3.0 root hub
Bus 001 Device 002: ID 2109:3431 VIA Labs, Inc. Hub
Bus 001 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub
root@DietPi:~# lsblk
NAME        MAJ:MIN RM  SIZE RO TYPE MOUNTPOINT
mmcblk0     179:0    0 14.9G  0 disk
├─mmcblk0p1 179:1    0  256M  0 part /boot
└─mmcblk0p2 179:2    0 14.6G  0 part /
root@DietPi:~#
In order to attempt and read the contents of the HDD, on my windows laptop, when I attach the HDD, it obviously does not show under explorer due to its format but even under disk management it does not show up. But I can eject the drive from task bar right side small USB icon.

But if I don't do anything, it automatically get ejected after few minutes. I even downloaded couple of tools for windows 10 that supposedly can read ext4 but those don't work and drive doesn't show up.
 
Last edited:
Here you go...as you can see the disk attached is not displayed anywhere.

Code:
root@DietPi:~# lsusb
Bus 002 Device 001: ID 1d6b:0003 Linux Foundation 3.0 root hub
Bus 001 Device 002: ID 2109:3431 VIA Labs, Inc. Hub
Bus 001 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub
root@DietPi:~# lsblk
NAME        MAJ:MIN RM  SIZE RO TYPE MOUNTPOINT
mmcblk0     179:0    0 14.9G  0 disk
├─mmcblk0p1 179:1    0  256M  0 part /boot
└─mmcblk0p2 179:2    0 14.6G  0 part /
root@DietPi:~#
In order to attempt and read the contents of the HDD, on my windows laptop, when I attach the HDD, it obviously does not show under explorer due to its format but even under disk management it does not show up. But I can eject the drive from task bar right side small USB icon.

But if I don't do anything, it automatically get ejected after few minutes. I even downloaded couple of tools for windows 10 that supposedly can read ext4 but those don't work and drive doesn't show up.
Check under Device Manager if the drive shows up in Windows. If yes then the drive is okay.

Then you can restart from scratch i.e. format the drive to FAT32 from Windows. Then attach to Pi, boot Pi up and check if it shows up there.

If it doesn't show up set max usb current parameter.

If all is good then you can format the drive to ext4,mount it and copy your stuff over.
 
Back
Top