/iot-echo

iot via golang

Primary LanguageGoApache License 2.0Apache-2.0

iot-echo

iot 客户端,默认支持 阿里云 iothub,支持 私有 iothub-echo

项目 地址 描述
iot-echo github.com/wolanx/iot-echo 设备端(go) 采集数据,发数据
iothub-echo github.com/wolanx/iothub-echo 服务端(java) 收数据,处理数据

Feature

  • config
    • config
    • inputs
  • rrpc /sys/{pk}/{dn}/rrpc/request/{uuid} - /sys/{pk}/{dn}/rrpc/response/{uuid}
  • ota
  • protocol
    • modbus rtu tpc
    • genibus

Config demo

provider: aliyun
server:
  host: xxx.iot-as-mqtt.cn-shanghai.aliyuncs.com
  tls: true
device:
  productKey: xxx
  deviceName: xxx
  deviceSecret: xxx
params:
metric:
channels:
  - name: tcpModbusLocal
    network: tcp
    endpoint: localhost:502
    protocol: modbus
attributes:
  - name: c
    channelRefName: tcpModbusLocal
    slaveId: 1
    address: 5
    dataType: int
  - name: d
    channelRefName: tcpModbusLocal
    slaveId: 1
    address: 5
    dataType: float

modbus rtu

channels:
  - name: mbRtu
    network: rtu
    endpoint: /dev/ttyO2
    protocol: modbus
  - name: mbTcp
    network: tcp
    endpoint: 192.168.30.66:502
    protocol: modbus

modbus tcp

attributes:
  - name: r6
    channelRefName: mbRtu
    slaveId: 10
    address: 6
    dataType: float

Geni

protocol: rtu
endpoint: /dev/ttyO4
slaveId: 1 # 0x01
address: 20
dataType: float # len 2

script

- name: bbb-a
  namespace: bbb
  script: lua hvac.lua a1
- name: bbb-b
  namespace: bbb
  script: lua hvac.lua a2