Welcome to pyaler’s documentation!

pyaler is a WSGI application to control your arduino devices via a RESTful api.


With easy_install:

$ easy_install -U pyaler

With pip:

$ pip install pyaler


$ pyaler conf.yaml


With mod_wsgi

from pyaler import pyaler

application = pyaler.make_app({}, config='conf.yaml')

With PasteDeploy

Create a config file:

use = egg:Paste#http
host =
port = 8000

use = egg:pyaler
config = %(here)s/conf.yaml

Then run:

$ paster serve config.ini

Or create a mod_wsgi file:

from paste.deploy import loadapp
application = loadapp('config:%s' % '/path/to/config.ini')

Extending pyaler

pyaler is based on bottle. You can use the bottle api to extend your pyaler service. Here is a simple example:

# -*- coding: utf-8 -*-
from pyaler import app

def index():
    return '<html><title>live</title></html>'

Then create your WSGI application like this:

from pyaler import pyaler

application = pyaler.make_app({}, config='conf.yaml', app='yourappmodule')

Example usage

Led on / led off example. First, C source:

int incomingByte = 0;
int ledPin = 13;

void setup() {
    pinMode(ledPin, OUTPUT);

void loop() {
    if (Serial.available() > 0) {
        incomingByte =;
        if (incomingByte > 49) {
            digitalWrite(ledPin, HIGH);
            Serial.println('LED turned ON');
        } else {
            digitalWrite(ledPin, LOW);
            Serial.println('LED turned OFF');

Then you can run with this matching yaml configuration

    arduino1: /dev/tty.usbserial-A800eIR3
    arduino2: /dev/tty.usbserial-A800eIho


    ledon: 42
    ledoff: 0


Indices and tables

Table Of Contents

This Page