學習日誌
2021年8月6日 星期五
Ping
Ping的返回訊息有:
Request Timed Out:這個訊息表示對方主機可以到達到TIME OUT,這種情況通常是為對方拒絕接收你發給它的數據包造成數據包丟失。大多數的原因可能是對方裝有防火牆或已下線。
Destination host Unreachable:這個訊息表示對方主機不存在或者沒有跟對方建立連線。這裡要說明一下"destination host unreachable"和"time out"的區別,如果所經過的路由器的路由表中具有到達目標的路由,而目標因為其它原因不可到達,這時候會出現"time out",如果路由表中連到達目標的路由都沒有,那就會出現"destination host unreachable"。
Bad IP address:這個訊息表示你可能沒有連線到DNS伺服器所以無法解析這個IP位址,也可能是IP位址不存在。
Source quench received:訊息比較特殊,它出現的機率很少。它表示對方或中途的伺服器繁忙無法回應。
所以:
Request time out:當所經過的路由器的路由表中具有到達目標的路由(理論上可達),但是卻一直沒收到設備的回應,這時候會出現"Request time out"。也就是你ping傳送的封包理論上是能送達對方,卻沒收到回應的封包,有可能的障礙是:防火牆、設定不回應、回應的封包丟失(相關網路設定錯誤)等。(路是通的,只是沒回應)
Destination host unreachable:當路由表中連到達目標的路由都沒有時,ping這個設備就會出現"Destination host unreachable"。也就是:router上沒有到達對方的路徑資訊,不 知道在哪裡,封包該往哪裡送。(找不到抵達對方的路)
不管是Destination host unreachable 和 Request time out可能原因都有很多,還有待整理和釐清。
Destination Host Unreachable
This message indicates one of two problems: either the local system has no route to the desired destination, or a remote router reports that it has no route to the destination.
If the message is simply "Destination Host Unreachable," then there is no route from the local system, and the packets to be sent were never put on the wire.
If the message is "Reply From < IP address >: Destination Host Unreachable," then the routing problem occurred at a remote router, whose address is indicated by the "< IP address >" field.
Request Timed Out
This message indicates that no Echo Reply messages were received within the default time of 1 second. This can be due to many different causes; the most common include network congestion, failure of the ARP request, packet filtering, routing error, or a silent discard.
2020年10月22日 星期四
Sqlite3 語法
https://seacatcry.pixnet.net/blog/post/20104966
root@imx6dlsabresd:~# sqlite3 /etc/system.db
SQLite version 3.14.1 2016-08-11 18:53:32
Enter ".help" for usage hints.
sqlite> .table
battery_parameter extra_func_code pre_modbus sensor_unit
canbus modbus_client rs485list system_config
exist_device modbus_server scanType system_time
sqlite>.schema
CREATE TABLE rs485list (Type INT NOT NULL, Func_code INT NOT NULL, Start_addr1 INT NOT NULL, Start_addr2 INT NOT NULL, Data_addr1 INT NOT NULL, Data_addr2 INT NOT NULL, Res_len INT NOT NULL, RW INT NOT NULL, PRIMARY KEY (Type));
CREATE TABLE battery_parameter (code INT PRIMARY KEY, type INT, battery_set INT, battery_unit INT, battery_capacity INT, in_i_limit INT, out_i_limit INT, floating_chg_v float, high_v_malfunc float, low_v_warning float, low_v_malfunc float);
CREATE TABLE extra_func_code (Type INT PRIMARY KEY, Func_code INT);
CREATE TABLE scanType (id INT PRIMARY KEY, type INT);
CREATE TABLE canbus (id INT PRIMARY KEY, time DATETIME, bmsStatus INT, bmsFault INT, voltage float, current float, soc INT, voltMax float, voltMax_no INT, voltMin float, voltMin_no INT, tempHigh float, tempHigh_no INT, tempLow float, tempLow_no INT);
CREATE TABLE modbus_client (id INT PRIMARY KEY, time DATETIME, kwTotal float, sw3005_kvar float, sw3005_kva float, kwh float, frequency float, PF float);
CREATE TABLE pre_modbus (id INT PRIMARY KEY, spm8_kw float, spm8_kvar float, spm8_kva float, spm8_kwh float, spm8_frequency float, spm8_PF float, sw3005_kw float, sw3005_kvar float, sw3005_kva float, sw3005_kwh float, sw3005_frequency float, sw3005_PF float);
CREATE TABLE modbus_server (id INT PRIMARY KEY, time DATETIME, spm8_kwTotal float, spm8_kvar float, spm8_kva float, spm8_kwh float, spm8_frequency float, spm8_PF float, kwTotal float, sw3005_kvar float, sw3005_kva float, kwh float, frequency float, PF float);
CREATE TABLE system_config (field TEXT PRIMARY KEY, value TEXT);
CREATE TABLE sensor_unit (type TEXT, field TEXT, byte_len TEXT, formula TEXT, threshold float, name TEXT, unit TEXT);
CREATE TABLE system_time (id INT, record_datetime DATETIME);
CREATE TABLE exist_device(Type NOT NULL, Num NOT NULL);
root@imx6dlsabresd:~# sqlite3 /etc/system.db "select * from rs485list;"
15|3|0|2|0|1|2|0
18|3|0|16|0|1|2|2
24|3|0|0|0|2|4|0
26|4|0|0|0|0|4|0
0|4|0|180|0|1|2|2
25|4|0|0|0|1|2|0
9|3|0|6|0|1|2|0
10|3|0|2|0|1|2|0
11|3|0|0|0|2|4|0
16|6|0|0|0|0|0|1
21|3|0|0|0|2|4|0
root@imx6dlsabresd:~# sqlite3 /etc/system.db "select * from sensor_unit;"
24|0|2|3|80.0|humidity|%RH
24|1|2|4|38.0|temperature|℃
26|0|4|5|50.0|frequency|Hz
26|1|4|5|130.0|kw_total|kW
26|2|4|5|9999999.0|kwh|0
0|0|2|2|3.0|pcsStatus|0
0|1|2|6|0.0|pcsManual|0
18|0|2|2|2.0|waterLeakage|0
18|1|2|2|1.0|veryEarly|0
18|2|2|2|1.0|smoke|0
18|3|2|2|1.0|temperature|0
15|0|2|2|1.0|floodstatus|0
25|0|2|7|2.35|electricLeakage|V
9|0|2|1|9999999.0|brightness|Lux
10|2|2|1|60.0|co2|ppm
11|0|2|3|80.0|humidity|%RH
11|1|2|4|38.0|temperature|℃
21|0|2|1|2.0|pm2.5|ug/m3
21|1|2|1|2.0|pm10|ug/m3
10|0|2|3|80.0|humidity|%RH
10|1|2|4|38.0|temperature|℃
2019年5月10日 星期五
2019年5月9日 星期四
訂閱:
文章 (Atom)