lrhorer
Posts: 54
Joined: Sun Feb 22, 2015 6:35 pm

New Problem in chromium

Sat May 25, 2019 12:18 pm

I am having a weird screen issue that was not there before. I don't know why it was OK before, why it has popped up, or how to fix it. It most likely has to do with some issue I created while reducing the writes to disk in an attempt to extend the life of the SD card. Prior to this, the screen was perfect, nicely centered with no scroll bars and about 10 pixels of space on all four sides of the screen. Now the page comes up either with a large whitespace to the right and bottom, or else no whitespace but with scrollbars. Using the mouse-wheel, the screen shows up at either 90% or 100%, switching between the two states. (In production, there will be no mouse attached to the device.) The files below include some attempts to fix the issue, to no avail. The display has a physical resolution of 800 x 480.

/home/pi/.config/lxsession/LXDE-piautostart:

@lxpanel --profile LXDE-pi
@pcmanfm --desktop --profile LXDE-pi
@xscreensaver -no-splash
@point-rpi
@/bin/sed -i 's/"exited_cleanly":false/"exited_cleanly":true/' ~/.config/chromium/Default/Preferences
@/bin/sed -i ‘s/”exit_type”: “Crashed”/”exit_type”: “Normal”/’ ~/.config/chromium/Default/Preferences
@/usr/bin/chromium-browser --kiosk --window-size=800,480 --start-fullscreen --app=http://localhost/cgi-bin/index.cgi


/usr/lib/cgi-bin/index.cgi:

#! /bin/bash
echo 'Content-type: text/html'
echo ""
cat index.txt
echo '<div class="Out">'
if test $(find Data/ -cmin -5 -name outsideT)
then
cat Data/outsideT
else
echo "----"
fi
echo '&#8457;</div>'
echo '<div class="In">'
/usr/local/sbin/Temperature
echo '&#8457;</div>'
echo '<div class="Press">'
/usr/local/sbin/Pressure
echo 'inHg</div>'
echo '<div class="Time">'
date +%R
echo '</div>'
echo '<div class="Date">'
echo $( date +%a ) $( date +%b%e )
echo '</div>'
echo '<div class="Hostname">'
hostname
echo '</div>'
echo '<div class="Scale">'
echo '&#8457;'
echo '</div>'
echo '<div class="Clock">'
echo '24 hr'
echo '</div>'
echo '<div class="Barometer">'
echo 'inHg'
echo '</div>'
echo '<div class="Server">'
echo 'Master'
echo '</div>'
echo '<div class="Reboot">'
echo '<a href="/cgi-bin/reboot.cgi" class="button">Reboot</a>'
echo '</div>'
echo '<div class="Setup">'
echo '<a href="/cgi-bin/setup.cgi" class="button">Setup</a>'
echo '</div>'
echo '</body></html>'


/usr/lib/cgi-bin/index.txt:

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<html>
<head>
<title> Thermostat </title>
<meta name="Generator" cintent="EditPlus">
<meta name="Author" content="Leslie Rhorer">
<meta http-equiv="refresh" content="30" />
<style>
div.OutText {
position: fixed;
top: 26;
left: 480;
width: 300px;
font: bold 24px Arial;
color: white;
}
div.InText {
position: fixed;
top: 195;
left: 130;
width: 400px;
font: bold 33px Arial;
color: rgb(0,44,255);
}
div.PressText {
position: fixed;
top: 375;
left: 565;
width: 250px;
font: 21px Arial;
color: rgb(50,44,55);
}
div.Hostname {
position: fixed;
top: 164;
left: 520;
width: 150px;
font: bold 15px Arial;
color: black;
}
div.Out {
position: fixed;
top: 45;
left: 510;
width: 300px;
font: bold 65px Lora;
color: white;
}
div.In {
position: fixed;
top: 217;
left: 127;
width: 400px;
font: bold 108px Lora;
color: rgb(0,44,255);
}
div.Press {
position: fixed;
top: 400;
left: 585;
width: 250px;
font: bold 29px Bookman;
color: rgb(50,50,50);
}
div.Time {
position: fixed;
top: 42;
left: 182;
width: 250px;
font: Bold 90px Arial Bold;
color: rgb(255,0,0);
}
div.Date {
position: fixed;
top: 245;
left: 490;
width: 250px;
font: Bold 45px Arial Bold;
color: rgb(0,150,0);
}
div.Scale {
position: fixed;
top: 65;
left: 30;
width: 100px;
font: 20px Arial Bold;
color: rgb(200,200,200);
}
div.Clock {
position: fixed;
top: 95;
left: 30;
width: 100px;
font: 20px Arial Bold;
color: rgb(200,200,200);
}
div.Barometer {
position: fixed;
top: 125;
left: 30;
width: 100px;
font: 20px Arial Bold;
color: rgb(200,200,200);
}
div.Server {
position: fixed;
top: 155;
left: 30;
width: 100px;
font: 20px Arial Bold;
color: rgb(200,200,200);
}
div.Reboot {
position: fixed;
top: 434;
left: 21;
}
div.Setup {
position: fixed;
top: 434;
left: 91;
}
.button {
background-color: #05B808;
border-radius: 15px;
padding: 5px 10px;
text-align: center;
text-decoration: none;
display: inline-block;
font-size: 15px;
margin: 2px 2px;
cursor: pointer;
}
</style>
</HEAD>

<BODY style="height:480" overflow: hidden:>
<img src="/images/Faceplate.png" width="780" height="460">
<div class="OutText">
Outside Temperature
</div>
<div class="InText">
Inside Temperature
</div>
<div class="PressText">
Barometric Pressure
</div>

klricks
Posts: 6490
Joined: Sat Jan 12, 2013 3:01 am
Location: Grants Pass, OR, USA
Contact: Website

Re: New Problem in chromium

Sat May 25, 2019 1:42 pm

Note that commands in autostart are executed all at once in a near parallel fashion. ie the next line does not wait for the previous command to finish before starting.
If you need sequential processing then put the commands in a bash script and call the script from autostart.
In some cases you may need to add sleep x statements between commands.

Also be sure to use the FULL paths everywhere NOT ~/
Unless specified otherwise my response is based on the latest and fully updated Raspbian Buster w/ Desktop OS.

lrhorer
Posts: 54
Joined: Sun Feb 22, 2015 6:35 pm

Re: New Problem in chromium

Sun May 26, 2019 12:00 am

Hey! That fixed it. 'Great advice, and thanks a million.

Return to “Advanced users”