Pihole & PADD

Having issues with your DietPi installation, or, found a bug? Post it here.
Post Reply
co2
Posts: 4
Joined: Mon Mar 05, 2018 8:34 pm

Pihole & PADD

Post by co2 »

I'm trying to get PADD up and running on my install
Padd is an expanded version of piholes chronometer
It's a script and on lite installs of buster I was able to get it running almost like it ran on a separate terminal on the LCD than my ssh sessions.

I like dietpi but I'm stuck at a impass at the moment trying to get this script to load on reboot... I tried the autorun script and putting it there but it still doesn't load.
User avatar
MichaIng
Site Admin
Posts: 2333
Joined: Sat Nov 18, 2017 6:21 pm

Re: Pihole & PADD

Post by MichaIng »

@co2
Cool, I like such shell scripts, simple and effective :). We might want to add this as an install option :?.

Sadly is has no internal update loop, which would be very easy to implement, so running the script with certain argument would have it running as foreground process, updating the view every N seconds, or such.

However for now the following should do:

Code: Select all

wget https://raw.githubusercontent.com/jpmck/PADD/master/padd.sh -O /mnt/dietpi_userdata/padd.sh
chmod +x /mnt/dietpi_userdata/padd.sh
echo 'while :; do /mnt/dietpi_userdata/padd.sh; sleep 1; done' > /var/lib/dietpi/postboot.d/padd
With this, there is not even a login required on the main console. The loop starts as part of the boot scripts, when hitting CTRL+C it exits and you'll see the login prompt. SSH connections are not affected by this of course.

If this works fine, I'll see if I can contribute the script internal loop to this project and add it as install option along with or aside of Pi-hole.
co2
Posts: 4
Joined: Mon Mar 05, 2018 8:34 pm

Re: Pihole & PADD

Post by co2 »

no dice boss, my LCD screen show booting process stops at

[ OK ] Started LSB: Lightweight SSH server.


which it did before,

login in via SSH shows:

Waiting for DietPi-Postboot to finish... (Press CTRL+C to abort)

as for updating PADD normally on the LCD if the system is rebooted it checks to see if the version is upto date


---

I did a writeup on how I managed to get PADD working on my waveshare about a year ago but dietpi seems to work sightly differently https://redd.it/8gkgj1
co2
Posts: 4
Joined: Mon Mar 05, 2018 8:34 pm

Re: Pihole & PADD

Post by co2 »

if i go to the directory '/mnt/dietpi_userdata/' in my ssh term i can launch the padd.sh by typing: ./padd.sh

but my waveshare screen doesnt seem to pass
[ OK ] started LSB: Lightweight SSH Server

would there be a way to get the script to launch on the waveshare?

I did follow the waveshare 'fix' that JSmith717 posted to get the screen to work so i'm not sure if that affects anything.

viewtopic.php?f=15&p=21179#p21179
User avatar
MichaIng
Site Admin
Posts: 2333
Joined: Sat Nov 18, 2017 6:21 pm

Re: Pihole & PADD

Post by MichaIng »

@co2
Ah yeah I didn't think about dietpi-postboot needs to finish, to allow further logins, hence postboot.d is not useful for background jobs, only for oneshot scripts. Sorry for this wrong suggestion :roll:.

Okay then dietpi-autostart > 14 : Custom should do it. Move your script to /var/lib/dietpi/dietpi-autostart/custom.sh then:

Code: Select all

mv /var/lib/dietpi/postboot.d/padd /var/lib/dietpi/dietpi-autostart/custom.sh
This runs independantly from login as well.

But most elegant way is to create an own systemd unit:

Code: Select all

cat << _EOF_ > /etc/systemd/system/padd.service
[Unit]
Description=PADD
Requisite=pihole-FTL.service
After=pihole-FTL.service dietpi-postboot.service getty@tty1.servicce rc-local.service

[Service]
StandardOutput=tty
ExecStart=/bin/dash -c 'while :; do /mnt/dietpi_userdata/padd.sh; sleep 1; done'

[Install]
WantedBy=multi-user.target
_EOF_
systemctl daemon-reload
systemctl enable padda
rm /var/lib/dietpi/postboot.d/padd
This should do it and would be how we'd implement it into dietpi-software.
The "After=.." part is only to assure that Pi-hole is up already and that the chance for other idle service output mess is minimised (login prompt, service starts, ...)

Okay but if Waveshare does not show anything after Dropbear launch, then it seems to be not default tty1... Do you have a second monitor attached? If with above systemd unit it is the same, then we'd need to find out which tty is attached to waveshare and what is attached to tty1. E.g. from SSH, run ps a to show all processes + the TTYs they're attached to.
asm1
Posts: 1
Joined: Sun Mar 29, 2020 1:29 pm

Re: Pihole & PADD

Post by asm1 »

Been poking around with this.
Now have it working fine on a 5" Waveshare HDMI LCD in latest 6.29 Diet-pi beta :)
FYI theres a typo in

Code: Select all

systemctl enable padda
I copied and pasted 4X wondering why it would not work lol.

Theres also a "Touchscreen" alternative - PHAD, which is based on PADD but with more info and cycles through screens - also -COLOURS :P :P . (Not mine, am a user rather than a Creator)

its a bit more complicated to install, but I have had it working also. Will try it using this cleaner install method.

Pi-hole Alternative Display
https://github.com/bpennypacker/phad - not sure if actively being developed which is a shame.
Post Reply