Control a led remotely using Tornado web server

This article illustrates how to control remotely via web a GPIO line using the Tornado web server for Python

To follow this article you have to install Tornado on your Acme Board.

The first attempt is to control a led wired on an Acme board.

The files used are:

  • The web server: led.py
  • A simple html page with two buttons: index.html
  • The web site icon: favico.ico

Plug a Daisy-11 board to the Daisy connector D11 then type:

~/playground/python/tornado/led# python led.py

It is possible to use a different GPIO line just changing the line

led = ablib.Daisy11('D11','L1')

Open your browser and try to send the on-off command directly using these urls:

Now open the default web page:

and turn on-off the led using the two HTML buttons like these:

Led control panel



Related links

Sergio Tanzilli
System designer, webmaster and Acme Systems co-founder

Personal email: tanzilli@acmesystems.it
Webpage: https://www.acmesystems.it
Github repositories: https://github.com/tanzilli and https://github.com/acmesystems
Telegram group dedicated to the Acme Systems boards: https://t.me/acmesystemssrl