Compare commits
3 Commits
900cbc3f79
...
0f8fc28d05
| Author | SHA1 | Date | |
|---|---|---|---|
| 0f8fc28d05 | |||
| 6ebbd67dec | |||
| 4efce1d8ee |
10
Version.txt
10
Version.txt
@ -19,14 +19,14 @@ Version : V2.0.3
|
|||||||
{
|
{
|
||||||
"command": "set_bochangxishu",
|
"command": "set_bochangxishu",
|
||||||
"bochangxishu": {
|
"bochangxishu": {
|
||||||
"a0": -1.37016491e-9,
|
"a0": -1.08988798e-09,
|
||||||
"a1": -0.000052,
|
"a1": -5.32620063e-05,
|
||||||
"a2": 0.440364,
|
"a2": 0.441532,
|
||||||
"a3": 348.4284,
|
"a3": 348.5026,
|
||||||
"b0": -1.2597071e-9,
|
"b0": -1.2597071e-9,
|
||||||
"b1": -0.000053,
|
"b1": -0.000053,
|
||||||
"b2": 0.440609,
|
"b2": 0.440609,
|
||||||
"b3": 348.3989
|
"b3": 48.3989
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -50,5 +50,5 @@ board_build.filesystem = spiffs
|
|||||||
|
|
||||||
|
|
||||||
monitor_filters = esp32_exception_decoder
|
monitor_filters = esp32_exception_decoder
|
||||||
monitor_speed = 115200
|
monitor_speed = 921600
|
||||||
|
|
||||||
|
|||||||
@ -1405,6 +1405,23 @@ void SensorIS11::advanced_mode(u_int32_t direction,u_int32_t shutter_time,u_int3
|
|||||||
while(aa > 0)
|
while(aa > 0)
|
||||||
{
|
{
|
||||||
work_progress = (caiji_times * 100) / (collect_times * 2) ;
|
work_progress = (caiji_times * 100) / (collect_times * 2) ;
|
||||||
|
switch (direction)
|
||||||
|
{
|
||||||
|
case 0:
|
||||||
|
|
||||||
|
shutter_up();
|
||||||
|
|
||||||
|
break;
|
||||||
|
case 1:
|
||||||
|
shutter_down();
|
||||||
|
break;
|
||||||
|
case 2:
|
||||||
|
// SetShutter(1);
|
||||||
|
shutter_off();
|
||||||
|
break;
|
||||||
|
default:
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
|
||||||
GetOneDate(shutter_time);
|
GetOneDate(shutter_time);
|
||||||
for (int i = 0; i < SensorInfo.BandNum;i++)
|
for (int i = 0; i < SensorInfo.BandNum;i++)
|
||||||
|
|||||||
@ -28,7 +28,7 @@ void callback(char* topic, byte* payload, unsigned int length) {
|
|||||||
// Serial.println();
|
// Serial.println();
|
||||||
|
|
||||||
|
|
||||||
uint8_t read_buff[1024 * 10];
|
uint8_t read_buff[1024 * 1];
|
||||||
memcpy(read_buff,payload,length);
|
memcpy(read_buff,payload,length);
|
||||||
uint32_t data_length = length;
|
uint32_t data_length = length;
|
||||||
data_length = IRIS_Cut_Befor_Header(read_buff,data_length);
|
data_length = IRIS_Cut_Befor_Header(read_buff,data_length);
|
||||||
@ -68,6 +68,10 @@ void gsmm_mqtt_loop_task(void *pvParameters)
|
|||||||
{
|
{
|
||||||
while (1)
|
while (1)
|
||||||
{
|
{
|
||||||
|
if (!mqtt_client->connected()) {
|
||||||
|
reconnect();
|
||||||
|
}
|
||||||
|
|
||||||
EventBits_t uxBits = xEventGroupGetBits(http_event_group);
|
EventBits_t uxBits = xEventGroupGetBits(http_event_group);
|
||||||
if (uxBits & mqtt_stop_bit)
|
if (uxBits & mqtt_stop_bit)
|
||||||
{
|
{
|
||||||
@ -77,9 +81,7 @@ void gsmm_mqtt_loop_task(void *pvParameters)
|
|||||||
xEventGroupClearBits(http_event_group, mqtt_stop_bit);
|
xEventGroupClearBits(http_event_group, mqtt_stop_bit);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!mqtt_client->connected()) {
|
|
||||||
reconnect();
|
|
||||||
}
|
|
||||||
mqtt_client->loop();
|
mqtt_client->loop();
|
||||||
gsmmanger->loop();
|
gsmmanger->loop();
|
||||||
|
|
||||||
@ -123,7 +125,7 @@ void gsmm_mqtt_init(String sensor_id)
|
|||||||
|
|
||||||
// http = new HttpClient(*gsmmanger->client, "82.156.1.111");
|
// http = new HttpClient(*gsmmanger->client, "82.156.1.111");
|
||||||
http = new HttpClient(*gsmmanger->client, mqtt_server);
|
http = new HttpClient(*gsmmanger->client, mqtt_server);
|
||||||
xTaskCreatePinnedToCore(gsmm_mqtt_loop_task, "gsmm_mqtt_loop_task",1024*3,NULL, 1, NULL, 1);
|
xTaskCreatePinnedToCore(gsmm_mqtt_loop_task, "gsmm_mqtt_loop_task",1024*5,NULL, 1, NULL, 1);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
100
src/main.cpp
100
src/main.cpp
@ -280,12 +280,12 @@ void setup()
|
|||||||
// }
|
// }
|
||||||
|
|
||||||
|
|
||||||
Serial.println("IS_SN :" +STRSensorInfos_structure.serialnumber);
|
write_log(log_path,"IS_SN :" +STRSensorInfos_structure.serialnumber,20);
|
||||||
|
|
||||||
// is11Sensor->guangpu_bochang.a1 = 0.000000000000000;
|
// is11Sensor->guangpu_bochang.a1 = 0.000000000000000;
|
||||||
// is11Sensor->guangpu_bochang.a2 = 0.000000000;
|
// is11Sensor->guangpu_bochang.a2 = 0.000000000;
|
||||||
sys_sd_doc["firmware"] = "V2.0.5";
|
sys_sd_doc["firmware"] = "V2.0.8";
|
||||||
sys_sd_doc["version"] = "V2.0.5";
|
sys_sd_doc["version"] = "V2.0.8";
|
||||||
sys_info_init();
|
sys_info_init();
|
||||||
|
|
||||||
// dingbiao_init("/dingbiao/dingbiao_up_gain.bin");
|
// dingbiao_init("/dingbiao/dingbiao_up_gain.bin");
|
||||||
@ -322,23 +322,16 @@ void setup()
|
|||||||
|
|
||||||
if(is11Sensor->guangpu_bochang.b3 < 100)
|
if(is11Sensor->guangpu_bochang.b3 < 100)
|
||||||
{
|
{
|
||||||
write_log(log_path,"guangpu_bochang.b3 false",10);
|
|
||||||
is11Sensor->guangpu_bochang.is_valid = false;
|
is11Sensor->guangpu_bochang.is_valid = false;
|
||||||
is11Sensor->guangpu_bochang.a0 = is11Sensor->SensorInfo.a1;
|
write_log(log_path,"guangpu_bochang.b3 false",10);
|
||||||
is11Sensor->guangpu_bochang.a1 = is11Sensor->SensorInfo.a2;
|
if(is11Sensor->guangpu_bochang.a3 > 100)
|
||||||
is11Sensor->guangpu_bochang.a2 = is11Sensor->SensorInfo.a3;
|
{
|
||||||
is11Sensor->guangpu_bochang.a3 = is11Sensor->SensorInfo.a4;
|
write_log(log_path,"guangpu_bochang.a3 true",10);
|
||||||
|
is11Sensor->SensorInfo.a1 = is11Sensor->guangpu_bochang.a0;
|
||||||
is11Sensor->guangpu_bochang.b0 = is11Sensor->SensorInfo.a1;
|
is11Sensor->SensorInfo.a2 = is11Sensor->guangpu_bochang.a1;
|
||||||
is11Sensor->guangpu_bochang.b1 = is11Sensor->SensorInfo.a2;
|
is11Sensor->SensorInfo.a3 = is11Sensor->guangpu_bochang.a2;
|
||||||
is11Sensor->guangpu_bochang.b2 = is11Sensor->SensorInfo.a3;
|
is11Sensor->SensorInfo.a4 = is11Sensor->guangpu_bochang.a3;
|
||||||
is11Sensor->guangpu_bochang.b3 = is11Sensor->SensorInfo.a4;
|
}
|
||||||
|
|
||||||
sys_sd_doc["bochangxishu"]["a0"] = is11Sensor->guangpu_bochang.a0;
|
|
||||||
sys_sd_doc["bochangxishu"]["a1"] = is11Sensor->guangpu_bochang.a1;
|
|
||||||
sys_sd_doc["bochangxishu"]["a2"] = is11Sensor->guangpu_bochang.a2;
|
|
||||||
sys_sd_doc["bochangxishu"]["a3"] = is11Sensor->guangpu_bochang.a3;
|
|
||||||
|
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
@ -1041,15 +1034,16 @@ void OTA_task(void *pvParameters)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
unsigned char command_data[1024*1];
|
||||||
|
u_char send_buff[1000];
|
||||||
void receive_command_unpack(uint8_t * read_buf,uint16_t data_length,uint8_t port_type)
|
void receive_command_unpack(uint8_t * read_buf,uint16_t data_length,uint8_t port_type)
|
||||||
{
|
{
|
||||||
|
|
||||||
unsigned char command_data[1024*10];
|
|
||||||
unsigned char data_type;
|
unsigned char data_type;
|
||||||
String send_data ;
|
String send_data ;
|
||||||
int send_lenth;
|
int send_lenth;
|
||||||
uint8_t low_power_sta = 1;
|
uint8_t low_power_sta = 1;
|
||||||
u_char send_buff[300];
|
|
||||||
|
|
||||||
|
|
||||||
int ret = IRIS_STM32_Protocol_Unpack(read_buf,data_length,&data_type,command_data);
|
int ret = IRIS_STM32_Protocol_Unpack(read_buf,data_length,&data_type,command_data);
|
||||||
@ -1361,7 +1355,7 @@ void json_command(uint8_t port_type)
|
|||||||
int ret;
|
int ret;
|
||||||
bool save = false;
|
bool save = false;
|
||||||
String send_str;
|
String send_str;
|
||||||
u_char send_buff[1000];
|
// u_char send_buff[1000];
|
||||||
String json_str;
|
String json_str;
|
||||||
|
|
||||||
|
|
||||||
@ -1796,30 +1790,28 @@ void json_command(uint8_t port_type)
|
|||||||
//command 10
|
//command 10
|
||||||
else if (doc["command"] == "set_bochangxishu")
|
else if (doc["command"] == "set_bochangxishu")
|
||||||
{
|
{
|
||||||
double a0=0,a1=0,a2=0,a3=0,a4=0,b1=0,b2=0,b3=0,b4=0;
|
double b4=0;
|
||||||
|
|
||||||
a0 = doc["bochangxishu"]["a0"];
|
// a0 = doc["bochangxishu"]["a0"];
|
||||||
a1 = doc["bochangxishu"]["a1"];
|
// a1 = doc["bochangxishu"]["a1"];
|
||||||
a2 = doc["bochangxishu"]["a2"];
|
// a2 = doc["bochangxishu"]["a2"];
|
||||||
a3 = doc["bochangxishu"]["a3"];
|
// a3 = doc["bochangxishu"]["a3"];
|
||||||
|
|
||||||
|
|
||||||
b1 = doc["bochangxishu"]["b0"];
|
|
||||||
b2 = doc["bochangxishu"]["b1"];
|
|
||||||
b3 = doc["bochangxishu"]["b2"];
|
|
||||||
b4 = doc["bochangxishu"]["b3"];
|
b4 = doc["bochangxishu"]["b3"];
|
||||||
|
|
||||||
if(b1!=0 && b2 !=0 && b3 != 0 && b4 != 0)
|
if(b4 >= 0)
|
||||||
{
|
{
|
||||||
save = true;
|
save = true;
|
||||||
// bc_b1 = doc["bochangxishu"]["b0"];
|
// bc_b1 = doc["bochangxishu"]["b0"];
|
||||||
// bc_b2 = doc["bochangxishu"]["b1"];
|
// bc_b2 = doc["bochangxishu"]["b1"];
|
||||||
// bc_b3 = doc["bochangxishu"]["b2"];
|
// bc_b3 = doc["bochangxishu"]["b2"];
|
||||||
// bc_b4 = doc["bochangxishu"]["b3"];
|
// bc_b4 = doc["bochangxishu"]["b3"];
|
||||||
is11Sensor->SensorInfo.a1 = doc["bochangxishu"]["a0"];
|
|
||||||
is11Sensor->SensorInfo.a2 = doc["bochangxishu"]["a1"];
|
// is11Sensor->SensorInfo.a1 = doc["bochangxishu"]["a0"];
|
||||||
is11Sensor->SensorInfo.a3 = doc["bochangxishu"]["a2"];
|
// is11Sensor->SensorInfo.a2 = doc["bochangxishu"]["a1"];
|
||||||
is11Sensor->SensorInfo.a4 = doc["bochangxishu"]["a3"];
|
// is11Sensor->SensorInfo.a3 = doc["bochangxishu"]["a2"];
|
||||||
|
// is11Sensor->SensorInfo.a4 = doc["bochangxishu"]["a3"];
|
||||||
|
|
||||||
is11Sensor->guangpu_bochang.a0 = doc["bochangxishu"]["a0"];
|
is11Sensor->guangpu_bochang.a0 = doc["bochangxishu"]["a0"];
|
||||||
is11Sensor->guangpu_bochang.a1 = doc["bochangxishu"]["a1"];
|
is11Sensor->guangpu_bochang.a1 = doc["bochangxishu"]["a1"];
|
||||||
@ -2516,11 +2508,19 @@ void json_command(uint8_t port_type)
|
|||||||
|
|
||||||
setupmsc();
|
setupmsc();
|
||||||
|
|
||||||
vTaskSuspend(Task0_Handler);
|
|
||||||
vTaskSuspend(Task1_Handler);
|
vTaskSuspend(Task1_Handler);
|
||||||
// vTaskSuspend(Task2_Handler);
|
// vTaskSuspend(Task2_Handler);
|
||||||
vTaskSuspend(A4G_Handler);
|
if(sys_sd_doc["status_4g"] == "open_4g")
|
||||||
vTaskSuspend(OTA_Handler);
|
{
|
||||||
|
vTaskSuspend(A4G_Handler);
|
||||||
|
vTaskSuspend(OTA_Handler);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
vTaskSuspend(Task0_Handler);
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
//command 38
|
//command 38
|
||||||
else if(doc["command"] == "reboot")
|
else if(doc["command"] == "reboot")
|
||||||
@ -2681,12 +2681,6 @@ void sys_info_init()
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
// sys_sd_doc["bochangxishu"]["a0"] = STRSensorInfos_structure.a1;
|
|
||||||
// sys_sd_doc["bochangxishu"]["a1"] = STRSensorInfos_structure.a2;
|
|
||||||
// sys_sd_doc["bochangxishu"]["a2"] = STRSensorInfos_structure.a3;
|
|
||||||
// sys_sd_doc["bochangxishu"]["a3"] = STRSensorInfos_structure.a4;
|
|
||||||
|
|
||||||
sys_sd_doc["bochangxishu"]["a0"] = doc["bochangxishu"]["a0"];
|
sys_sd_doc["bochangxishu"]["a0"] = doc["bochangxishu"]["a0"];
|
||||||
sys_sd_doc["bochangxishu"]["a1"] = doc["bochangxishu"]["a1"];
|
sys_sd_doc["bochangxishu"]["a1"] = doc["bochangxishu"]["a1"];
|
||||||
sys_sd_doc["bochangxishu"]["a2"] = doc["bochangxishu"]["a2"];
|
sys_sd_doc["bochangxishu"]["a2"] = doc["bochangxishu"]["a2"];
|
||||||
@ -2749,15 +2743,15 @@ void sys_info_init()
|
|||||||
sys_sd_doc["Minimum_temperature"] = Minimum_temperature;
|
sys_sd_doc["Minimum_temperature"] = Minimum_temperature;
|
||||||
sys_sd_doc["servo_offset_angle"] = 0;
|
sys_sd_doc["servo_offset_angle"] = 0;
|
||||||
|
|
||||||
sys_sd_doc["bochangxishu"]["a0"] = is11Sensor->guangpu_bochang.a0;
|
sys_sd_doc["bochangxishu"]["a0"] = is11Sensor->SensorInfo.a1;
|
||||||
sys_sd_doc["bochangxishu"]["a1"] = is11Sensor->guangpu_bochang.a1;
|
sys_sd_doc["bochangxishu"]["a1"] = is11Sensor->SensorInfo.a1;
|
||||||
sys_sd_doc["bochangxishu"]["a2"] = is11Sensor->guangpu_bochang.a2;
|
sys_sd_doc["bochangxishu"]["a2"] = is11Sensor->SensorInfo.a1;
|
||||||
sys_sd_doc["bochangxishu"]["a3"] = is11Sensor->guangpu_bochang.a3;
|
sys_sd_doc["bochangxishu"]["a3"] = is11Sensor->SensorInfo.a1;
|
||||||
|
|
||||||
sys_sd_doc["bochangxishu"]["b0"] = is11Sensor->guangpu_bochang.b0;
|
sys_sd_doc["bochangxishu"]["b0"] = 0;
|
||||||
sys_sd_doc["bochangxishu"]["b1"] = is11Sensor->guangpu_bochang.b1;
|
sys_sd_doc["bochangxishu"]["b1"] = 0;
|
||||||
sys_sd_doc["bochangxishu"]["b2"] = is11Sensor->guangpu_bochang.b2;
|
sys_sd_doc["bochangxishu"]["b2"] = 0;
|
||||||
sys_sd_doc["bochangxishu"]["b3"] = is11Sensor->guangpu_bochang.b3;
|
sys_sd_doc["bochangxishu"]["b3"] = 0;
|
||||||
sys_sd_doc["return_data_type"] = return_data_type;
|
sys_sd_doc["return_data_type"] = return_data_type;
|
||||||
sys_sd_doc["return_mode"] = ""; //暂定
|
sys_sd_doc["return_mode"] = ""; //暂定
|
||||||
sys_sd_doc["atuo_return"] = "no";
|
sys_sd_doc["atuo_return"] = "no";
|
||||||
|
|||||||
Reference in New Issue
Block a user