commit | author | age
|
e30a4c
|
1 |
|
GW |
2 |
[common] |
|
3 |
id="RPI3B#01" |
|
4 |
|
|
5 |
[logger] |
|
6 |
|
|
7 |
# 日志记录文件 |
|
8 |
file=/tmp/iotd.log |
|
9 |
|
|
10 |
# 日志级别: 0:error 1:warnning 2:info 3:debug 4:trace |
|
11 |
level=2 |
|
12 |
|
|
13 |
# 日志回滚大小 |
|
14 |
size=1024 |
|
15 |
|
|
16 |
|
|
17 |
#+-------------------------------------------+ |
|
18 |
#| Hardware configuration | |
|
19 |
#+-------------------------------------------+ |
|
20 |
|
|
21 |
# 树莓派连接的外设信息,0:禁用或未连接 其他: 使能或相关硬件连接的Pin管脚(BCM) |
|
22 |
[hardware] |
|
23 |
|
|
24 |
# LED或继电器等GPIO输出控制, 格式: {名称:BCM编码:控制电平} |
f7889e
|
25 |
# Relay(1) <-> 19 Relay(2) <-> 26 |
e30a4c
|
26 |
gpio_outpin={light_indoor:19:1},{light_hallway:26:1} |
GW |
27 |
|
|
28 |
# 红外探测到人后,继电器控制灯亮的时长 |
|
29 |
light_intval=15 |
|
30 |
|
|
31 |
# 按键或红外感应灯GPIO输入控制, 格式: {名称:BCM编码:控制:电平} |
f7889e
|
32 |
# Indoor(23)<->(black/gray) Hallway(24)<->(yellow/red) |
e30a4c
|
33 |
gpio_inpin={infrared_indoor:23:1},{infrared_hallway:24:1} |
GW |
34 |
|
|
35 |
# 是否使能 TSL2561 光强传感器模块,0:禁用 X:光强阈值 |
|
36 |
lux=1 |
|
37 |
lux_threshold=0.10 |
|
38 |
|
|
39 |
# 是否使能 DS18b20 温度传感器模块,0:禁用 1:是能 |
|
40 |
# ds18b20=1 |
|
41 |
|
|
42 |
# 是否使能 SHT2X 温湿度传感器模块,0:禁用 1:使能 |
|
43 |
# sht2x=0 |
|
44 |
|
|
45 |
#+-------------------------------------------+ |
|
46 |
#| MQTT configuration | |
|
47 |
#+-------------------------------------------+ |
|
48 |
|
|
49 |
[broker] |
|
50 |
|
|
51 |
# broker 服务器地址和端口号 |
|
52 |
hostname="weike-iot.com" |
|
53 |
port=10883 |
|
54 |
|
|
55 |
# broker 认证连接的用户名和密码 |
|
56 |
username="lingyun" |
|
57 |
password="lingyun" |
|
58 |
|
|
59 |
# broker给subsciber和publisher发送PING报文保持 keepalive 的时间周期,单位是秒 |
|
60 |
keepalive=30 |
|
61 |
|
|
62 |
# Qos0: 发送者只发送一次消息,不进行重试,Broker不会返回确认消息。在Qos0情况下,Broker可能没有接受到消息 |
|
63 |
# Qos1: 发送者最少发送一次消息,确保消息到达Broker,Broker需要返回确认消息PUBACK。在Qos1情况下,Broker可能接受到重复消息 |
|
64 |
# Qos2: Qos2使用两阶段确认来保证消息的不丢失和不重复。在Qos2情况下,Broker肯定会收到消息,且只收到一次 |
|
65 |
|
|
66 |
|
|
67 |
[subsciber] |
|
68 |
|
|
69 |
subTopic="$Sys/Studio/Downlink/iotd" |
|
70 |
subQos=0 |
|
71 |
|
|
72 |
|
|
73 |
[publisher] |
|
74 |
|
|
75 |
pubTopic="$Sys/Studio/Uplink/" |
|
76 |
pubQos=0 |
|
77 |
|
|
78 |
# Publisher上报传感器数据的周期,单位是秒 |
|
79 |
interval=60 |
|
80 |
|
|
81 |
|