开云体育

Auto run a program


 

I have a?Raspberry Pi sitting on a shelf thinking about the weather. Every so often, it generates a web page, which I can get to from anywhere. Typically, I manage it remotely as there is no monitor or keyboard. One day, I plugged in a monitor and when I rebooted, it auto logged in the user pi and showed me its?desktop. Great I thought, now I only need it to auto run lynx which will point at my weather web page. There in lies the problem, how to run lynx and show a web page. Keeping it from going to sleep and blanking the display is fairly easy, but so far, getting it to run lynx is a headache.
Any thoughts?
--
Patrick


 

开云体育

This might get you pointed in the right direction. It's from a larger shell script that does much data manipulation, likely very unnecessary for you. The script is run each five minutes from a crontab job.

#!/bin/sh
cd /home/vk2tv/getweather/freddo
# use lynx to get data from server and write to file rawweather.
lynx -dump > rawweather


Ray vk2tv


On 27/2/23 12:01, Patrick KA9PDK wrote:

I have a?Raspberry Pi sitting on a shelf thinking about the weather. Every so often, it generates a web page, which I can get to from anywhere. Typically, I manage it remotely as there is no monitor or keyboard. One day, I plugged in a monitor and when I rebooted, it auto logged in the user pi and showed me its?desktop. Great I thought, now I only need it to auto run lynx which will point at my weather web page. There in lies the problem, how to run lynx and show a web page. Keeping it from going to sleep and blanking the display is fairly easy, but so far, getting it to run lynx is a headache.
Any thoughts?
--
Patrick



 

开云体育

Why not just put a script into .profile (or /etc/profile)? Execute once at login, rather than every so many minutes?

—?
Regards
Andy


On 27 Feb 2023, at 08:25, Ray Wells <aprs@...> wrote:

This might get you pointed in the right direction. It's from a larger shell script that does much data manipulation, likely very unnecessary for you. The script is run each five minutes from a crontab job.

#!/bin/sh
cd /home/vk2tv/getweather/freddo
# use lynx to get data from server and write to file rawweather.
lynx -dump > rawweather


Ray vk2tv


On 27/2/23 12:01, Patrick KA9PDK wrote:
I have a?Raspberry Pi sitting on a shelf thinking about the weather. Every so often, it generates a web page, which I can get to from anywhere. Typically, I manage it remotely as there is no monitor or keyboard. One day, I plugged in a monitor and when I rebooted, it auto logged in the user pi and showed me its?desktop. Great I thought, now I only need it to auto run lynx which will point at my weather web page. There in lies the problem, how to run lynx and show a web page. Keeping it from going to sleep and blanking the display is fairly easy, but so far, getting it to run lynx is a headache.
Any thoughts?
--
Patrick




 

开云体育

The weather data is continually updating (each 2.5 seconds for wind, e.g.), so the script needs to run periodically to get the current weather status. I use weewx which defaults to five minute updates, a good compromise.

Ray vk2tv

On 27/2/23 19:28, Andy McMullin wrote:

Why not just put a script into .profile (or /etc/profile)? Execute once at login, rather than every so many minutes?

—?
Regards
Andy


On 27 Feb 2023, at 08:25, Ray Wells <aprs@...> wrote:

This might get you pointed in the right direction. It's from a larger shell script that does much data manipulation, likely very unnecessary for you. The script is run each five minutes from a crontab job.

#!/bin/sh
cd /home/vk2tv/getweather/freddo
# use lynx to get data from server and write to file rawweather.
lynx -dump > rawweather


Ray vk2tv


On 27/2/23 12:01, Patrick KA9PDK wrote:
I have a?Raspberry Pi sitting on a shelf thinking about the weather. Every so often, it generates a web page, which I can get to from anywhere. Typically, I manage it remotely as there is no monitor or keyboard. One day, I plugged in a monitor and when I rebooted, it auto logged in the user pi and showed me its?desktop. Great I thought, now I only need it to auto run lynx which will point at my weather web page. There in lies the problem, how to run lynx and show a web page. Keeping it from going to sleep and blanking the display is fairly easy, but so far, getting it to run lynx is a headache.
Any thoughts?
--
Patrick