Raspberry pi goes offline after 1-2 hours reddit / selfhosted ---------------------------------------------------------------------- ConcentrateMean8750 · 2023-12-11 05:37 hey everyone i am new to all this self host think i just wanna know whay my raspberry pi goes offline after couple of hours and i am unable to ssh,vnc or acess the web pannel i am hosting a adguard home and a pro ftp server and confegured so that the pi has a static ip pls help thanks ---------------------------------------------------------------------- eattherichnow · 2023-12-11 05:55 AFAIR raspbian would come with defaults that would disable the wifi controller after a long period of inactivity. This generally sounds like a power management issue. But before you go on a great quest of debugging like I did, make sure the answer won’t be the same and check the power plug, both at the wall and at the RPi. Twice. ---------------------------------------------------------------------- ConcentrateMean8750 · 2023-12-11 05:57 Checked the plugs I can see the pi powered even after I am not able to ssh into it ---------------------------------------------------------------------- austozi · 2023-12-11 07:17 See if this helps: https://www.reddit.com/r/selfhosted/comments/pkeqh7 /raspberry_pi_4_randomly_dropping_wired_network/ ---------------------------------------------------------------------- eattherichnow · 2023-12-11 07:18 Then my bet is the network interface getting powered down by power management - though it seems that default was [changed a while ago](https://raspberrypi.stackexchange.com/questions/96606/make-iw- wlan0-set-power-save-off-permanent#96644)? Anyway that’s where I’d look first. ---------------------------------------------------------------------- ConcentrateMean8750 · 2023-12-11 07:48 i did that but now the server seems to be online but very slow ssh and the pro ftp is running but the error i recive is "timed out wating to for inital connection reply" and the adguard home web portal shows that the connection was refused but after 5-6 reloads it boots into the webportal but dosent show anyinfo just keeps loading ---------------------------------------------------------------------- eattherichnow · 2023-12-11 07:54 That sounds like some firewall issues - a bit beyond what I’d try to troubleshoot for a stranger on Reddit, sorry 😅 ---------------------------------------------------------------------- ConcentrateMean8750 · 2023-12-11 07:58 damm brother , thanks for you help but can you tell me how can i find were the logs are saved ---------------------------------------------------------------------- eattherichnow · 2023-12-11 08:11 1. Not a brother. 2. /var/log though some applications may have their own setups. Check the man pages for journalctl in particular. Check the docs of the particular bits of software as well - they may have their own logging setups, locations (likely also under /var/log) and configuration. They might even not be saving logs unless you set them up to do so. ---------------------------------------------------------------------- arcadianarcadian · 2023-12-11 10:31 This subreddit is not the right place to ask this question but; \- Wired or wireless connection? \- How do you power Raspberry? \- Did you check any logs, what do logs say? ---------------------------------------------------------------------- IWishIHavent · 2023-12-11 11:08 You should check the Raspberry Pi sub. If you post there, please provide more information, such as: * How is the RPi powered? * What kind of storage are you using? * Do the storage have it's own power source? * Are you able to connect the RPi to a screen directly and see if there's something there? * Are you using any kind of logger that could keep track of the system? ---------------------------------------------------------------------- DrOop104 · 2023-12-11 12:17 I had a somewhat similar issue back in november with the rPi 3 that I have after making a fresh install, I couldn't get to access the pi in any way via ssh after sometime. Looking at the logs, these 3 lines were always there moments before I started having issues to connect to the pi: `Nov 17 13:25:56 raspberrypi avahi-daemon[392]: Withdrawing address record for 192.168.20.3 on eth0.Nov 17 13:25:56 raspberrypi avahi- daemon[392]: Leaving mDNS multicast group on interface eth0.IPv4 with address 192.168.20.3.Nov 17 13:25:56 raspberrypi avahi-daemon[392]: Interface eth0.IPv4 no longer relevant for mDNS.` Since I don't use in any way what the avahi-daemon service was providing, I didn't bother to investigate further on why this was happening and just removed the package "avahi-daemon" and so far it's working fine now. ---------------------------------------------------------------------- ConcentrateMean8750 · 2023-12-11 12:30 Wireless Via a 5v ac to dc adaptor Doing rn ---------------------------------------------------------------------- arcadianarcadian · 2023-12-11 12:37 Be sure your wireless does not go to "sleep". ​ [https://forums.raspberrypi.com/viewtopic.php?t=98293](https://forums. raspberrypi.com/viewtopic.php?t=98293) [https://raspberrypi.stackexchange.com/questions/47087/raspberry- pi-3-wifi-goes-to-sleep](https://raspberrypi.stackexchange.com/questio ns/47087/raspberry-pi-3-wifi-goes-to-sleep) ---------------------------------------------------------------------- Spare_Vermicelli · 2023-12-11 12:53 Hi, i had the same issue. For me setting the static IP like this helped: sudo vim /etc/dhcpcd.conf \# Example static IP configuration: interface eth0 static ip\_address=192.168.0.106/24 \#static ip6\_address=fd51:42f8:caae:d92e::ff/64 static routers=192.168.0.1 static domain\_name\_servers=192.168.0.1 1.1.1.1 But I also have the "backup" script that checks if the eth0 is up. ​ pi@rpi4:\~/scripts $ cat eth0\_up.sh \#!/bin/bash LOGFILE=/home/pi/scripts/eth0\_up.log ## This is where the messages are stored if ifconfig eth0 | grep -q "inet 192.168.0.106" then if \[ -e tc \] ## This checks for the exisitence of a file call 'tc', if not there then leave the script then rm tc ## If the file is there, remove it to prevent more "up" messages echo "$(date "+%m %d %Y %T") : Ethernet OK" >> $LOGFILE fi else touch tc ## generate the file tc to prevent multiple "Ethernet Up" messages echo "$(date "+%m %d %Y %T") : Ethernet connection down! Attempting reconnection." >> $LOGFILE ifup --force eth0 OUT=$? #save exit status of last command to decide what to do next if $OUT -eq 0 then STATE=$(ifconfig eth0 | grep "inet 192.168.0.106") echo "$(date "+%m %d %Y %T") : Network connection reset. Current state is" $STATE >> $LOGFILE else echo "$(date "+%m %d %Y %T") : Failed to reset ethernet connection" >> $LOGFILE fi fi \`\`\` running under root in cron: sudo -i crobtab -e \*/5 \* \* \* \* root bash /home/pi/scripts/eth0\_up.sh ​ sources: https://samhobbs.co.uk/2013/11/fix-ethernet-connection-drop-raspberry- pi https://www.reddit.com/r/selfhosted/comments/pkeqh7/raspberry\_pi\_4\_ randomly\_dropping\_wired\_network/ https://pimylifeup.com/raspberry-pi-static-ip-address ---------------------------------------------------------------------- joost00719 · 2023-12-11 14:11 I had the same with a hp prodesk computer. Turns out it was a power management issue which shut down the pc. My guess that you have a similar issue but with the Pi. However I have no clue how to fix it ---------------------------------------------------------------------- bmaeser · 2023-12-11 15:03 try changeing usb charger you use to power your rpi, it might be broken (make sure your charger delivers the right voltage and amps too) your sd card might be corrupted or broken. try a fresh install on another one. source: both of these things happened to me, resulting in the pi just power down 'randomly' ---------------------------------------------------------------------- CanWeTalkEth · 2023-12-11 17:07 USB cable being poor quality or the SD card failing are usually the source of my issues when I’m doing fairly uncomplicated things that should just work. ---------------------------------------------------------------------- ConcentrateMean8750 · 2023-12-11 17:25 Did that already but still same problem and now it is saying unreachable ---------------------------------------------------------------------- arcadianarcadian · 2023-12-11 22:23 Another problem might be the DHCP client on OS. I was having the same problems 2 years ago. The problem was AppArmor. I whitelisted the DHCP client on Apparmor. ​ Actually, you can't solve/understand problems by asking, you have to give some clues. Logs may help. You should look for the logs. ---------------------------------------------------------------------- KoppleForce · 2023-12-11 22:50 When I was setting up my first pi I had this problem. Turns out I was not even running as headless and it was running X and going to sleep after a time. You mentioned VNC, which is a graphical way of managing things right? I would plug it into a monitor and see if it’s loading the desktop. ---------------------------------------------------------------------- marvelish · 2023-12-12 00:34 I had the same problem with my RPi. I thought I bought a dud my problem: My USB HDD I had connected to it was interfering with the wifi on the 2.4ghz band. Now when I connect via 5ghz or wired connection the RPi is solid as a rock.