iot-coap
IoT CoAP Framework, A Internet Of Things Framework of CoAP Protocol
Last updated 5 years ago by gmszone .
MIT · Repository · Bugs · Original npm · Tarball · package.json
$ cnpm install iot-coap 
SYNC missed versions from official npm registry.

Build Status Version Code Climate Test Coverage Dependencies

NPM

NPM

Tested on: Node 0.10.32, and 0.11.13

#CoAP协议 IOT Framework

Mini Internet of Things System with CoAP Protocol. HTTP protocol With RESTful to https://github.com/phodal/iot

吊兰-MQTT协议,CoAP协议,WebSocket,物联网协议在线测试(Online test for IOT Protocol)

##Thanks to

##Install

1.Install

npm install iot-coap

2.Create index.js

var iotcoap         = require('iot-coap');

iotcoap.run();
iotcoap.rest.run();

注意:在db配置可以选择mongodb和sqlite3,替换所需要的数据库即可。(you can choice db on iot.js with 'sqlite' or 'mongodb')

创建iot.js(Create iot.js)

exports.config  = {
    "db_name": "iot.db",
    "mongodb_name": "iot",
    "mongodb_documents": "iot",
    "db": "mongodb",
    "table_name": "basic",
    "keys":[
        "id",
        "value",
        "sensors1",
        "sensors2"
    ],
    "db_table": "id integer primary key, value text, sensors1 float, sensors2 float",
    "mongodb_init":[
        {
            id: 1,
            value: "is id 1",
            sensors1: 19,
            sensors2: 20
        },
        {
            id: 2,
            value: "is id 2",
            sensors1: 20,
            sensors2: 21
        }
    ],
    "init_table":[
        "insert or replace into basic (id,value,sensors1,sensors2) VALUES (1, 'is id 1', 19, 20);",
        "insert or replace into basic (id,value,sensors1,sensors2) VALUES (2, 'is id 2', 20, 21);"
    ],
    "query_table":"select * from basic;",
    "rest_url": "/id/:id",
    "rest_post_url": "/",
    "rest_port": 8848
};

接着运行(run)

node index.js

##Test

###Firefox

  1. 安装copper插件(下载地址:https://addons.mozilla.org/en-US/firefox/addon/copper-270430/) (install copper plugins)

  2. 选上Debug Contrl (choice Debug Control)

  3. 在Accept, Content-Format选application/json

###Node GET

node method_test/get.js

###HTTP POST

curl -H "Content-Type: application/json" -d '{"id":3, "value":"dream","sensors1":12,"sensors2":13}' http://localhost:8848

物联网相关资料收集

##配置开发环境(Setup Dev)

1.Clone

git@github.com:phodal/iot-coap.git

2.Install Dependencies

npm install

注意: 在代码提交之前会跑测试、jslint语法检查,相关机制可以查看这篇文章nodejs jslint

  1. 安装有Nodejs的OS
  2. clone完代码后执行npm install

##交流

QQ群:348100589

##文档

CoAP与物联网系统

物联网系统与CoAP之Hello,World

CoAP与物联网系统之返回JSON

CoAP与物联网系统之返回XML

IoT CoAP 块传输——使用Block传输数据

构建基于CoAP SQLite Nodejs的物联网之查询数据

构建基于CoAP SQLite Nodejs的物联网之数据库

##IDE

感谢JetBrains为我们提供了数量不限的WebStorm的License。

License

© 2014 Phodal Huang. This code is distributed under the MIT license.

Current Tags

  • 0.6.2                                ...           latest (5 years ago)

59 Versions

  • 0.6.2                                ...           5 years ago
  • 0.6.1                                ...           5 years ago
  • 0.6.0                                ...           5 years ago
  • 0.5.6                                ...           5 years ago
  • 0.5.4                                ...           5 years ago
  • 0.5.3                                ...           5 years ago
  • 0.5.2                                ...           5 years ago
  • 0.5.1                                ...           5 years ago
  • 0.5.0                                ...           5 years ago
  • 0.4.8                                ...           5 years ago
  • 0.4.7                                ...           5 years ago
  • 0.4.6                                ...           5 years ago
  • 0.4.5                                ...           5 years ago
  • 0.4.4                                ...           5 years ago
  • 0.4.3                                ...           5 years ago
  • 0.4.2                                ...           5 years ago
  • 0.4.1                                ...           5 years ago
  • 0.4.0                                ...           5 years ago
  • 0.3.2                                ...           5 years ago
  • 0.3.1                                ...           5 years ago
  • 0.3.0                                ...           5 years ago
  • 0.2.4                                ...           5 years ago
  • 0.2.3                                ...           5 years ago
  • 0.2.2                                ...           5 years ago
  • 0.2.1                                ...           5 years ago
  • 0.2.0                                ...           5 years ago
  • 0.1.20                                ...           5 years ago
  • 0.1.18                                ...           5 years ago
  • 0.1.17                                ...           5 years ago
  • 0.1.16                                ...           5 years ago
  • 0.1.15                                ...           5 years ago
  • 0.1.14                                ...           5 years ago
  • 0.1.12                                ...           5 years ago
  • 0.1.11                                ...           5 years ago
  • 0.1.10                                ...           5 years ago
  • 0.1.9                                ...           5 years ago
  • 0.1.8                                ...           5 years ago
  • 0.1.7                                ...           5 years ago
  • 0.1.6                                ...           5 years ago
  • 0.1.5                                ...           5 years ago
  • 0.1.4                                ...           5 years ago
  • 0.1.3                                ...           5 years ago
  • 0.1.2                                ...           5 years ago
  • 0.1.1                                ...           5 years ago
  • 0.1.0                                ...           5 years ago
  • 0.0.6                                ...           5 years ago
  • 0.0.5                                ...           5 years ago
  • 0.0.45                                ...           5 years ago
  • 0.0.44                                ...           5 years ago
  • 0.0.42                                ...           5 years ago
  • 0.0.41                                ...           5 years ago
  • 0.0.4                                ...           5 years ago
  • 0.0.33                                ...           5 years ago
  • 0.0.32                                ...           5 years ago
  • 0.0.31                                ...           5 years ago
  • 0.0.3                                ...           5 years ago
  • 0.0.21                                ...           5 years ago
  • 0.0.2                                ...           5 years ago
  • 0.0.1                                ...           5 years ago
Maintainers (1)
Downloads
Today 0
This Week 0
This Month 0
Last Day 0
Last Week 0
Last Month 0
Dependencies (6)
Dev Dependencies (7)
Dependents (0)
None

Copyright 2014 - 2016 © taobao.org |