PADD icon indicating copy to clipboard operation
PADD copied to clipboard

PADD 3.8.0 display error with 3.5" PiTFT

Open Falconcrest opened this issue 1 year ago • 36 comments

After the update to padd 3.8.0 at least the first line above with the details of the versions of pihole, web and padd is missing.

Falconcrest avatar Jul 27 '22 04:07 Falconcrest

Is there some real error message shown? Or only the misalignment? Could you add a screenshot or photo?

yubiuser avatar Jul 27 '22 04:07 yubiuser

only the misalignment without real error message.

Pic

Sorry for the bad quality.

Falconcrest avatar Jul 27 '22 05:07 Falconcrest

Same issue here with a Hyperpixel 4 display

IMG_4433

cmdshft avatar Jul 27 '22 05:07 cmdshft

Thanks I think I know where this is coming from. It's probably due to the two new lines adding model and inteface.

yubiuser avatar Jul 27 '22 06:07 yubiuser

Maybe you can correct something there so that it fits again.

Falconcrest avatar Jul 27 '22 06:07 Falconcrest

What do you want me to remove instead?

yubiuser avatar Jul 27 '22 06:07 yubiuser

Please run stty size and post the output. I need to see how big the terminal is.

yubiuser avatar Jul 27 '22 06:07 yubiuser

Everything above 79x25 is considered mega so far and assumed there are enough lines https://github.com/pi-hole/PADD/blob/380636a96ac5a7f76291d994b901879709b9af4f/padd.sh#L926

yubiuser avatar Jul 27 '22 07:07 yubiuser

Bildschirmfoto zu 2022-07-27 09-11-47

26 - 27 - 28 in a row. I think we should go for 28.

yubiuser avatar Jul 27 '22 07:07 yubiuser

tiny and mini are broken as well.

yubiuser avatar Jul 27 '22 07:07 yubiuser

root@pihole:~# stty size 59 183

Falconcrest avatar Jul 27 '22 07:07 Falconcrest

And tput cols and tput lines

yubiuser avatar Jul 27 '22 07:07 yubiuser

root@pihole:~# tput cols 183 root@pihole:~# tput lines 59

Falconcrest avatar Jul 27 '22 07:07 Falconcrest

But then it should easily fit...

https://github.com/pi-hole/PADD/blob/380636a96ac5a7f76291d994b901879709b9af4f/padd.sh#L1108-L1109

So we get console_width=183 and console_height=59 wich passes https://github.com/pi-hole/PADD/blob/380636a96ac5a7f76291d994b901879709b9af4f/padd.sh#L926-L934

And we should get size mega

yubiuser avatar Jul 27 '22 07:07 yubiuser

I compared it, the code is identical, but what can I say, 1 line is missing at the top.

Falconcrest avatar Jul 27 '22 07:07 Falconcrest

Is there a solution? Thanks a lot for your efforts!

Falconcrest avatar Jul 27 '22 10:07 Falconcrest

I haven't figured out one yet. I don't know why it does not fit, although there are enough lines. The trivial solution would be to remove newly added lines. In the next few days I won't have time to work on this. In the meantime you could just use the previous version.

yubiuser avatar Jul 27 '22 10:07 yubiuser

OK, we will wait, thanks! Sorry, by the way there are 2 lines that are not displayed when I look very closely...26 lines are displayed in version 3.7.1.

Falconcrest avatar Jul 27 '22 11:07 Falconcrest

I have a PiTFT 3.5" and have the exact same issue with the line being cut off. Went back to previous (also because of other bug).

For reference, since the values are different than previous user.

pi@pihole:~ $ tput cols 364 pi@pihole:~ $ tput lines 89

nineteenletterslong avatar Aug 01 '22 14:08 nineteenletterslong

What do you want me to remove instead?

The logical things to remove would be the two new items. For now I'm sticking with 3.7.1, so same difference, for me.

EdmundGerber avatar Aug 01 '22 16:08 EdmundGerber

Possibly split some information out a tab or two instead of having separate lines, if possible.

nineteenletterslong avatar Aug 02 '22 12:08 nineteenletterslong

fix coming soon?

cmdshft avatar Aug 19 '22 00:08 cmdshft

@Falconcrest

root@pihole:# tput cols 183 root@pihole:# tput lines 59

@nineteenletterslong

pi@pihole:~ $ tput cols 364 pi@pihole:~ $ tput lines 89


I spend some thoughts on this today and I think I know why the numbers are so high: did you run those commands in a terminal connected via ssh to your RPi? They certainly reflect the size of your terminal on your device accessing the Pi, but not the terminal displayed at your RPi display. Could you run those commands directly on the Pi so we get the numbers from the actual Pi dispaly?

yubiuser avatar Aug 19 '22 15:08 yubiuser

Great point!

Just plugged a keyboard in and ran it on the pi (again, PiTFT 3.5")

pi@pihole:~ $ tput cols 80 pi@pihole:~ $ tput lines 26

nineteenletterslong avatar Aug 19 '22 15:08 nineteenletterslong

Thanks, this looks reasonable.

yubiuser avatar Aug 19 '22 15:08 yubiuser

I would confirm the information from @nineteenletterslong. In the absence of a currently unavailable keyboard, I counted. ;-)

Falconcrest avatar Aug 19 '22 16:08 Falconcrest

I fixed the issue. In "mini", IP is now shown next to hostname. In "tiny" I had to sacrifice the IPv6 address. In "regular" and "slim" I removed the device model and IPv6 address but added an IPv6 checkbox. In "mega" I combined DNS with the DHCP section. Bildschirmfoto zu 2022-08-20 09-53-20 Bildschirmfoto zu 2022-08-20 10-02-10 Bildschirmfoto zu 2022-08-20 12-13-41 Bildschirmfoto zu 2022-08-20 12-14-24 Bildschirmfoto zu 2022-08-20 19-07-45


Testing and feedback welcome. You can find this version at

https://raw.githubusercontent.com/pi-hole/PADD/0b4351c3adf2069d63a7b2c0cba890ab165802d1/padd.sh


P.S. The red "DNSSEC" on "mega" is fixed already

yubiuser avatar Aug 20 '22 17:08 yubiuser

It works! A very, very good job! Thank you, it was worth the wait.

Falconcrest avatar Aug 20 '22 18:08 Falconcrest

Works great, still have red DNSSEC though but thanks for your efforts

also you probably should probably put a space after the DHCP title line to keep it in accordance with how the other lines are. Maybe put a few spaces before it to make it look a little more separate from DNS, or whatever you feel like

nineteenletterslong avatar Aug 20 '22 22:08 nineteenletterslong

In small screens you can combine a shorter uptime text and cpu temp on a single line.

To get a shorter uptime you can use:

system_uptime=$(awk '{print int($1/86400)"d:"int(($1%86400)/3600)"h:"int(($1%3600)/60)"min"}' '/proc/uptime')

It will return something like this: 5d:13h:41min

You can use an even shorter string using:

system_uptime=$(awk '{print int($1/86400)"d:"int(($1%86400)/3600)"h"}' '/proc/uptime')

5d:13h

rdwebdesign avatar Aug 21 '22 04:08 rdwebdesign