6brain 中文文档教程
6brain
6brain是六元传感器的核心。 它负责数据的收集和传输。 它依赖于 6sense 进行数据收集和 quipu< /a> 用于通过短信传输。
只需使用 node index.js
开始一切。 您应该使用以下模式创建一个名为 PRIVATE.json
的文件:
{
"connectInfo":
{
"host":"127.0.0.1",
"port":1111,
"name":"+33600000000",
"smsServer":"+33611111111",
"authorizedNumbers":["+33611111111", "+33622222222"],
"smsMonitoring":false
},
"PIN":0000
}
connectInfo:
host:您要连接到
的 tcp 服务器端口:tcp 服务器
名称的端口:传感器的名称(电话号码在 6element 的情况下)
smsServer :当 smsMonitoring 为真时,您要向其发送数据的
电话号码 authorizedNumbers :可以向传感器发送命令的电话号码
smsMonitoring :true = 通过 TCP + SMS 发送数据,false = 仅 TCP
PIN
: SIM 卡的 PIN 码。
Commands
6brain 不仅推送数据,它还可以响应短信刺激:
status
send back a message with the current statusip
sends back the ipopenTunnel:2222:9632:kerrigan
opens a reverse ssh tunnel towardkerrigan
(must be set in~/.ssh/config
) and send a message once the tunnel is up.
Dockerizing
如果你愿意,你可以在容器中运行所有东西。 请注意,该映像是为 arm7 设备构建的。
docker build -t=ants/6brain:v1 .
docker run -d --restart=always --privileged --net=host -v /dev:/dev ants/6brain:v1
6brain
6brain is the core of the 6element sensors. It is responsible for data collection and transmission. It depense on 6sense for data collection and quipu for transmission through sms.
Juste use node index.js
to start everything. You should create a file called PRIVATE.json
with this pattern:
{
"connectInfo":
{
"host":"127.0.0.1",
"port":1111,
"name":"+33600000000",
"smsServer":"+33611111111",
"authorizedNumbers":["+33611111111", "+33622222222"],
"smsMonitoring":false
},
"PIN":0000
}
connectInfo :
host : the tcp server which you want to connect to
port : the port of the tcp server
name : name of the sensor (phone number in the case of 6element)
smsServer : the phone number you want to send data to when smsMonitoring is true
authorizedNumbers : phone numbers which can send command to the sensor
smsMonitoring : true = send data by TCP + SMS, false = only TCP
PIN :
The PIN number of the SIM card.
Commands
6brain not only pushed the data, it can respond to sms stimuli:
status
send back a message with the current statusip
sends back the ipopenTunnel:2222:9632:kerrigan
opens a reverse ssh tunnel towardkerrigan
(must be set in~/.ssh/config
) and send a message once the tunnel is up.
Dockerizing
You can run everything in a container if you like. Careful the image is build for arm7 devices.
docker build -t=ants/6brain:v1 .
docker run -d --restart=always --privileged --net=host -v /dev:/dev ants/6brain:v1