July 20–24, 2015
Portland, OR

Pingo means "pin, go!": Universal IoT programming in Python

Luciano Ramalho (ThoughtWorks)
4:10pm–4:50pm Wednesday, 07/22/2015
Mobility D137/138
Average rating: ****.
(4.40, 5 ratings)
Slides:   1-PDF    2-PDF 

Prerequisite Knowledge

To get the most of this talk, participants should have a basic understanding of the Arduino and of Python, JavaScript, Perl, or Ruby.

Description

The Internet of Things is here: single-board computers like the Raspberry Pi, Arduino TRE, Intel Edison, BeagleBone Black, pcDuino etc. are better netizens than the original Arduino, and we can program them in high-level languages like Python. But each has a different API, so projects are hard to port from one board to the next. And some of these APIs are thin layers on top of low-level C APIs that do not leverage the best features of Python.

Pingo is a multiplatform API for controlling the GPIO pins used for physical computing. Pingo runs embedded in boards that run GNU/Linux, but can also remotely control multiple Arduinos via the Firmata protocol — always with the same API. Pingo brings uniformity and high-level services to embedded systems programming. By leveraging Python and its rich ecosystem of networking libraries, IoT projects can be developed much faster, and porting among boards becomes trivial.

Using the Python console or the powerful graphic IPython Notebook, Pingo allows interactive exploration of the built-in functionality of different boards using an intuitive, object-oriented API. This means that each pin is not merely a number, but a rich object that can be inspected live for its capabilities, interactively answering questions like:

  • How many digital pins does this board provide?
  • What are the locations of all analog pins?
  • Does pin #23 support PWM output?
  • What is the voltage on analog pin #3 right now?

The pins can also be individually or collectively controlled with simple interactive commands.

In addition, Pingo provides higher-level objects representing displays, sensors, and actuators, and those objects work the same way across all supported boards, thanks to the hardware abstraction at the core of the generic board and pin base classes.

This talk will show how Pingo works, with a live demo involving at least two different boards cooperating (a video demo will be prepared as plan B). We’ll then discuss the usability concerns that drove the design of the API: how it was inspired by the original Arduino but leveraged the high-level, user-friendly features of Python to enable simple, interactive exploration and control of GPIO pins. That’s why Pingo means simply “pin, go!”

Photo of Luciano Ramalho

Luciano Ramalho

ThoughtWorks

Luciano Ramalho is the author of Fluent Python. Ramalho was a Web developer before the Netscape IPO in 1995, and switched from Perl to Java to Python in 1998. Since then he worked on some of the largest news portals in Brazil using Python, and taught Python web development in the Brazilian media, banking and government sectors. He has spoken multiple times at OSCON, PyCon, PythonBrasil, FISL and RuPy. Ramalho is a member of the Python Software Foundation and co-founder of Garoa Hacker Clube, the first hackerspace in Brazil. He is a managing partner at Python.pro.br, a training company.