Closed Bug 1087955 Opened 6 years ago Closed 3 years ago

Prototype GPIO API


(Firefox OS Graveyard :: General, defect)

Not set


(Not tracked)



(Reporter: cjones, Unassigned)



The general idea is to enable hobbyist to do all the things in FFOS on devices like RPi, that they can do in OSes like Raspbian on RPi.

A proposed API and some discussion around happened here!topic/

Judging by reactions, this is a fairly bleeding-edge proposal that may require a lot of pushing to make progress on.  That's part of the fun though :).

There are several ways to implement this.  The most "Gecko-y" way would probably be to add a HAL API for GPIO, an impl of that for linux that poked at the right /sys devices, then put a content-exposed DOM API around the internal HAL API.  Many other paths are possible though.
... another path that may be more fun for prototyping is getting a REST API up and running that implements and interface like WebIOPi's

Note too that there's an existing demo build of FFOS that runs within Raspbian, which has a very early prototype GPIO "polyfill" implemented in this way

If you're *just* implemented in iterating on the API, that build is a perfectly fine way to get started, and test things out.
That would be awsome to have a WebAPI for the GPIO, rather than impementing from scratch, what about using a third party library ?
We may also take a look at RPi.GPIO [1] (the python module source) which has a pretty clean code, that may help.

any news?
My feeling, after worked on this for a while, is that we'd be better off exposing a filesystem API to certified content. Basically fopen/fread/fwrite/fseek/fclose. In userland we can then write a GPIO/I2C/whatever API.

Basically this:, which I use to do GPIO on my Rpi right now.
Just a note to be at parity with Raspbian/RPi: Please make the general GPIO API fast enough for software PWM (see
Firefox OS is not being worked on
Closed: 3 years ago
Resolution: --- → WONTFIX
You need to log in before you can comment on or make changes to this bug.