Less than ideal Failure of Pi-Hole Kit (Please authorize Replacement)

Please tell us which board you are using.
For CircuitPython issues, ask in the Adafruit CircuitPython forum.

Moderators: adafruit_support_bill, adafruit

Please be positive and constructive with your questions and comments.
Post Reply
User avatar
stopaskingmeforausername
 
Posts: 6
Joined: Sun Mar 24, 2024 8:21 pm

Less than ideal Failure of Pi-Hole Kit (Please authorize Replacement)

Post by stopaskingmeforausername »

Hello Adafruit support team, I hope you had a nice weekend. I hope this is the right place for this post I wasn't sure if my product is technically an "Itsy bitsy board" or not... please feel free to move this thread if it's in the wrong place.

My wife recently (within last 1-2 weeks or so...) purchased this product to use as a pi-hole DNS server (https://www.adafruit.com/product/3973) and I finally got around to setting it up over the weekend.

Order number; 3255139

I was actually able to get it working using your guide and got the LED display working as well. It was great, couldn't have been happier with it.

Unfortunately, after a few hours, the system just... turned off and now it won't turn back on. Regardless of whether it's plugged in, no green light and no response from SSH. It seems to have just... died... None of my other electronics connected to the same power brick had any problems. I can't really explain what caused the failure.

Even stranger, I reassembled the mini SD card into it's holder and plugged it back in to see if my configurations could be saved (and I wouldn't have to do all that work again...) but it won't read any more... it wasn't erased or made blank... it seems to be completely fried or something.. My computer can no longer see it, I've never seen that happen before.

I can't really explain it but my particular unit seems to have failed completely. I'm new to this but i'm about 99.99% sure that the product is defective and I would really just like a replacement sent out to the same address.

Attached are three pictures, one showing the back of the unit, one showing the front, and one showing it plugged into the included power supply but with no green activation light. Unfortunately I cannot provide any more information or pictures of the error in question because the unit won't turn on so there's really not much else to say.

Thank you in advance for your time. I would be perfectly happy to just have a replacement unit authorized/sent out and then forget this ever happened. Thank you~!

Image

Image

Image

User avatar
adafruit_support_mike
 
Posts: 67504
Joined: Thu Feb 11, 2010 2:51 pm

Re: Less than ideal Failure of Pi-Hole Kit (Please authorize Replacement)

Post by adafruit_support_mike »

The RasPi Zero doesn't have any kind of power LED, so a working one looks exactly the same as a dead one.

Try this test to see if you can get any response from the microprocessor:

https://learn.adafruit.com/raspberry-pi ... -zero-dead

If so, try booting from a fresh install of Raspbian on a new SD card.

All versions of the RasPi are known to be vulnerable to SD corruption if the board loses power without doing a graceful shutdown. It's a side effect of the way computers interact with bulk storage devices.

All forms of mass storage are glacially slow as far as today's microprocessors are concerned. The CPU runs at a couple of gigahertz while the devices can take tens of milliseconds to load new data into memory. If the CPU actually stopped and waited for the information to load, just booting a computer would take hours or days.

To prevent that, computers use a process called 'caching'. The system loads data from the long-term storage device into RAM, which is much faster. Today's computers use two or three layers of RAM, each faster and closer to the CPU than the previous one.

The trick to making it all work is to operate statistically. If the CPU wants a 1kB file, the memory management system might load a 4MB chunk of data into RAM. The idea is that the next file the CPU wants is likely to be near the last one it asked for. Many OSes shuffle their files to make that even more likely to happen. If the CPU does ask for something already in RAM, that request will take much less time than one that had to go all the way to the external storage.

The 4MB chunks the OS reads are physically contiguous regions of device storage. The cache system doesn't care if the region contains complete files, and in most cases it won't. Most external storage breaks files into uniform chunks (maybe 4k each) and stores larger files as lists of those chunks.

If a chunk of the disk has been copied to RAM, the OS will read and modify the information in RAM rather than taking the time to write the changes all the way back to the external storage. And that's where the problems start: if the latest changes in RAM haven't been written back to the external storage array, the external storage can become inconsistent.

Memory managers deal with that problem by keeping track of data in RAM that's out of sync with external storage, and doing writes every 500ms or so. Ideally the physical storage will never be out of sync with the latest data in RAM for more than a few seconds.

When the computer shuts down gracefully, most of the effort involves writing all the changes in RAM back to the external storage and making sure what's in the external store is logically self-consistent. If the computer loses power before that can happen, you're likely to end up with a corrupted physical store: things that should have been deleted are still there, lists of blocks that contain files point to sections of the store that don't have the data they should, etc.

SD cards are extremely slow when it comes to writing data, and they have no buffer to hold information that needs to be written to the storage array. As a result, RasPi OS cards frequently get corrupted by loss of power.

User avatar
stopaskingmeforausername
 
Posts: 6
Joined: Sun Mar 24, 2024 8:21 pm

Re: Less than ideal Failure of Pi-Hole Kit (Please authorize Replacement)

Post by stopaskingmeforausername »

Understood, running test now.

You're right, it's still working. Do I just replace the card and try again?

User avatar
adafruit_support_mike
 
Posts: 67504
Joined: Thu Feb 11, 2010 2:51 pm

Re: Less than ideal Failure of Pi-Hole Kit (Please authorize Replacement)

Post by adafruit_support_mike »

