Coder Social home page Coder Social logo

phodal / lan Goto Github PK

View Code? Open in Web Editor NEW
565.0 85.0 207.0 523 KB

Internet of Things Server Layer with CoAP, WebSocket, MQTT, HTTP Protocol.

Home Page: http://lan.phodal.com

License: MIT License

JavaScript 89.84% CSS 1.44% HTML 6.40% Shell 0.15% Dockerfile 2.17%

lan's People

Contributors

exdevillee avatar marcbachmann avatar phodal avatar swizardlv avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

lan's Issues

建议增加 put 的支持

要不这样,我们自己定义 ,不是有 post, put 两个吗
post 覆盖,新建
put 追加,替换
这样就完美了

2个疑问

1)我发送一个 CON 包,服务器应答了3次,可用我的 ucoap 直接编译测试
2)post 上去的数据,并不是替换原来数据,而是无限附加到数据后面

Documents

  1. comments in code (maybe jsdoc)
  2. document for setup

TypeError: Cannot call method 'get' of undefined

你好, 我刚开始使用您的lan工程,在安装完毕运行的时候遇见这个问题:
ubuntu@ip-172-31-21-12:~/lan$ npm start

[email protected] start /home/ubuntu/lan
node server.js
/home/ubuntu/lan/server.js:16
if (_.include(app.config.get('modules'), 'websocket')) {
^
TypeError: Cannot call method 'get' of undefined
at start (/home/ubuntu/lan/server.js:16:28)
at Object. (/home/ubuntu/lan/server.js:37:3)
at Module._compile (module.js:456:26)
at Object.Module._extensions..js (module.js:474:10)
at Module.load (module.js:356:32)
at Function.Module._load (module.js:312:12)
at Function.Module.runMain (module.js:497:10)
at startup (node.js:119:16)
at node.js:902:3

还有在
5.Start Cron
npm jobs/cron.js
出现:
ubuntu@ip-172-31-21-12:~/lan$ npm jobs/cron.js
Usage: npm
where is one of:
add-user, adduser, apihelp, author, bin, bugs, c, cache,
completion, config, ddp, dedupe, deprecate, docs, edit,
explore, faq, find, find-dupes, get, help, help-search,
home, i, info, init, install, isntall, issues, la, link,
list, ll, ln, login, ls, outdated, owner, pack, prefix,
prune, publish, r, rb, rebuild, remove, repo, restart, rm,
root, run-script, s, se, search, set, show, shrinkwrap,
star, stars, start, stop, submodule, tag, test, tst, un,
uninstall, unlink, unpublish, unstar, up, update, v,
version, view, whoami
npm -h quick help on
npm -l display full usage info
npm faq commonly asked questions
npm help search for help on
npm help npm involved overview
Specify configs in the ini-formatted file:
/home/ubuntu/.npmrc
or on the command line via: npm --key value
Config info can be viewed via: npm help config
[email protected] /usr/share/npm

在Google上面没有找到答案,到您这请教一下。再次感谢您做出这么好的工程

windows 安装

window下装那个加解密的包需要装什么vs2013 express,太大,我受不了了
建议用 openssl ,不然windows下部署太复杂

lan crash

多次反复测试 send coap packet con
lan出现下面错误崩溃

Error: No reply in 247s
at null._onTimeout(/root/lan/node_modules................)
at Timer.listOntimeout as ontimeout

安装问题

Centos 7.2.1511_X64
安装到 sequelize db:migrate时出错,
Loaded configuration file "config/config.json".
Using environment "development".
Using gulpfile /usr/lib/node_modules/sequelize-cli/lib/gulpfile.js
Starting 'db:migrate'...
[Error: The dialect sqlite is not supported. Supported dialects: mariadb, mssql, mysql, postgres, and sqlite. (Error: Please install sqlite3 package manually)]

很无语啊,sqlite3确实安装了

throw new Error('The dialect ' + this.getDialect() + ' is not supported. (

一直卡在这个位置,求大神帮忙解答下,非常感谢

[email protected] start /Users/sonny/lan
node server.js

/Users/sonny/lan/node_modules/sequelize/lib/sequelize.js:183
throw new Error('The dialect ' + this.getDialect() + ' is not supported. (
^
Error: The dialect sqlite is not supported. (Error: Please install sqlite3 package manually)
at new Sequelize (/Users/sonny/lan/node_modules/sequelize/lib/sequelize.js:183:11)
at Object. (/Users/sonny/lan/models/index.js:9:17)
at Module._compile (module.js:460:26)
at Object.Module._extensions..js (module.js:478:10)
at Module.load (module.js:355:32)
at Function.Module._load (module.js:310:12)
at Module.require (module.js:365:17)
at require (module.js:384:17)
at Object. (/Users/sonny/lan/server/index.js:4:14)
at Module._compile (module.js:460:26)
at Object.Module._extensions..js (module.js:478:10)
at Module.load (module.js:355:32)
at Function.Module._load (module.js:310:12)
at Module.require (module.js:365:17)
at require (module.js:384:17)
at Object. (/Users/sonny/lan/app.js:8:14)

npm ERR! Darwin 14.3.0
npm ERR! argv "node" "/usr/local/bin/npm" "start"
npm ERR! node v0.12.7
npm ERR! npm v2.14.2
npm ERR! code ELIFECYCLE
npm ERR! [email protected] start: node server.js
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the [email protected] start script 'node server.js'.
npm ERR! This is most likely a problem with the lan package,
npm ERR! not with npm itself.
npm ERR! Tell the author that this fails on your system:
npm ERR! node server.js
npm ERR! You can get their info via:
npm ERR! npm owner ls lan
npm ERR! There is likely additional logging output above.

npm ERR! Please include the following file with any support request:
npm ERR! /Users/sonny/lan/config/npm-debug.log

建议你把 auth 信息放到 URI-QUERY

理由是:
1) 目前常规方案
2) 使用 coap-client , copper 都可以简单通信
3) BLOCK2 不是RFC7252 核心部分, 有可能跟其它实现不兼容

