Open IOT Challenge: work in progress and CoAP Gateway
I participate in the Open IOT Challenge (see post http://k33g.github.io/2015/12/10/IOT-CHALLENGE-01.html), my project is called “Atta”, in the previous post, I was taking about of the implementation of MQTT Gateway simulator (http://k33g.github.io/2015/12/15/IOT-CHALLENGE-02.html) and today I completed a 1st simple version of the CoaP Gateway.
What is CoAP?
CoAP (Constrained Application Protocol) is used as IOT protocol, it’s a restful protocol and it’s used with simple devices. in fact with CoAP, there is no central server. “Servers” of resources are listening on each devices or gateway. To my mind it’s a good solution for problems of “high availability” and “fault tolerance”: you can easily add or replace a Gateway, and it’s more difficult to replace a server ;).
So, CoAP is a RESTful protocol, used in/with very simple electronics devices (LoWPAN). And a CoAP client makes query to a “server” of “resources” like that:
GET /status/led/red POST /control/switchon/red
That is why, I also wanted to include a CoAP simulator in Atta (you know, my little DSL https://github.com/ant-colony/atta).
The CoAP Gateway
It’s a first version, and it’s a simple version (
SimpleCoapGateway class) (one gateway - one resource and one REST method:
GET), in the future, I’ll provide a
CoapGateway with the ability to get several resources and all REST methods.
It’s also easy to create a CoAP gateway instance than creating a MQTT gateway instance (see previous post):
Remark: I’ve used the Californium project https://www.eclipse.org/californium/ to create my gateways.
Use a NodeJS CoAP client to query the gateway
Use a Golo CoAP client to query the gateway
Golo http://golo-lang.org/ plays very well with Californium:
Once again, you can see that it’s very easy to simulate “connected things” with Atta. Next time, we’ll see the REST Gateway and/or some more sophisticated sensors simulators.
Atta project is here: https://github.com/ant-colony/atta yes, I know, it lacks a little bit of documentation.
Stay tuned :)Tweet