1 Star 0 Fork 0

wujehy / SimpleIoT

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
克隆/下载
贡献代码
同步代码
取消
提示: 由于 Git 不支持空文件夾,创建文件夹后会生成空的 .keep 文件
Loading...
README
LGPL-3.0

使用说明

##2019.05.15 更新

因为家庭 原因 要找工作了  这是 最新版本的 

开发文档 在物联网系统开发教程.pdf

其他具体在 demo 有 例子 ,彩蛋 在源码 里面

demo 有 lora 和 zigbee 组网的简单例子

同时 更新 arduino 的 采集 实例.

2019.04.28 更新

 安卓 实例,实现远程传感器获取 以及远程动作控制

 具体目录: Android_SDK27_Demo下

 可以参看文档 Android_SDK27_Demo/README.md

具体实例需要 zigbee (一开始开发的那套) 一块联动,可以实现 远程控制和数据采集展示

2019.04.27 更新

修改 java 的桥接层 ,java 主要以 控制为主  增加 contorl 的方法 进行 指令下发 

    /**
     * 发送控制 指令的方法
     *
     * @param objPanid 要控制的panid
     * @param data 控制的指令
     * @return  返回 指令成功状态 
     */
    public String Control(String objPanid, String data)

2019.04.26 更新

 增加 java 的桥接层 支持

 具体说明 查看 Java_Lib_GeeJoans/README.md

运行方式 进入 Java_Lib_GeeJoans 目录

直接运行 (windows bat 暂时没有测试 )

$ sh runTest.sh 

#或者
$ chmod +x runTest.sh
$ ./runTest.sh

2019.04.23 更新

 增加ESP32 Nodemcu 的 接入,实例目录在 ESP32_nodemcu目录下

 操作说明:

1. 将 ESP32_nodemcu/nodemcu_float_master_20190328-0843.bin 烧录到 ESP 模块

2. 解压 ESP32_nodemcu/ESPlorer.zip 并运行 ESPlorer/ESPlorer.jar 文件 打开控制面板

3. 点击面板对话框的  Heap 按钮激活 操作 窗口按钮被激活 同时返回类似,表示可以下一步操作

> =node.heap()
25152
> 

4. 修改 实例代码的配置信息 

--网络修改
--ESP32_nodemcu/wificon.lua
station_cfg={}
station_cfg.ssid="8404"  //你的wifi 名
station_cfg.pwd="8404@gcp"  //wifi密码

---数据修改
panid 获取通过 官网 创建的设备 里获得
--[[信息配置]]
panid = "578aea14857ee64bba27e823e9d93dac" //修改成 你的 panid
host = "http://iotgeek.top:8080"    //云服务后台 
mqtthost = "iotgeek.top" //mqtt服务器
mqttport = 1883  //mqtt 服务器 端口

5. 然后在 左边代码框 依次打开 ESP32_nodemcu 目录下 的*.lua 文件 依次 上传到Esp开发板

操作动作是 点击 代码框 下面的 Save to Esp 即可
在右边窗口 边 有一个 Reload 按键可以查看 是否上传成功
*注意:后期修改那个文件就更新那个文件

6. 完成

配置好 init.lua  后就可以开机运行 

2019.04.20 更新

 增加 基于 simpleIoT 开发 的 GeeJoansIoT 成功部署 官网

2019.04.15 更新

增加 arduino 接入 文件 ArduinoSensorDemo/IoTServer/IoTServer.h 是 处理的 头文件 只需要 简单配置就可以生成 数据流


IoTData_t data; //创建 数据对象
 void setup() {
   // put your setup code here, to run once:
   Serial.begin(9600);//配置 串口 波特率 9600
     data.setAppid(Appid_WENDU);//设置成 温度 的 appid
     data.setLen(2); //数据只有一个
 }

void loop() {
 // put your main code here, to run repeatedly:
 //  三个参数 地一个参数  是位置  第二个参数 是 数据类型 第三个参数 是 具体数值
 //这里的数据是测试 具体更具采集到的数据 决定  所有数值 均 x100  在输入
 //例如 6.12 ,输入的数据就是 612;
 //如果有两个 数据 则len设为 2  然后添加2个 setData
data.setData(1,WENDU,612);// 配置 数据

//测试
data.setData(2,SHIDU,0x1234);// 配置 数据

 //输出信息
//data.getData() 获取数据指针 data.getLen() 获取数据长度 限定指针的偏移
Serial.write(data.getData(),data.getLen());


delay(5000);//休眠 5 秒

}

项目说明

​ 该项目是一个使用python 实现的 一个简单的 物联网 简易平台,目的是为了 让很多技术知识体系不够完善的 程序员 能够 快速 构建一个 物联网应用场景.甚至只要一台电脑就可以 实现 物联网的三个层 的开发.

​ 项目基于python 3 开发 实现的精简 ,代码数 暂时不超过 1k 行,可以让 初学者 快速了解 整套系统.