websocket server did not response to the client

hi ,
I am trying to modifying the websocket test scripts ,
var WebSocket = require('ws');
var ws = new WebSocket('ws://root:[email protected]:8898/web2');
ws.on('open', function open() {
ws.send('hello');

console.log('open');
});

ws.on('message', function (data) {
console.log(data);
process.exit(1);
ws.close();
});

but in the mongo client , I could not find the data was injected to the lan server ... can you please clarifying if the websocket is working ?
thanks

CentOS 6.5 32bit Installation Guide

Install CentOS 6.5 32bit

why CentOS 6.5, not 7.0. Because I hope I can build a Environment with the least cost. I choose the CentOS 6.5 which can work perfectly in a 512MB RAM computer.

Install MongoDB

  1. Download mongodb-linux-i686-3.0.5.gz for the 32bit linux system
  2. Shutdown SELINUX
    vi /etc/selinux/config
    #SELINUX=enforcing
    #SELINUXTYPE=targeted
    SELINUX=disabled
    :wq!
    setenforce 0
  3. tar zxvf mongodb-linux-i686-3.0.5.gz
  4. mv mongodb-linux-i686-3.0.5 /usr/local/mongodb
  5. mkdir -p /data/mongodb/mongodb_data/
  6. mkdir -p /data/mongodb/mongodb_log/
  7. /usr/local/mongodb/bin/mongod --port 27017 --fork --dbpath=/data/mongodb/mongodb_data/ --logpath=/data/mongodb/mongodb_log/mongodb.log --logappend

Install sqlite3

  1. make sure your connected to the internet
  2. yum install sqlite

Install node.js

  1. download node-v0.12.7-linux-x86.tar.gz for 32bit os
  2. tar zxvf node-v0.12.7-linux-x86.tar.gz
  3. mv node-v0.12.7-linux-x86.tar /usr/local/nodejs
  4. export PATH=$PATH:/usr/local/nodejs/bin/

Install lan

  1. download lan-master.zip via https://codeload.github.com/phodal/lan/zip/master
  2. yum install unzip
  3. unzip lan-master.zip
  4. cd lan-master
  5. npm install

npm jobs/cron.js 执行不了

我去phodal-archive/lan-jobs-cron下载了cron.js 和sqlite2mongodb.js,执行npm jobs/cron.js 依然不成功,不知道为什么
[root@cent63 lan]# npm jobs/cron.js

Usage: npm

where is one of:
access, add-user, adduser, apihelp, author, bin, bugs, c,
cache, completion, config, ddp, dedupe, deprecate, dist-tag,
dist-tags, docs, edit, explore, faq, find, find-dupes, get,
help, help-search, home, i, info, init, install, issues, la,
link, list, ll, ln, login, logout, ls, outdated, owner,
pack, prefix, prune, publish, r, rb, rebuild, remove, repo,
restart, rm, root, run-script, s, se, search, set, show,
shrinkwrap, star, stars, start, stop, t, tag, test, tst, un,
uninstall, unlink, unpublish, unstar, up, update, upgrade,
v, verison, version, view, whoami

npm -h quick help on
npm -l display full usage info
npm faq commonly asked questions
npm help search for help on
npm help npm involved overview

Specify configs in the ini-formatted file:
/root/.npmrc
or on the command line via: npm --key value
Config info can be viewed via: npm help config

[email protected] /root/node0124x64/lib/node_modules/npm

我想问下,这个包中间有mqtt broker吗?

对不起,我是level 0 程序员,我想问下,这个包中间有mqtt broker吗?我翻了下没有看到。如果没有,你当时这个项目用的是什么mqtt broker?我想找个好点的开源broker运行在自己的服务器上,但是mosca太过陈旧并且有很多问题。谢谢你!

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.