Ok, so someone has already beaten me to it (and done a excellent job of it as well) with the whole web-based temperature monitoring thing, but anyway… Here’s Webthermo! :)

Webthermo,  my follow-up to Ardthermo, is a small, web-enabled Python script which uses the CherryPy HTTP Python framework.  It allows you to monitor temperature (in both Celsius and Fahrenheit units) over the Internet (using the port-fowarding facility of your Router),  or on your own LAN via a web browser, your favorite RSS reader or a WAP-capable Mobile phone, using the same Arduino sketch and hardware setup as was used for Ardthermo.

It’s still in the early stages of development at the moment, so its still a bit rough around the edges but it works well enough. You can get a copy of the Python script, which also includes the Arduino sketch needed for the hardware side of things, from the Software page.

System Requirements and instructions on how to use Webthermo can be found below. Enjoy everyone!

System Requirements

Software

  • Python 2.5.2 or above with the CherryPy (version 3.1.1) and Threading modules installed.
  • Linux recommended. Use of Ubuntu is assumed in this guide, but this should work under Windows, Mac OS X, etc as well  (Could any MAC or Windows users out there post their experiences with using this script? )

You don’t need to use a seperate Webserver, such as Apache, as the server component is provided by the CherryPy module.

Hardware

The hardware requirements and instructions for setting up the Measurement circuit are  the same as in the Arduino Remote Thermometer article, so I won’t repeat them here. Have a look at the instructions there and make sure you have everything setup and the thermometer sketch uploaded to the Arduino before continuing.

Installing Software Dependencies

The Threading module should already be included with your Python installation. The CherryPy module can be installed by issuing the following command at the terminal:

sudo apt-get install python-cherrypy3

Configuring Webthermo

Before you use Webthermo, you’ll need to configure it. Open up the webthermo.py file (this is the main program, the obtaindata.py file is just a companion module)  in your favorate text editor and scroll down to the Configuration Options section. A description of the Configuration options can be found below:

  • ArduinoPort: The serial port device your Arduino is connected to.
  • MonitorLocation: A short description of the location Webthermo is monitoring. This will show on all web pages as well as in the RSS feeds descriptions.
  • ServerPort: The port webthermo will listen on for connections.
  • Refresh_Interval: Sets the delay between page auto-refreshes. (This is only applicable to the home page.)
  • Users: The maximum number of Concurent Users you want Webthermo to be able to serve. The Default setting is 5.

Using Webthermo

To use Webthermo,  open a terminal, go to the directory where you unpacked Webthermo,  change to the bin subdirectory and issue the following command:

./webthermo.py

The script will then execute. You can stop the script by pressing Ctrl-C.

To check that everything’s working, load up a web browser and point it to the address and port number Webthermo is running on. You should then get the homepage in your browser. (See screenshot below for an example.)

Webthermo In Action

Webthermo homepage. Click for full-sized image.

You can access the RSS feeds by appending /rss to the end of the URL. The WAP readings page  can be accessed by appending /wap and the lite (plain-text version, suitable for PDA’s and older web browsers) can be accessed by appending /lite to the end of the URL.

Hope you find this little script useful. Until next time, good bye and Happy Hacking.

Related posts:

  1. Arduino-based Talking & Remote Thermometer
  2. Fun with PyRSSI, an Arduino and Twitter
  3. From Hackaday: Arduino Snow Clock
  4. Thermometer Project: Update