Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Raspberry Pi program delay

I use Raspberry Pi to display web page automatically at startup.

The issue is : As soon as the raspberry is started, Midori is launched, but I've the message "Cannot Resolve Hostname....".

When I update the webpage 30 seconds after startup, it is correctly displayed.

How I can make a delay to launch Midori after X seconds ?

I launch my webpage with /etc/xdg/lxsession/LXDE/autostart

like image 834
gloops100 Avatar asked Jul 04 '14 11:07

gloops100


People also ask

How do I add a delay to my Raspberry Pi?

If you want to delay by a number of microseconds, then use delayMicroseconds().

Does Raspberry Pi have timer?

Just a quick reminder: Raspberry Pi system timer has 4 independent set of timer registers, and here the third one is used. If you go back to the device tree, you can find interrupts property.

How do I fix my Raspberry Pi time?

In the main menu, go to Preferences > Raspberry Pi Configuration. In the “Localisation” tab, you can change the current time zone: Choose the one corresponding to your location, and click on “Ok” twice to save the changes. A few seconds later, the time should be updated in the top-right corner.


1 Answers

To add small delay before midori starts, which would be less reliable than ip checking. See section 3 on this link. http://www.antony-neu.com/2013/03/12/autostarting-a-browser-on-the-raspberry-pi/

Follow the steps and inside the bash script above the line that calls midori add a sleep period:

sleep 5
like image 92
Revive Avatar answered Sep 19 '22 09:09

Revive