Closed
Bug 1087955
Opened 11 years ago
Closed 8 years ago
Prototype GPIO API
Categories
(Firefox OS Graveyard :: General, defect)
Tracking
(Not tracked)
RESOLVED
WONTFIX
People
(Reporter: cjones, Unassigned)
References
Details
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
https://groups.google.com/forum/#!topic/mozilla.dev.webapi/4BC0pBzEC7E
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.
| Reporter | ||
Comment 1•11 years ago
|
||
... another path that may be more fun for prototyping is getting a REST API up and running that implements and interface like WebIOPi's
https://code.google.com/p/webiopi/wiki/RESTAPI
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
https://wiki.mozilla.org/Foxberry_Pi_Demo
If you're *just* implemented in iterating on the API, that build is a perfectly fine way to get started, and test things out.
Comment 2•11 years ago
|
||
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.
[1] https://pypi.python.org/pypi/RPi.GPIO
Comment 3•11 years ago
|
||
any news?
Comment 4•11 years ago
|
||
Mailing list discussion: https://groups.google.com/forum/#!topic/mozilla.dev.webapi/4BC0pBzEC7E
Comment 5•11 years ago
|
||
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: https://github.com/jan-os/gecko-dev/blob/2adce94e0869606f1825107671ac9b5cc83c7ae2/dom/webidl/Os.webidl, which I use to do GPIO on my Rpi right now.
Comment 6•10 years ago
|
||
Just a note to be at parity with Raspbian/RPi: Please make the general GPIO API fast enough for software PWM (see http://raspberrypi.stackexchange.com/questions/298/can-i-use-the-gpio-for-pulse-width-modulation-pwm)
Comment 7•10 years ago
|
||
Implementation for Comment 5 is happening in https://bugzilla.mozilla.org/show_bug.cgi?id=1141021
Comment 8•8 years ago
|
||
Firefox OS is not being worked on
Status: NEW → RESOLVED
Closed: 8 years ago
Resolution: --- → WONTFIX
You need to log in
before you can comment on or make changes to this bug.
Description
•