​ 第一版本 未添加数据库支持 ,使用 变量储存实时信息, 刚学玩 python 都可以直接上手.

系统架构

这套系统由三部分组成

  1. 服务端程序

    服务端 是基于django 的 web 程序 是 系统的 处理核心

    主要实现程序在

    Server/InterViews/Views/Web.py

    主要实现的 功能是 数据上传的功能 ( upload),数据展示(getData )提供给前端进行实时数据 的查看,以及提供 控制接口 (control)用于前端手动控制信息的 输入 和 状态信息(status) 查询,让 桥接层 获得处理信息

    同时 提供一个 数据处理方法procData ,在 每次 数据上传时触发一次处理,可用于 检测实时数据 的 后台处理

    如果有 其他的处理 程序 可以自行将 处理指令 put 到 msgQueue 的队列里 ,只要是有效的指令 ,桥接层就可以 处理.

  2. 桥接层程序

    桥接层 是 与 网关类的 设备连接 ,每个 网关 都有一个 panid 可以自己设置 .程序主要实现在 Bridge/Bridge.py 文件,panid 属性 就是 个域网 id 不同的 网关 设置为 不同 ,当然 可以 让 一个 采集 节点 就设置成 一个 panid ,

    每个panid 可以 有 多个 序列号(Appid) 最大 容量 是 0xffff 个 实际容纳大小 由 服务器的内存决定.序列号是 用于区别同一个域网下 不同终端的 信息

    注意:也可以 多个 节点同一个panid 但是 后台信息 只会 将信息发送到 一个 panid 的 桥接程序中 ,所以 如果要这样做的话 建议 仅 传感器 采集数据功能的 节点 可以设置成 同一panid 但是 不用节点的序列号 和 数据id 要不同否则数据会重合

    创建 桥接层 的时候 需要配置 接受的 串口接口 ,其他实现方式 可以去自行实现 实例使用最简单的串口.可以直接购买两个 ch340 互通 进行测试系统.

    桥阶层 提供 2 个 cc2530 的 hex 固件 ,可以直接烧录 使用

    其中 测试程序使用DHT 11 温湿度 传感器进行 数据采集 发送到 服务层,信号采集接口是 P07

    而 控制的 io 接口使用的是 P10 有cc2530 的 同学可以 实物测试.

    控制io 是 指令下发的 执行器 可以自定执行器 指令 ,在 后端的 procData 或者 control 进行指令 生成 即可 下发到终端

    桥接层 实现的主要方法 有 getSerialtoQueue_Thread 获取 串口数据的线程 将 串口读取到的信息 存进发送队列 ,sendtoServer 发送到 服务器的 功能 ,当 队列里面有数据的时候 就 发送信息到 服务器,和 Recv_Mqtt 接受消息的 线程,当 服务端 有 控制 指令的时候 回去下载 指令信息 然后广播到 终端 .

  3. 应用层程序(接口以实现,页面暂未实现)

    应用层 打算简单做个demo 将 getData 的 数据进行 处理 显示

    同时 写一个 简单的 控制 页面 .

其他 链接

​ 指令集文档: 指令集文档

​ 指令集 是 硬件部分的 统一数据标准.只要符合这个 标准 这套系统 就可以 完美运行.

​ 实验文档演示:示例演示

​ 这和实例是 分成两部分 进行 使用 调试方式 .

​ 实际只要 将 数据接入 即可 , 已测试 平台 树莓派 ,linux pc .windows pc

​ 可能存在问题 :如果树莓派 直接运行程序 可能应为 编码 问题 服务层一直重载

​ 如果本地 使用的话需要 部署 mqtt 服务器 ,远程可以直接 使用 我的阿里云 服务器 的mqtt 不过 同时 发送 需要 修改i mqtt 的 接受指令 防止 同时 多个人 接受 到 相同的 指令 导致 错误的处理 , 不过 后端有 空消息处理 只是会 频繁调用 推送信息而已

备注

