In this project I set up a status board zero to check if this website is up, check if my internal DNS server is up and check the weather forecast. If you check the Status Board GitHub page, you'll see that there are already some examples of the functionality I have described. In fact, my code is heavily based on the code from that GitHub page, apart from the weather checker which I found to be horribly inaccurate for British weather. Instead, I opted to code my own weather checking function using the BBC weather site as a source of data.
To recreate this project you will need:
To start with you're going to have to install a headless set up for your pi, follow this guide to install an operating system and this guide to set up WiFi for Raspbian stretch (I recommend lite). This guide gives the full headless set up with activation of SSH.
Once this is all set up plug your pi in and SSH into it. You need to install some dependencies on the software.
sudo raspi-config
sudo apt-get install python-pip
this will install a package that will allow you to install all of the program dependencies.
Now run:sudo apt update
sudo apt install python3-gpiozero python-gpiozero -y
pip install json
pip install requests
pip install urllib2
pip install bs4
pip install BeautifulSoup
pip install datetime
Some of these packages may be already installed as default, if so this is fine.
With all of this set up, run the code available to download below (and remove the .txt extension so it is web.py) and provided you are in the UK the code will likely work straight away.
To run the code, type:python web.py
note: this command won't work if you're not in the folder where the code is. If you don't know how to get the file into the pi follow this guide.