Auto-Running the Weather Station at Startup

So, you want to run the Weather Station automatically when your Pi boots up? There are two options here -if you want to use your Pi at the same time, go to Step 1. If you only want your Pi to function as a weather station, then skip Step 1 and go straight to Step 2.

1. Make your Pi boot straight to the desktop

In LXTerminal, run:

sudo raspi-config

The screen should change to this:


Use the keyboard keys to scroll down and press enter when “Enable Boot to Desktop/Scratch” is selected. Navigate to “Desktop Login” and press enter to select it.


You should be back on the original raspi-config screen now. Use the keyboard keys to go right to “finish” and press enter to go back to the normal LXTerminal screen. Now you can reboot the Pi – it may ask you if you want to do this, but if not you can use sudo reboot – and check that it boots to the desktop screen properly

2. Check that your details are available

Like, (the run-at-start weather station script) automatically accesses your saved user data (such as AWS Key, username, and WOW Site ID. Unlike, though, it will not check and prompt for input if user details are missing. You will need to check if they are there and correct, either by going to the details.ini file in the Sheffield-Pi-Weather-Station folder in your file manager (as shown in the picture below), or by running:

sudo python

If you have run already there is no need to do this step, as your details should already be saved.

If you open the details.ini file from the File Manager window, you should see your user details already inputted

If you open the details.ini file from the File Manager window, you should see your user details already inputted

3. Copy the Autorun_Station daemon to init.d

A “daemon” is just a background process that handles requests for services and then is dormant when not needed. In this case the file is the daemon that will start up the weather station in the background. The following code should be on one line:

sudo cp /home/pi/Sheffield-Pi-Weather-Station/ /etc/init.d

The sudo lets the Pi know that it should run this with root privileges, the cp is telling the Pi to copy the file, the next part is the place where the file is (called the “path”), and the last part is the place where the file is to be copied to.


4. Make the Weather Station auto-run file and daemon file executable

This is done by running this code:

sudo chmod 755 /etc/init.d/


5. Make the script run at boot.

This can be done by running this code, which puts the Autorun_Station daemon into folders which the Pi checks at boot and shut down to see if jobs need to be done.

sudo update-rc.d defaults

6. Start and Stopping the process

As we’re running it at boot via a daemon, it should automatically start when power is plugged in, without needing to plug the Pi into a monitor. However, if you need to stop or start it while the Pi is on, you can use the relevant line of code below:

sudo /etc/init.d/ start


sudo /etc/init.d/ stop

These result in the following outcomes:



7. Check if your station runs automatically

Now use sudo reboot to check if your weather station will run. You can look at the site or Weather Observations Website to see if your data uploads. Alternatively (and this method only checks to see if the script is running, not if your data is being uploaded.:

ps axu | grep python

This code checks to see Python processes that are running. If your weather station is working then it should be shown, like this:


As you can see, the Autorun_Station script is running and, hopefully, uploading your data!


Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s