mirror of
https://github.com/oopuuu/zTC1.git
synced 2025-12-13 21:48:25 +08:00
去除多余日志, 图表最大数据量, 日志隐藏密码
This commit is contained in:
@@ -125,7 +125,7 @@ static int HttpGetAssets(httpd_request_t *req)
|
|||||||
http_log("HttpGetAssets url[%s] err", req->filename);
|
http_log("HttpGetAssets url[%s] err", req->filename);
|
||||||
return err;
|
return err;
|
||||||
}
|
}
|
||||||
http_log("HttpGetAssets url[%s] file_name[%s]", req->filename, file_name);
|
//http_log("HttpGetAssets url[%s] file_name[%s]", req->filename, file_name);
|
||||||
|
|
||||||
int total_sz = 0;
|
int total_sz = 0;
|
||||||
const unsigned char* file_data = NULL;
|
const unsigned char* file_data = NULL;
|
||||||
|
|||||||
@@ -741,8 +741,8 @@ $("#wifi_submit").on("click", function() {
|
|||||||
//Config-end
|
//Config-end
|
||||||
|
|
||||||
//图表-start
|
//图表-start
|
||||||
var data = { series: [ [] ] };
|
var ct_data = { series: [ [] ] };
|
||||||
var t = new Chartist.Line('.ct-chart', data, {showArea: true, axisY: {position: 'end'}});
|
var ct_chart = new Chartist.Line('.ct-chart', ct_data, {showArea: true, axisY: {position: 'end'}});
|
||||||
var power_idx = 0;
|
var power_idx = 0;
|
||||||
var chart_wth = 0;
|
var chart_wth = 0;
|
||||||
function GetPowerRecord() {
|
function GetPowerRecord() {
|
||||||
@@ -754,11 +754,14 @@ function GetPowerRecord() {
|
|||||||
var x = chart_par.scrollWidth - chart_par.offsetWidth - chart_par.scrollLeft;
|
var x = chart_par.scrollWidth - chart_par.offsetWidth - chart_par.scrollLeft;
|
||||||
|
|
||||||
power.powers.forEach(element => {
|
power.powers.forEach(element => {
|
||||||
data.series[0].push(element/10);
|
var len = ct_data.series[0].push(element/10);
|
||||||
|
if (len > 1000) { //最多1000条数据
|
||||||
|
ct_data.series[0].shift();
|
||||||
|
}
|
||||||
});
|
});
|
||||||
chart_wth += power.powers.length;
|
chart_wth += power.powers.length;
|
||||||
$("#ct-chart").width(chart_wth * 10);
|
$("#ct-chart").width(chart_wth * 10);
|
||||||
t.update(data);
|
ct_chart.update(ct_data);
|
||||||
if (power.powers.length != 0 && x < 100) {
|
if (power.powers.length != 0 && x < 100) {
|
||||||
chart_par.scrollTo(chart_par.scrollWidth, 0);
|
chart_par.scrollTo(chart_par.scrollWidth, 0);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -97,7 +97,7 @@ int application_start(void)
|
|||||||
tc1_log("mqtt_ip:%s",user_config->mqtt_ip);
|
tc1_log("mqtt_ip:%s",user_config->mqtt_ip);
|
||||||
tc1_log("mqtt_port:%d",user_config->mqtt_port);
|
tc1_log("mqtt_port:%d",user_config->mqtt_port);
|
||||||
tc1_log("mqtt_user:%s",user_config->mqtt_user);
|
tc1_log("mqtt_user:%s",user_config->mqtt_user);
|
||||||
tc1_log("mqtt_password:%s",user_config->mqtt_password);
|
//tc1_log("mqtt_password:%s",user_config->mqtt_password);
|
||||||
tc1_log("version:%d",user_config->version);
|
tc1_log("version:%d",user_config->version);
|
||||||
|
|
||||||
WifiInit();
|
WifiInit();
|
||||||
|
|||||||
@@ -15,7 +15,7 @@
|
|||||||
#define wifi_log(M, ...) do { custom_log("WIFI", M, ##__VA_ARGS__); web_log("WIFI", M, ##__VA_ARGS__) } while(0)
|
#define wifi_log(M, ...) do { custom_log("WIFI", M, ##__VA_ARGS__); web_log("WIFI", M, ##__VA_ARGS__) } while(0)
|
||||||
#define power_log(M, ...) do { custom_log("POWER", M, ##__VA_ARGS__); web_log("POWER", M, ##__VA_ARGS__) } while(0)
|
#define power_log(M, ...) do { custom_log("POWER", M, ##__VA_ARGS__); web_log("POWER", M, ##__VA_ARGS__) } while(0)
|
||||||
|
|
||||||
#define VERSION "v2.0.2"
|
#define VERSION "v2.0.3"
|
||||||
|
|
||||||
#define TYPE 1
|
#define TYPE 1
|
||||||
#define TYPE_NAME "zTC1"
|
#define TYPE_NAME "zTC1"
|
||||||
|
|||||||
@@ -78,8 +78,8 @@ void WifiScanCallback(ScanResult_adv* scan_ret, void* arg)
|
|||||||
{
|
{
|
||||||
ApInfo* ap = (ApInfo*)&scan_ret->ApList[i];
|
ApInfo* ap = (ApInfo*)&scan_ret->ApList[i];
|
||||||
uint8_t* mac = (uint8_t*)ap->bssid;
|
uint8_t* mac = (uint8_t*)ap->bssid;
|
||||||
wifi_log("wifi_scan_callback ssid[%16s] bssid[%02X-%02X-%02X-%02X-%02X-%02X] security[%d]",
|
//wifi_log("wifi_scan_callback ssid[%16s] bssid[%02X-%02X-%02X-%02X-%02X-%02X] security[%d]",
|
||||||
ap->ssid, mac[0], mac[1], mac[2], mac[3], mac[4], mac[5], ap->security);
|
// ap->ssid, mac[0], mac[1], mac[2], mac[3], mac[4], mac[5], ap->security);
|
||||||
char* ssid = scan_ret->ApList[i].ssid;
|
char* ssid = scan_ret->ApList[i].ssid;
|
||||||
//排除隐藏的wifi和SSID带'或"的我wifi
|
//排除隐藏的wifi和SSID带'或"的我wifi
|
||||||
if (ssid[0] == 0 || strstr(ssid, "'") || strstr(ssid, "\"")) continue;
|
if (ssid[0] == 0 || strstr(ssid, "'") || strstr(ssid, "\"")) continue;
|
||||||
@@ -132,7 +132,7 @@ static void WifiLedTimerCallback(void* arg)
|
|||||||
|
|
||||||
void WifiConnect(char* wifi_ssid, char* wifi_key)
|
void WifiConnect(char* wifi_ssid, char* wifi_key)
|
||||||
{
|
{
|
||||||
wifi_log("WifiConnect wifi_ssid[%s] wifi_key[%s]", wifi_ssid, wifi_key);
|
wifi_log("WifiConnect wifi_ssid[%s] wifi_key[******]", wifi_ssid);
|
||||||
//wifi配置初始化
|
//wifi配置初始化
|
||||||
network_InitTypeDef_st wNetConfig;
|
network_InitTypeDef_st wNetConfig;
|
||||||
|
|
||||||
@@ -172,7 +172,7 @@ void ApConfig(char* name, char* key)
|
|||||||
{
|
{
|
||||||
strncpy(user_config->ap_name, name, 32);
|
strncpy(user_config->ap_name, name, 32);
|
||||||
strncpy(user_config->ap_key, key, 32);
|
strncpy(user_config->ap_key, key, 32);
|
||||||
wifi_log("ApConfig ap_name[%s] ap_key[%s]", user_config->ap_name, user_config->ap_key);
|
wifi_log("ApConfig ap_name[%s] ap_key[******]", user_config->ap_name);
|
||||||
micoWlanSuspendStation();
|
micoWlanSuspendStation();
|
||||||
ApInit(false);
|
ApInit(false);
|
||||||
mico_system_context_update(sys_config);
|
mico_system_context_update(sys_config);
|
||||||
@@ -184,7 +184,7 @@ void ApInit(bool use_defaul)
|
|||||||
{
|
{
|
||||||
sprintf(user_config->ap_name, ZZ_AP_NAME, str_mac + 6);
|
sprintf(user_config->ap_name, ZZ_AP_NAME, str_mac + 6);
|
||||||
sprintf(user_config->ap_key, "%s", ZZ_AP_KEY);
|
sprintf(user_config->ap_key, "%s", ZZ_AP_KEY);
|
||||||
wifi_log("ApInit ap_name[%s] ap_ke[%s]", user_config->ap_name, user_config->ap_key);
|
wifi_log("ApInit use_defaul[true] key[12345678]");
|
||||||
}
|
}
|
||||||
|
|
||||||
network_InitTypeDef_st wNetConfig;
|
network_InitTypeDef_st wNetConfig;
|
||||||
@@ -199,6 +199,6 @@ void ApInit(bool use_defaul)
|
|||||||
strcpy((char *)wNetConfig.dnsServer_ip_addr, ZZ_AP_DNS_SERVER);
|
strcpy((char *)wNetConfig.dnsServer_ip_addr, ZZ_AP_DNS_SERVER);
|
||||||
micoWlanStart(&wNetConfig);
|
micoWlanStart(&wNetConfig);
|
||||||
|
|
||||||
wifi_log("ApInit ssid[%s] key[%s]", wNetConfig.wifi_ssid, wNetConfig.wifi_key);
|
wifi_log("ApInit ssid[%s] key[******]", wNetConfig.wifi_ssid);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user