2019年10月

Linux下软件环境安装(10)-dnsmasq安装与配置

sudo apt-get -y install dnsmasq

sudo vi /etc/dnsmasq.conf
address=/double-click.net/127.0.0.1
server=192.168.1.1

ping double-click.net
PING double-click.net (91.195.240.126) 56(84) bytes of data

cat /etc/resolv.conf
sudo /etc/init.d/dnsmasq restart

参考文献:
https://www.cnblogs.com/ilanni/p/4927332.html

ubuntu server 18.04安装桌面

sudo apt-get install ubuntu-desktop
切换到命令行启动
参考https://blog.csdn.net/bjarnecpp/article/details/96897234

sudo vi /etc/default/grub
GRUB_CMDLINE_LINUX_DEFAULT="text"
GRUB_TERMINAL=console

sudo update-grub

sudo systemctl set-default multi-user.target

sudo reboot

还原

sudo systemctl set-default graphical.target

Ctrl+F6 进命令行

Linux下软件环境安装(9)-influxDB安装与配置

https://portal.influxdata.com/downloads/

Telegraf - Time-Series Data Collector
InfluxDB - Time-Series Data Storage
Chronograf - Time-Series Data Visualization
Kapacitor - Time-Series Data Processing

wget https://dl.influxdata.com/influxdb/releases/influxdb_1.7.8_amd64.deb
sudo dpkg -i influxdb_1.7.8_amd64.deb

Created symlink from /etc/systemd/system/influxd.service to /lib/systemd/system/influxdb.service.
Created symlink from /etc/systemd/system/multi-user.target.wants/influxdb.service to /lib/systemd/system/influxdb.service.

sudo vi /etc/influxdb/influxdb.conf
改/home/.../influxdb
influxd config
influxd run &

influx -host 127.0.0.1
show databases
create database "gui"
use gui
show measurements
insert test,host=127.0.0.1,monitor_name=test count=2
select * from test limit 10
exit
相关操作命令:https://blog.csdn.net/x541211190/article/details/82948201

https://grafana.com/docs/installation/debian/
https://grafana.com/grafana/download?platform=linux
wget https://dl.grafana.com/oss/release/grafana_6.4.1_amd64.deb
sudo dpkg -i grafana_6.4.1_amd64.deb

NOT starting on installation, please execute the following statements to configure grafana to start automatically using systemd

sudo /bin/systemctl daemon-reload
sudo /bin/systemctl enable grafana-server

You can start grafana-server by executing

sudo /bin/systemctl start grafana-server

玩电表,正泰DDSU666型单相电子式电能表

正泰DDSU666型单相电子式电能表符合《DL/T645-2007多功能电能表通信协议》支持485通信
00000000-电能量-组合有功电能
02010100-变量-A电压
02020100-变量-A电流
02030000-变量-有功功率
02040100-变量-无功功率
02060000-变量-功率因数
02800002-变量-电网频率

正泰DDSU666表,接线方式,入线L接1、N线接3,485线A接7、B接8,通信速率2400

实例,发送
FE FE FE FE 68 02 49 03 24 08 19 68 11 04 33 34 34 35 48 16
4个字节FE,唤醒对方,两段起始符68,结束符16,表号(通讯地址)190824034902,11读数据命令
04数据长度,33 34 34 35对应电压各位+33H,校验码48为68开始到35各位和的末位
接收
FE FE FE FE 68 02 49 03 24 08 19 68 91 06 00 01 01 02 90 22 E2 16
4个字节FE,唤醒对方,两段起始符68,结束符16,表号(通讯地址)190824034902,91读数据应答
06数据长度,00 01 01 02对应电压,90 22对应电压229.0V,校验码E2为68开始到22各位和的末位