如果觉得 该项目 对你有帮助 ,可以捐赠
GNU LESSER GENERAL PUBLIC LICENSE Version 3, 29 June 2007 Copyright (C) 2007 Free Software Foundation, Inc. <http://fsf.org/> Everyone is permitted to copy and distribute verbatim copies of this license document, but changing it is not allowed. This version of the GNU Lesser General Public License incorporates the terms and conditions of version 3 of the GNU General Public License, supplemented by the additional permissions listed below. 0. Additional Definitions. As used herein, "this License" refers to version 3 of the GNU Lesser General Public License, and the "GNU GPL" refers to version 3 of the GNU General Public License. "The Library" refers to a covered work governed by this License, other than an Application or a Combined Work as defined below. An "Application" is any work that makes use of an interface provided by the Library, but which is not otherwise based on the Library. Defining a subclass of a class defined by the Library is deemed a mode of using an interface provided by the Library. A "Combined Work" is a work produced by combining or linking an Application with the Library. The particular version of the Library with which the Combined Work was made is also called the "Linked Version". The "Minimal Corresponding Source" for a Combined Work means the Corresponding Source for the Combined Work, excluding any source code for portions of the Combined Work that, considered in isolation, are based on the Application, and not on the Linked Version. The "Corresponding Application Code" for a Combined Work means the object code and/or source code for the Application, including any data and utility programs needed for reproducing the Combined Work from the Application, but excluding the System Libraries of the Combined Work. 1. Exception to Section 3 of the GNU GPL. You may convey a covered work under sections 3 and 4 of this License without being bound by section 3 of the GNU GPL. 2. Conveying Modified Versions. If you modify a copy of the Library, and, in your modifications, a facility refers to a function or data to be supplied by an Application that uses the facility (other than as an argument passed when the facility is invoked), then you may convey a copy of the modified version: a) under this License, provided that you make a good faith effort to ensure that, in the event an Application does not supply the function or data, the facility still operates, and performs whatever part of its purpose remains meaningful, or b) under the GNU GPL, with none of the additional permissions of this License applicable to that copy. 3. Object Code Incorporating Material from Library Header Files. The object code form of an Application may incorporate material from a header file that is part of the Library. You may convey such object code under terms of your choice, provided that, if the incorporated material is not limited to numerical parameters, data structure layouts and accessors, or small macros, inline functions and templates (ten or fewer lines in length), you do both of the following: a) Give prominent notice with each copy of the object code that the Library is used in it and that the Library and its use are covered by this License. b) Accompany the object code with a copy of the GNU GPL and this license document. 4. Combined Works. You may convey a Combined Work under terms of your choice that, taken together, effectively do not restrict modification of the portions of the Library contained in the Combined Work and reverse engineering for debugging such modifications, if you also do each of the following: a) Give prominent notice with each copy of the Combined Work that the Library is used in it and that the Library and its use are covered by this License. b) Accompany the Combined Work with a copy of the GNU GPL and this license document. c) For a Combined Work that displays copyright notices during execution, include the copyright notice for the Library among these notices, as well as a reference directing the user to the copies of the GNU GPL and this license document. d) Do one of the following: 0) Convey the Minimal Corresponding Source under the terms of this License, and the Corresponding Application Code in a form suitable for, and under terms that permit, the user to recombine or relink the Application with a modified version of the Linked Version to produce a modified Combined Work, in the manner specified by section 6 of the GNU GPL for conveying Corresponding Source. 1) Use a suitable shared library mechanism for linking with the Library. A suitable mechanism is one that (a) uses at run time a copy of the Library already present on the user's computer system, and (b) will operate properly with a modified version of the Library that is interface-compatible with the Linked Version. e) Provide Installation Information, but only if you would otherwise be required to provide such information under section 6 of the GNU GPL, and only to the extent that such information is necessary to install and execute a modified version of the Combined Work produced by recombining or relinking the Application with a modified version of the Linked Version. (If you use option 4d0, the Installation Information must accompany the Minimal Corresponding Source and Corresponding Application Code. If you use option 4d1, you must provide the Installation Information in the manner specified by section 6 of the GNU GPL for conveying Corresponding Source.) 5. Combined Libraries. You may place library facilities that are a work based on the Library side by side in a single library together with other library facilities that are not Applications and are not covered by this License, and convey such a combined library under terms of your choice, if you do both of the following: a) Accompany the combined library with a copy of the same work based on the Library, uncombined with any other library facilities, conveyed under the terms of this License. b) Give prominent notice with the combined library that part of it is a work based on the Library, and explaining where to find the accompanying uncombined form of the same work. 6. Revised Versions of the GNU Lesser General Public License. The Free Software Foundation may publish revised and/or new versions of the GNU Lesser General Public License from time to time. Such new versions will be similar in spirit to the present version, but may differ in detail to address new problems or concerns. Each version is given a distinguishing version number. If the Library as you received it specifies that a certain numbered version of the GNU Lesser General Public License "or any later version" applies to it, you have the option of following the terms and conditions either of that published version or of any later version published by the Free Software Foundation. If the Library as you received it does not specify a version number of the GNU Lesser General Public License, you may choose any version of the GNU Lesser General Public License ever published by the Free Software Foundation. If the Library as you received it specifies that a proxy can decide whether future versions of the GNU Lesser General Public License shall apply, that proxy's public statement of acceptance of any version is permanent authorization for you to choose that version for the Library.

简介

简单东西 一个简单的物联网的实现 展开 收起
Python
LGPL-3.0
取消

发行版 (2)

全部

贡献者

全部

近期动态

加载更多
不能加载更多了
Python
1
https://gitee.com/wujehy/SimpleIoT.git
git@gitee.com:wujehy/SimpleIoT.git
wujehy
SimpleIoT
SimpleIoT
dev

搜索帮助