Mar 02

WebIOPi 0.7 release

Dear folk, I’m glad to announce the new WebIOPi release, tagged 0.7. I know it’s long time since the 0.6, almost a year, and I hope you will enjoy it.

The most important change is a global improvement of button handling on all browsers, including mobile and tablets. Without any change on the Cambot code, it now works really great on tablets and mobiles. Buttons are very responsive.

You will also find several new drivers, like a PiFaceDigital, MCP3002 ADC and 4802 DAC for people using a Gertboard, and a first Humidity sensor driver. I would like to thanks Craig and Michael for sharing their drivers.

There is other improvements and bug fixes, see detailed changelog below. You will also find complete code of all wiki tutorials in the 0.7 package.

As usual, entry point to downloads is the Google Project Page, but files are now hosted on SourceForge. Wiki will be updated within next days with new drivers and features.

Feel free to donate if you like WebIOPi and want to support it. I would like to thanks all donators from last months, WebIOPi may never been resumed without their generous support.

Stay tuned for a hot announcement in next weeks ;-)

Detailed 0.7 changelog :

  • improved touch device handling ( issue #73 )
  • updated jQuery library to version 1.11
  • added PiFaceDigital? driver
  • added PCF8591 ADC/DAC driver
  • added MCP3002 ADC driver
  • added MCP4802, MCP4812, MCP4822 ADC drivers
  • added HYT221 Humidity Sensor driver
  • added BMP180 Temperature & Pressure Sensor driver
  • added support of multiple MCP23Sxx on a single SPI CE line
  • added vref argument for MCP DAC and ADC ( issue #48 )
  • fixed devices monitor DAC display
  • allows PiClients? to run on others platforms than the Pi ( issue #46 )
  • general webiopi Python library improvements
Jan 26

WebIOPi Irrigation System

After the tutorial series, I’m please to announce the first official Irrigation System WebIOPi-based application. It can work with PiFace, IO PI, or any I/O expander supported by WebIOPi.

The system provides both manual and automatic mode, with a week schedule to activate each station in sequence for a given duration. Even for people who don’t have an irrigation system, it’s a very nice application to go more further with WebIOPi. On my side, it pointed me few issues and difficulties can encounter people when using the framework, so I can improve it.


Application is available on demand for US$15 (10€) and more donators and provided as a ZIP file containing a Python script, HTML, Javascript and CSS files as well as a README with installation and usage instructions. The code is well documented and can be easily customized by editing HTML and CSS files. You can see the customization made by Benjamin, who integrated the system with his existing WebIOPi applications.


Jan 14

WebIOPi Tutorials & SVN update

WebIOPi wiki has just been updated to complete existing devices tutorial as well as adding a new Serial tutorial. You should take a look on it quickly, by clicking following images.

Writing the Serial tutorial, I discovered a bug, which I immediately fixed and committed to SVN. You’ll find instructions to update WebIOPi in the tutorial.

You will also find all tutorials code on the SVN, in the trunk/tutorials folder. You should get it by updating your WebIOPi install.

I hope you will like it. I don’t plan to make more changes on the wiki, only typo correction and few formatting changes, so I can now focus on the code.

Don’t forget to regularly check hacker tips in the wiki tutorials menu, I may add useful tips.

Devices Tutorial

Serial Turorial

Jan 03

Happy New Year !

I hope you all enjoyed the end of 2013, and I would like to wish you all an Happy 2014 Year !

Coming CES will show new IoT tendencies with more IoT actors, products and services in the next year, all well packaged, but very closed, sometime inappropriate to hobbyists you are. WebIOPi intends to allows anyone making their own connected things, with a unique framework using best-practices and future proof protocols.

This year will be a key for WebIOPi, with a lot of things to do in the next month :

  • Wiki update and fixes
  • WebIOPi Development resume
  • WebIOPi Cooking Book
  • Special announcement

I hope to release a minor WebIOPi update containing bug fix during January as well as the whole wiki update. A new major release should come with the book later, for spring. You can refer to the bug tracker and the roadmap to get an idea of coming work. Stay tuned.


Dec 23

WebIOPi Tutorials

The WebIOPi wiki has been updated on last week end, with tutorials available, to help anyone building their own connected thing with the Raspberry Pi.

You can learn the WebIOPi framework basis, how to make your own Python script and your own UI. There is also a tutorial dedicated to macros, and one dedicated to devices. Don’t forget to check the hacker tips, to ease your life with WebIOPi.

You will also found a new description on the main project page, which I hope it will be clearer.


The other missing things on the wiki (Serial, I2C and SPI API) will be added early in january, stay tuned.

Dec 15

WebIOPi Donator Reward Program

Thanks to the previous calls, I received more than 100 answers to the survey in two weeks.
If not already done, you can still follow the survey. At this time, I can see few tendencies :

Satisfaction :
- People are mostly very satisfied with WebIOPi
- But most people complain about examples/tutorials/documentation
- About 50% people want a book
On short term, I will focus on documentation/wiki, code consistency, and improving existing features rather adding new features. I started to work on a new WebIOPi release and a book, both planned for spring.

Mobile application :
- about 50% people are willing to pay for a mobile application
- android phone is the most owned device, followed by android tablet, then ipad and iphone
On short/medium term, I’m considering an android application, then iOS.

Kickstarter :
- 75% people are ready for a kickstarter
- 50% people are willing to pay for special features
I may consider it on medium/long term, but I need to find out which new feature set could be paid or justify a kickstarter. Actually, donation program can replace it.

Donation :
Thanks to 20 generous donators, I received on the last two weeks, twice the amount of the past year. Making few estimates based on the survey, with 80 people considering donate, if most of them really donate, I will be able to focus on WebIOPi during a week or two.
I froze my outgoing Paypal activity since november and I will use the accumulated balance in January to purchase new materials and spend time on WebIOPi.
Please make donation, it will really help improving WebIOPi.

Seeing the results, I decided to launch the WebIOPi Donator reward program. All 2013 donators will be rewarded following this rules :

  • 10€ (15$) and more : Free WebIOPi Android or iOS App with early access (release tbd)
  • 20€ (30$) and more : + Free WebIOPi eBook (Spring 2014)
  • 50€ (75$) and more : + Personal support for your project

I’m really motivated, and want to bring something great, with less headaches for you.
I hope you will like this initiative, and you will continue to support me.

Donate in Euro Donate in USD

Dec 01

WebIOPi needs your help

I develop WebIOPi on my free time, spending long nights, week-ends and and job vacancies on the project, for the community. I started it seeing there was no true valuable REST API to remotely control Raspberry Pi GPIO. I then continued to improve it, integrating some user needs, and trying to make it the best Internet of Things framework for the Pi. With WebIOPi 0.6 you can directly use more than 30 devices, including analog, sensors, and more. It’s fully extensible and highly customizable. It reached a nice level and set of features, but still need to be improved. For instance, WebIOPi does not have real-time IO support.

I’m currently thinking to resume the development, but it will require a lot of time to bring something really great. I need your help to find the best way to get funds so I can focus on WebIOPi, speed-up the development, add features and improve the quality of both software and documentation.

Please take two minutes to complete this online survey, there is only 10 questions.

Donations are really appreciated, you can donate either in Euro or US Dollar :

Donate in Euro Donate in USD

Feel free to join the discussion on the google group.

Nov 28

WebIOPi future

Dear fans,

WebIOPi is alive for more than a year now, and last release was 8 month ago.
It has been used around 150000 times by 50000 users, I never expected such a success !
I’m thinking to resume the WebIOPi development, but I’m not sure where to go. There is much things that I wanted to do.
So how do you use WebIOPi ? What are the difficulties encountered and missing features ?
I’m also looking for a way to fund the project in order to work on it full-time for few weeks or months.
Feel free to join the discussion on the WebIOPi Google Group.
Mar 31

RPIDOM et WebIOPi : 1-Wire

Il y a quelques temps, j’ai reçu une carte RPIDOM fabriquée par les français de YADOM. Cette carte apporte 2 éléments manquant au Raspberry Pi, à savoir un contrôleur 1-Wire et une horloge RTC. Par ailleurs, elle dispose de deux entrée de type TéléInfo, qui permet de se brancher à un compteur EDF pour la relève de la consommation instantanée.

Aujourd’hui, je vais vous présenter l’utilisation du contrôleur 1-Wire et comment s’en servir directement avec WebIOPi sans installation supplémentaire. La notice du RPIDOM nous recommande d’installer OWFS mais l’opération, bien que facile, peut encore être simplifiée. En effet, il est possible d’utiliser le contrôleur directement sans passer par OWFS, simplement en chargeant les modules adéquats sans installation supplémentaire.

$ sudo modprobe wire          # chargement du module 1-Wire principal
$ sudo modprobe w1_therm      # chargement du module capteur de température
$ sudo modprobe i2c_bcm2708   # chargement du module I2C principal
$ sudo modprobe ds2482        # chargement du module permettant d'utiliser le contrôleur

# enfin, on enregistre le pont sur l'interface I2C
# pour les Raspberry révision 1, il faut remplacer i2c-1 par i2c-0
$ echo ds2482 0x18 | sudo tee /sys/bus/i2c/devices/i2c-1/new_device

# si un capteur 1-Wire est branché, il devrait alors être detecté
$ cat /sys/bus/w1/devices/w1_bus_master1/w1_master_slaves

# on peut alors lire la temperature
$ cat /sys/bus/w1/devices/28-0000049c7a8d/w1_slave
76 01 4b 46 7f ff 0a 10 79 : crc=79 YES
76 01 4b 46 7f ff 0a 10 79 t=23375

Il est tout a fait possible d’utiliser WebIOPi 0.6 pour lire la température en enregistrant le capteur dans le fichier de configuration /etc/webiopi/config :

rpidom-temp = DS18B20 slave:28-0000049c7a8d

Après redémarrage de WebIOPi, on peut voir la température dans le Devices Monitor, plutôt simple non ?

Libre à vous d’utiliser alors l’une des nombreuses API et bibliothèque de WebIOPi pour utiliser les composants branchés à l’interface 1-Wire. Tous les capteurs de température 1-Wire (DS18*) ainsi que le switch DS2408 sont déjà supportés par WebIOPi.

Il est possible de charger les modules au démarrage, via le fichier /etc/modules. Mais il faut pour l’instant enregister le pont sur le bus I2C à la main. Je vais regarder pour simplifier toute la démarche en l’intégrant directement dans WebIOPi.

Dans des prochains billets je parlerai de l’horloge RTC fournie, puis de la relève TéléInfo.

Mar 27

WebIOPi 0.6 brings the Pi to IoT

After 2 months of hard work on my free time, I’m glad to release WebIOPi 0.6, with new exciting features. Taking grade of Internet of Thing framework, it becomes the perfect swiss-knife to make connected things with the Raspberry Pi by providing consistent libraries and API. From Arduino-like scripts to a full UART/I2C/SPI support and CoAP transport, discover new functionalities :

Python script loading facility & Arduino-like GPIO library

The new Server configuration file allows to load customs Python scripts for advanced configuration or computation. You can write your scripts with an Arduino sketch-like format using setup/loop/destroy functions. Macro registering to the REST API has been simplified as it only requires to add @macro before each macro definition.

The included GPIO native library has been modified to allow Arduino-like syntax using digitalRead and digitalWrite functions. There is also a readPort and writePort to get or set all I/O with a single integer. You can also use setup/input/output functions for an RPi.GPIO-like syntax.

import webiopi
GPIO = webiopi.GPIO
LED = 25

# Called by WebIOPi at script loading
def setup():
    GPIO.setFunction(LED, GPIO.OUT)

# Looped by WebIOPi
def loop():
    value = not GPIO.digitalRead(LED)
    GPIO.digitalWrite(LED, value)

# Called by WebIOPi at server shutdown
def destroy():
    GPIO.setFunction(LED, GPIO.IN)

# A macro which says hello
def Hello(first, last):
    return "Hello %s %s !" % (first, last)

Anyone should be able to use the included library without changing their habits and extend WebIOPi without worrying about the Server. As usual, make a POST to /macros/Hello/Eric,PTAK to call the macro !

UART, SPI, I2C and 1-Wire support

WebIOPi now supports all buses available on the Pi, using full Python custom lightweight drivers, compatible with both Python 2.7 and Python 3.2, including I2C, with no dependency ! You can use WebIOPi Python library in your scripts to use all buses with a generic bus abstraction written for the Pi. It gives a consistent way to use UART, I2C and SPI with same readByte, writeByte and other clear functions. WebIOPi also supports more than 30 devices natively, including most used DAC, ADC, GPIO expander and sensors. Based on a common device abstraction layer and REST mapping, it gives a consistent way to access electronic components wired to the Pi. You will found for instance, analogRead, analogWrite, pwmRead, pwmWrite, and many other clear functions.

# Analog package contains ADC, DAC, PWM drivers
from webiopi.devices.analog import MCP3008, ADS1015, MCP4922, MCP4725
# Digital package contains GPIO expanders
from import MCP23017
# Sensor package contains several Temperature, Luminosity and Pressure sensors
from webiopi.devices.sensor import BMP085, DS18B20

# Setup SPI analog components
adc0 = MCP3008(chip=0) # MCP CS wired to Pi CE0
dac0 = MCP4922(chip=1) # MCP CS wired to Pi CE1

# Setup I2C analog components
adc1 = ADS1015(slave=0x40)
dac1 = MCP4725(slave=0x62)

# Setup I2C GPIO expander
gpio1 = MCP23017(slave=0x20)

# Setup sensors
tmp = DS18B20()
bmp = BMP085()

# Output HIGH on GPIO expander channel 0
gpio1.setFunction(0, GPIO.OUT)
gpio1.digitalWrite(0, GPIO.HIGH)

# Read ADC
print adc0.analogRead(0)       # Channel 0 as integer
print adc0.analogReadFloat(1)  # Channel 1 as float (0.0 to 1.0)
print adc0.analogReadVolt(2)   # Channel 2 as volt

# Write on DAC
dac0.analogWrite(0, 1023)      # Output 100% on Channel 0
dac0.analogWriteFloat(0, 0.5)  # Output  50% on Channel 0
dac0.analogWriteVolt(0, 3.3)   # Output 3.3V on Channel 0

# Retrieve sensor data
print tmp.getCelsius()
print bmp.getCelsius()
print bmp.getHectoPascal()

You can use the webiopi devices library in your own Python script or register devices in the WebIOPi Server configuration file then access them through the REST API.

HTTP GET /devices/adc0/analog/0/float
HTTP POST /devices/dac0/analog/0/float/1.0

HTTP GET /devices/gpio0/0/value
HTTP GET /devices/gpio0/0/function
HTTP POST /devices/gpio0/0/value/1

HTTP GET /devices/tmp/sensor/temperature/c
HTTP GET /devices/bmp/sensor/temperature/f
HTTP GET /devices/bmp/sensor/pressure/hpa

The project wiki will be updated soon with all new functions and REST bindings.

CoAP support

CoAP is an ongoing IETF lightweight protocol build on top of UDP to use REST services with constrained devices. It can decrease webiopi requests latency by 3 and allows multicasting. With HTTP, controling several devices requires to make a request to each devices. With UDP multicasting you can control many devices with a single request in a single frame sent from a Client. Depending on network topology, it even allows to synchronize outputs. Adding this in WebIOPi gives Internet of Things and Machine-to-Machine capabilities to the Raspberry Pi. I’ve added a CoAP Client Python library, which is near HttpClient in use :

from webiopi.protocols.coap import *

client = COAPClient()

I’ve also open sourced a Java CoAP client, you can found on Google Code. Instead of using any HTTP or CoAP client, I suggest to use one of the following webiopi client libraries.

Python and Java WebIOPi Client libraries

Using WebIOPi from the browser is easy, but using it from an application is now easy as well. Just like the Javascript library, you can use the Python and Java Client libraries to make anything-to-Pi or Pi-to-Pi communication. Python and Java libraries provide both HTTP and CoAP WebIOPi Clients, and also a Mixed one, which uses CoAP with a HTTP fallback.

from webiopi.clients import *
from time import sleep

# Create a WebIOPi client
client = PiHttpClient("raspberrypi")
#client = PiMixedClient("raspberrypi")
#client = PiCoapClient("raspberrypi")
#client = PiMulticastClient()

client.setCredentials("webiopi", "raspberry")

# RPi native GPIO
gpio = NativeGPIO(client)
gpio.setFunction(25, "out")
state = True

# DAC named "dac1"
dac = DAC(client, "dac1")

# ADC named "adc1"
adc = ADC(client, "adc1")
value = 0.0

# Temperature sensor named "temp0"
temp = Temperature(client, "temp0")

while True:
    # toggle digital state
    state = not state
    gpio.digitalWrite(25, state)

    # increase analog value
    value += 0.01
    if value > 1.0:
        value = 0.0
    dac.writeFloat(0, value)

    # DAC output 0 is wired to ADC input 1
    val = adc.readFloat(1)
    print("Analog = %.2f" % val)

    # Retrieve temperature
    t = temp.getCelsius()
    print("Temperature = %.2f Celsius" % t)


Python is perfect for custom Pi-to-Pi communication, when Java will suit Android needs.

Serial Monitor Web App

The Serial bus can be directly mapped to the REST API allowing raw use of any UART (native or USB) through the REST API. I’ve added a Serial Monitor Web App to quickly debug any UART device from a browser.

Devices Monitor Web App

All devices supported by WebIOPi inherit from generic classes, providing a full mapping from the Python native library to the clients library through the REST API. With the Devices Monitor you can quickly try them with a browser.

Others changes and upcoming work

There is also several bug fix and improvements, you can check the changelog for the complete list of changes. Also check the project page for more documentation and downloads.

I would like to thanks the community from the WebIOPi Group, particularly Andreas for his feedbacks and for writing few sensor drivers.

Next developments will focus on real-time features with interrupt handling and server push. I also plan to add more devices on the support list, including several expansion boards, Pi-Face and RPIDOM first.

If you like what has be done, don’t forget I do it on my free time. Feel free to support me if you want something even better.

Eric / trouch.