A program to display temperature remotely
This is a useful program in real-life and can be part of your home automation. You will be able to get temperature information from BeagleBone to any Internet connected smartphone/computer. We need to create one HTML file and one Python file for this exercise. Let's write an HTML file first. This HTML file is not hard-coded to show temperature value. It will get temperature value at run time. This type of HTML file defines a pattern or model of how a webpage should look at run time. So, they are called templates in Flask. A template HTML file needs to be created inside the directory templates. So, open Cloud9 IDE. Inside the left-side workspace pane, create a new directory called templates
under cloud9
directory. Create a new file named temperature.html
inside the templates
directory. The total path of this newly created file will be /var/lib/cloud9/templates/temperature.html
. Write the following code in it and save:
<!DOCTYPE html> <html...