Giter VIP home page Giter VIP logo

zigbee_coordinator_485's Introduction

##集中器(RS485接口)##

###准备工作###

  1. 需要Linux系统做开发环境;可以
    • Windows下安装虚拟机
    • 安装WindowsLinux双系统
    • 直接安装Linux单系统 推荐使用Ubuntu或者Debian
  2. 安装编译(avr-gcc)和程序下载(avrdude)环境,详见环境配置文件 ,这是在Ubuntu下的配置方法,其他系统请自行Google之

###功能简介### 主程序的主要功能是通过串口1连接ZigBee模块,和所有采集器通信, 接收采集器发送来的数据,并向采集器发送查询指令;除此之外,要通过串口0连接RS485接口来和查 询数据的终端设备通信,接受查询终端发来的查询指令,并通过RS485接口回复查询终端数据,通信过 程需要按照协议来,协议文件见*./Docs/DLT645_—2007多功能电能表通信协议.pdf*,程序中只支持部分的 命令,支持的命令见*./Docs/电网末端剩余电流互感器通信规约_修改.doc中的一部分,我们实现了的查询 命令见./Docs/Package Format.txt*,文件中的命令可以直接在sscom32软件中发送给集中器,并接收到 集中器返回的数据。

###程序主体介绍### 主程序中的程序入口是main函数,函数中先进行初始化,然后进入while 循环,循环中主要做三件事情

  • 查询ZigBee是否收到采集器的数据,并处理接收数据
  • 查询RS485接口是否接收到数据,并处理接收数据
  • 查询第二天是否来到(每隔1分钟),并通知给所有采集器 建议以函数为主阅读程序,程序中部分函数和变量是没有使用的

###其他###

  1. 程序下载步骤:
    • Makefile文件中的SOURCE改成需要编译的源文件
    • Terminal下输入make编译程序
    • Terminal下输入make dl下载程序
    • 有时候你修改了源文件或者头文件,make命令没有重新执行,你需要运行make clean来 删除生成的文件,并重新运行make来重新编译
  2. 集中器的电路原理图见*./Docs/集中器Sheet_V2.pdf*
  3. vim中通过set encoding=utf-8 来设置文本显示的编码为utf-8,通过set fileencoding=utf-8来 设置文件保存的编码为utf-8

zigbee_coordinator_485's People

Contributors

wudan3551 avatar

Watchers

James Cloos avatar

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.