-
Notifications
You must be signed in to change notification settings - Fork 48
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Expose Board via a HTTP Server #68
Comments
Great idea ! |
Yes, great idea, @Vido! We can start by emulating exactly the RESTful API of the Yun, which will also be available in the Arduino Tre. Also, we can implement that as a POC using just BaseHttpServer but I believe we should move to integrate Trollius (the Tulip/asyncio backport to Python 2.7). Trollius is not only a solid foundation for the HTTP API but also for the asynchronous handling of inputs. People are using Node.js for IoT exactly for this reason: effective support for event-oriented programming. |
I also like asynchronous handling of inputs. Maybe Autobahn could help some interesting links about WAMP, Autobahn and Crossbar (in french sorry): caution: some links inside sametmax website might be "NSFW". |
Same idea could also apply to an other open source project: sigrok http://sigrok.org/ |
For RESTful only API, this project can be interesting https://flask-restful.readthedocs.org |
Related: #60 |
Maybe a first step (for REST API) could be to have most of Pingo objects JSON serializable.
raises `<pingo.ghost.ghost.GhostBoard object at 0x1065213d0> is not JSON serializable`` same for other objects such as pins
raises Here is some code with Python Flask_restful https://flask-restful.readthedocs.org/ and flask_restful_swagger https://github.com/rantav/flask-restful-swagger with
with
Run server using:
Here is what a client code with
|
@Vido, I do not believe have an entire board serializable is a prerequisite On Mon, Feb 16, 2015 at 6:28 PM, scls19fr [email protected] wrote:
Luciano Ramalho Professor em: http://python.pro.br |
For async API this could help "There is a complete example for 2 way comms to GPIO on the Pi : https://github.com/crossbario/crossbarexamples/tree/master/device/pi/gpio from Tobias Oberstein (WAMP / Autobahn / Crossbar dev) |
I started writing the REST API for accessing the board via HTTP. The code is here: http://git.io/vZ9PU There is still a lot to do, but it is working for basic I/O. I tested it on my Raspberry Pi and lit a led and read from a button via HTTP. |
There is a debate wheather we should use Flask or Bottle. When I wrote the mockup YúnBridge, I used Flask: Flask and Bottle are very similar. |
I didn't know about the difference about Flask and Bottle, but from what you said and a little research I think it is a good idea using Bottle. Shipping bottle within pingo will allow simpler installation and usage compared to flask. |
Hi @lamenezes , I noticed your PR #92 These 2 links: could help to stream data which is a great feature for Internet Of Things. Kind regards |
Great ideia, @scls19fr. It really is a great feature for IoT. But what async framework is the best for pingo? Tornado? Twisted? gevent? Look at this @Vido, WebSocket solves that problem we were discussing at garoa. Now we may be able to use PWM (and other things) over the HTTP which sounds very cool to me. |
In fact, It's possible to have PWM, even with REST. Because It's a hardware/lib If you try to switch on and off a pin with WebSocket, I believe (guesswork) Thanks. On Fri, Sep 25, 2015 at 8:33 AM, Luiz [email protected] wrote:
|
We just had an idea to expose the Board via a HTTP Server.
This would take a step further into the Internet of Things concept.
We have some o this on Yun. It has a HTTP server an a REST-like API.
Pingo could provide this server for all supported Boards.
The text was updated successfully, but these errors were encountered: