IOT

CAN总线消息格式DBC_Format

CAN消息总线格式 DBC格式 BO_ 500 IO_DEBUG: 4 IO SG_ IO_DEBUG_test_unsigned : 0|8@1+ (1,0) [0|0] "" DBG 说明: The message name is IO_DEBUG and MID is 500 (decimal), and the length is 4 bytes (though we only need 1 for 8-bit signal) The sender is IO 0|8: The unsigned signal starts at bit position 0, and the size of this signal is 8 (1,0): The scale and offset (discussed later) [0|0]: Min and Max is not defined (discussed later) ””: There are no units (it could be, for instance “inches”) @1+: Defines that the signal is little-endian, and unsigned: Never change this!

Edgex Onvif Device Dev Setup

启动EDGEX核心服务 使用容器主机网络 wget https://raw.githubusercontent.com/edgexfoundry/edgex-compose/jakarta/docker-compose-no-secty.yml 在开发环境使用host网络,便于核心服务和各种设备能在同一个子网,替换 networks: edgex-network: {} 为 network_mode: host CONSUL 配置CONSUL绑定到指定以太网卡 environment: CONSUL_BIND_INTERFACE: ens3 配置DNS /etc/hosts 10.166.44.182 edgex-core-consul 10.166.44.182 edgex-core-command 10.166.44.182 edgex-redis 10.166.44.182 edgex-core-metadata 10.166.44.182 edgex-core-data 10.166.44.182 edgex-support-notifications 10.166.44.182 edgex-support-scheduler 10.166.44.182 edgex-ui-go 10.166.44.182 edgex-kuiper 10.166.44.182 edgex-app-rules-engine 启动核心服务 docker-compose -f docker-compose-no-secty.yml up -d 检查核心服务启动正常 docker logs -f edgex-core-command edgex-core-data edgex-core-metadata 在本地启动设备服务 git clone [email protected]:edgexfoundry/device-camera-go.git 修改cmd\res\configuration.toml 注册服务,消息队列,核心服务的所在的主机配置 [Registry] Type = "consul" Host = "10.

如何实现Edgex设备服务

加载设备配置文件 device-sdk-go: service.init.go: driver.Initialize initializeOnvifClient onvif4go.NewOnvifDevice.Initialize() provision.LoadProfiles(ds.config.Device.ProfilesDir, dic) provision.LoadDevices 驱动服务客户端初始化与核心数据和命令服务 clients.BootstrapHandler -> InitDependencyClients // InitDependencyClients triggers Service Client Initializer to establish connection to Metadata and Core Data Services // through Metadata Client and Core Data Client. // Service Client Initializer also needs to check the service status of Metadata and Core Data Services, // because they are important dependencies of Device Service. // The initialization process should be pending until Metadata Service and Core Data Service are both available.

搭建Edgex设备服务开发环境

搭建EDGEX设备服务开发环境 EDGEX简介 EdgeX Foundry 项目成立于2017年,由Linux 基金会主持,目前已经拥有75个会员, 包括重量级的SAMSUNG,Dell,AMD,ANALOG DEVICES … 但其中最重要的角色其实是戴尔。它为EdgeX Foundry提供该公司采用Apache 2.0许可证的FUSE源代码。FUSE包括10多种微服务和12500多万行代码,它们在连接标准、边缘分析、安全、系统管理和服务之间提供了互操作性。FUSE 是Dell 为了拓展边缘计算物联网服务而发展出来的,基于Java SPRING CLOUD 的微服务框架软件。这套软件最大的特征是中立于任何硬件平台和操作系统,高度模块化,可自由扩展。Dell 从私有化完成的那天开始,我们见到它一系列的并购,其中并购VMware,EMC 等动作,都直接剑指云计算和物联网技术。FUSE 的发布,更昭示了Dell谋求转型的决心。物联网的繁荣非常地依赖于物联网生态企业,全球大型IT 公司谋求物联网布局,都会提供框架软件,再培养生态伙伴来形成落地应用。而在生态伙伴的培养过程中,开源的基础框架软件是非常容易被理解和吸收的。 这也是Dell 选择跟Linux 基金会合作,并捐赠和完善代码的重要原因:Dell 需要庞大的生态伙伴,而Linux 具有开源软件界强大的号召力和影响力。 EdgeX Foundry原来是用Java写的,导致平台体积庞大,占用资源,后来Linux基金会用Go语言对其进行了重构. EdgeX Foundry是一系列松耦合、开源的微服务集合。该微服务集合构成了四个微服务层及两个增强的基础系统服务,这四个微服务层包含了从物理域数据采集到信息域数据处理等一系列的服务,另外两个基础系统服务为该四个服务层提供支撑服务。 四个微服务层分别是: 设备服务负责采集数据及控制设备功能。 核心服务负责本地存储分析和转发数据,以及控制命令下发。 支持服务负责日志记录、任务调度、数据清理、规则引擎和告警通知。 应用服务/导出服务负责上传数据到云端或第三方信息系统,以及接收控制命令转发给核心服务。 两个增强基础系统服务: 安全服务、管理服务这两个软件模块虽然不直接处理边缘计算的功能性业务,但是对于边缘计算的安全性和易用性来说很重要 启动EDGEX核心服务 wget https://raw.githubusercontent.com/edgexfoundry/edgex-compose/jakarta/docker-compose-no-secty.yml docker-compose -f docker-compose-no-secty.yml up -d 打开数据和控制服务调试开关 在consul里面配置应用: http://localhost:8500/ui/dc1/kv/edgex/appservices/2.0/app-rules-engine/Writable/LogLevel/edit 修改INFO为DEBUG 在IDE里面启动设备服务 以IP摄像头设备服务为例 打开WEBCAM webcam-to-ip-camera 配置开发环境 git clone [email protected]:edgexfoundry/device-camera-go.git git checkout jakarta cd device-camera-go go mod tidy set EDGEX_SECURITY_SECRET_STORE=false 调整IDE的当前工作目录为:device-camera-go\cmd 否则,设备服务启动会找不到设备配置文件。

Mainflux Dev Setup

BUILD mkdir -p $GOPATH/src/github.com/mailflux git clone https://github.com/wubigo/mainflux.git cd github.com/mailflux/mailflux/ make make dockers_dev make run Provision the System mainflux-cli provision test GET TOKEN curl -k https://172.21.53.253/tokens { "email": "[email protected]", "password": "12345678" }

Connect KEPServer to Ali IoT

Configure an MQTT Client Agent within the IoT Gateway Plug-In for KEPServerEX to send data to Ali IoT. The connection can be made using MQTT over Transmission Control Protocol (TCP) and MQTT over Transport Layer Security (TLS). set up Kepware KEPServerEX IoT Gateway on Windows to connect with the MQTT bridge of IoT Core to push streaming data to Cloud and send control messages from IoT Core back to KEPServerEX

Webcam to IP Camera

摄像头的区别 USB vs RTSP vs ONVIF If we use USB cameras we do not need the camera url and some functions like moving, zooming etc. will not be available. In the case of RTSP cameras and ONVIF cameras there are more functions available. The difference between the RTSP camera and the ONVIF camera is the following: the RTSP camera has only one stream in comparsion with the ONVIF camera having multiple streams at a time

MQTT vs HTTP for IoT

While HTTP is a good choice for displaying information only once, MQTT is the solution whenever you want to enable communication (exchanging messages (data) ) frequently. MQTT points out its ability to hold connections open and its way of handling data formats. Both enable successful, reliable message transfer. On the other hand, if you do not exchange messages frequently, HTTP should be your choice. 连接 keep-connection-open vs request-response MQTT is superior to HTTP if you have devices that communicate regularly.

物联网核心构件

物联网架构 An IoT Architecture consists of the following: - Peripherals, which we call “things”. - Sensors attached to these things to gauge and transmit their data and information. - Network connection through which data is transmitted (wireless or wired). - Remote Cloud to which data is transmitted by the system. 物联网核心构件 Sensors Microcontrollers Gateways Applications 物联网分层架构

IOT Notes

EMQX单节点吞吐量 EMQX 5.0 23个节点的集群支持:(100 million MQTT连接 + 1 million message)每秒 每个节点的吞吐量为4万每秒 The dispersed nature of the Internet of Things (IoT) presents a major operational challenge that is uncommon in the traditional Internet or enterprise networks[5]. Devices that are managed together — say a fleet of railcars — are not physically colocated. Instead, they are widely geographically distributed. The operational approaches for management and security used in enterprise networks, where most hosts are densely contained in buildings or campuses, do not translate to the IoT.