Try it at least. If the RasPi runs, you should be able to set it up as a PiHole again.

It's probably worth checking the location where the RasPi was plugged in and the power supply that you used to see if there any other signs of brownouts or dropped voltage. It usually takes repeated dropouts to mess up an SD card to the point where it will no longer boot.

User avatar
stopaskingmeforausername
 
Posts: 6
Joined: Sun Mar 24, 2024 8:21 pm

Re: Less than ideal Failure of Pi-Hole Kit (Please authorize Replacement)

Post by stopaskingmeforausername »

Can you let me know the proper way to shut down the Pi-Hole? I haven't seen that mentioned anywhere. Is there a Putty command or something?

User avatar
blakebr
 
Posts: 991
Joined: Tue Apr 17, 2012 6:23 pm

Re: Less than ideal Failure of Pi-Hole Kit (Please authorize Replacement)

Post by blakebr »

Hi,

From Putty, login.
Type “sudo halt” (without the “” )
Hit return
Wait for green LED on Raspberry Pi to stop flashing and turn off. A few seconds.
The system is down and power can be turned off.

Bruce

User avatar
adafruit_support_mike
 
Posts: 67504
Joined: Thu Feb 11, 2010 2:51 pm

Re: Less than ideal Failure of Pi-Hole Kit (Please authorize Replacement)

Post by adafruit_support_mike »

The command I use is :

shutdown -h now

The -h option means 'halt': do an orderly shutdown and stop when the computer is in a state where you can safely disconnect power. There are several other options, like -r (reboot), -s (sleep), and -k (kickout: forcibly log out all accounts except root and disable logins).

The 'now' item is simple, but you can also give yourself some breathing room with values like +30m (half an hour from now). Those tend to be more useful on multiuser systems (do `shutdown -r +30m` then send out a message to tell everyone the server will shut down in half an hour), but there are cases where it can be handy to give yourself a bit of time.

User avatar
stopaskingmeforausername
 
Posts: 6
Joined: Sun Mar 24, 2024 8:21 pm

Re: Less than ideal Failure of Pi-Hole Kit (Please authorize Replacement)

Post by stopaskingmeforausername »

Thanks for the help everyone, a few other things;

I modified rc.local as suggested but it doesn't seem like the stats.py file is actually running on boot? Anybody know what I did wrong here?

Image

I think I have everything set up correctly to work with that... (shown below...)

Image
Image

This seems like a really important step because otherwise I have to have Putty open and be actively running the command to have the stats up which kind of defeats the whole purpose.

Can anyone help me figure out what i'm doing wrong and why it's not running on boot?

User avatar
stopaskingmeforausername
 
Posts: 6
Joined: Sun Mar 24, 2024 8:21 pm

Re: Less than ideal Failure of Pi-Hole Kit (Please authorize Replacement)

Post by stopaskingmeforausername »

Alright, now I got that working and now there's one last issue. It doesn't seem like the stats are actually updating on the display until I reboot or re-run stats.py?

Is there some way for me to tell the system to update the stats displayed on screen at each refresh? Any help is much appreciated.

User avatar
adafruit_support_mike
 
Posts: 67504
Joined: Thu Feb 11, 2010 2:51 pm

Re: Less than ideal Failure of Pi-Hole Kit (Please authorize Replacement)

Post by adafruit_support_mike »

For the sake of putting the answer in the same thread as the question: Raspbian has decided it doesn't like rc.local any more. Instead it uses a dependency management system called 'systemd'.

Opinions on that are mixed. Systemd makes extremely complex things possible at the cost of making simple things difficult. The older rc.local technique is much less powerful, but makes simple things easy. Unfortunately systemd wants complete control over all launching and setup operations, so it won't let rc.local run by default. Officially you have to create a startup script for stats.py and install it as part of systemd's startup process for the system as a whole.
stopaskingmeforausername wrote: Sun Mar 31, 2024 6:58 pm Alright, now I got that working and now there's one last issue. It doesn't seem like the stats are actually updating on the display until I reboot or re-run stats.py?

Is there some way for me to tell the system to update the stats displayed on screen at each refresh? Any help is much appreciated.
The code from the tutorial loops continuously, so you may have something like a network problem.

Try throwing some diagnostic print() statements in the part of the code that collects the data:

Code: Select all

    # Pi Hole data!
    try:
        r = requests.get(api_url)
        data = json.loads(r.text)
        DNSQUERIES = data['dns_queries_today']
        ADSBLOCKED = data['ads_blocked_today']
        CLIENTS = data['unique_clients']
    except KeyError:
        time.sleep(1)
        continue
If you see it constantly looping in the except: clause, it means you're getting some kind of connection error.

User avatar
stopaskingmeforausername
 
Posts: 6
Joined: Sun Mar 24, 2024 8:21 pm

Re: Less than ideal Failure of Pi-Hole Kit (Please authorize Replacement)

Post by stopaskingmeforausername »

HI there, I got it all working. Thakn you!

User avatar
adafruit_support_mike
 
Posts: 67504
Joined: Thu Feb 11, 2010 2:51 pm

Re: Less than ideal Failure of Pi-Hole Kit (Please authorize Replacement)

Post by adafruit_support_mike »

Glad to hear it. Happy hacking!

Post Reply
Please be positive and constructive with your questions and comments.

Return to “Itsy Bitsy Boards”