mirror of
https://github.com/jomjol/AI-on-the-edge-device.git
synced 2025-12-12 06:27:01 +03:00
Compare commits
7 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
4b825efffb | ||
|
|
71871016d2 | ||
|
|
c07ef23d5b | ||
|
|
cbe884ad63 | ||
|
|
1dd703b337 | ||
|
|
bcb1d98191 | ||
|
|
1f5486e8cc |
@@ -11,6 +11,19 @@
|
||||
|
||||
____
|
||||
|
||||
#### #24 Show Mqtt state directly in Webserver
|
||||
|
||||
* Show MQTT log in Web page. E.g. connection established or failed to connect...
|
||||
|
||||
|
||||
|
||||
|
||||
#### #23 CPU Temp and Mqtt values
|
||||
|
||||
* Show the CPU Temp directly in Webpage. Also add the value to MQTT sending
|
||||
|
||||
|
||||
|
||||
#### #22 Direct hint to the different neural network files in the other repositories
|
||||
|
||||
* https://github.com/jomjol/AI-on-the-edge-device/issues/644
|
||||
|
||||
12
README.md
12
README.md
@@ -46,7 +46,6 @@ In other cases you can contact the developer via email: <img src="https://raw.gi
|
||||
### Known Issues
|
||||
|
||||
* slow response of web server during picture analysis
|
||||
* ~~spontaneous reboots (mostly due to html access during image processing)~~ --> solved since v10.3.0
|
||||
|
||||
**General remark:** Beside the `firmware.bin`, typically also the content of `/html` needs to be updated!
|
||||
|
||||
@@ -54,6 +53,17 @@ In other cases you can contact the developer via email: <img src="https://raw.gi
|
||||
|
||||
|
||||
|
||||
##### 10.5.2 - Stability Increase (2022-02-22)
|
||||
|
||||
- **NEW 10.5.2:** Bug Fix: wrong `firmware.bin` (no rate update)
|
||||
- NEW 10.5.1: Bug Fix: wrong return value, rate value & PreValue status, HTML: SSID & IP were not displayed
|
||||
- MQTT: changed wifi naming to "wifiRSSI"
|
||||
- HTML: check select able values for consistency
|
||||
- Refactoring of check postprocessing consistency (e.g. max rate, negative rate, ...)
|
||||
- Bug Fix: corrected error in "Check Consistency Increase"
|
||||
|
||||
|
||||
|
||||
##### 10.4.0 - Stability Increase (2022-02-12)
|
||||
|
||||
- Graphical configuration: select available neural network files (*.tfl, *.tflite) from drop down menu
|
||||
|
||||
@@ -74,10 +74,10 @@ using namespace std;
|
||||
|
||||
esp_err_t get_tflite_file_handler(httpd_req_t *req)
|
||||
{
|
||||
DIR *verzeichnis;
|
||||
struct dirent *files;
|
||||
// DIR *verzeichnis;
|
||||
// struct dirent *files;
|
||||
struct dirent *entry;
|
||||
struct stat entry_stat;
|
||||
// struct stat entry_stat;
|
||||
|
||||
|
||||
std::string _filename, _fileext;
|
||||
|
||||
@@ -327,7 +327,7 @@ string ClassFlowControll::getReadoutAll(int _type)
|
||||
out = out + (*numbers)[i]->name + "\t";
|
||||
switch (_type) {
|
||||
case READOUT_TYPE_VALUE:
|
||||
out = out + (*numbers)[i]->ReturnValueNoError;
|
||||
out = out + (*numbers)[i]->ReturnValue;
|
||||
break;
|
||||
case READOUT_TYPE_PREVALUE:
|
||||
if (flowpostprocessing->PreValueUse)
|
||||
@@ -643,8 +643,8 @@ string ClassFlowControll::getJSON()
|
||||
{
|
||||
json += "\"" + (*NUMBERS)[i]->name + "\":\n";
|
||||
json += " {\n";
|
||||
if ((*NUMBERS)[i]->ReturnValueNoError.length() > 0)
|
||||
json += " \"value\": " + (*NUMBERS)[i]->ReturnValueNoError + ",\n";
|
||||
if ((*NUMBERS)[i]->ReturnValue.length() > 0)
|
||||
json += " \"value\": " + (*NUMBERS)[i]->ReturnValue + ",\n";
|
||||
else
|
||||
json += " \"value\": \"\",\n";
|
||||
json += " \"raw\": \"" + (*NUMBERS)[i]->ReturnRawValue + "\",\n";
|
||||
|
||||
@@ -39,7 +39,6 @@ struct NumberPost {
|
||||
string ReturnRawValue; // Rohwert (mit N & führenden 0)
|
||||
string ReturnValue; // korrigierter Rückgabewert, ggf. mit Fehlermeldung
|
||||
string ReturnPreValue; // korrigierter Rückgabewert ohne Fehlermeldung
|
||||
string ReturnValueNoError;
|
||||
string ErrorMessageText; // Fehlermeldung bei Consistency Check
|
||||
int AnzahlAnalog;
|
||||
int AnzahlDigital;
|
||||
|
||||
@@ -157,7 +157,7 @@ bool ClassFlowMQTT::doFlow(string zwtime)
|
||||
sprintf(freeheapmem, "%zu", esp_get_free_heap_size());
|
||||
MQTTPublish(zw, freeheapmem);
|
||||
|
||||
zw = maintopic + "/" + "Wifi RSSI";
|
||||
zw = maintopic + "/" + "wifiRSSI";
|
||||
char rssi[11];
|
||||
sprintf(rssi, "%d", get_WIFI_RSSI());
|
||||
MQTTPublish(zw, rssi);
|
||||
@@ -169,7 +169,7 @@ bool ClassFlowMQTT::doFlow(string zwtime)
|
||||
|
||||
for (int i = 0; i < (*NUMBERS).size(); ++i)
|
||||
{
|
||||
result = (*NUMBERS)[i]->ReturnValueNoError;
|
||||
result = (*NUMBERS)[i]->ReturnValue;
|
||||
resultraw = (*NUMBERS)[i]->ReturnRawValue;
|
||||
resulterror = (*NUMBERS)[i]->ErrorMessageText;
|
||||
resultrate = (*NUMBERS)[i]->ReturnRateValue;
|
||||
|
||||
@@ -167,12 +167,10 @@ bool ClassFlowPostProcessing::LoadPreValue(void)
|
||||
|
||||
NUMBERS[0]->Value = NUMBERS[0]->PreValue;
|
||||
NUMBERS[0]->ReturnValue = to_string(NUMBERS[0]->Value);
|
||||
NUMBERS[0]->ReturnValueNoError = NUMBERS[0]->ReturnValue;
|
||||
|
||||
if (NUMBERS[0]->digit_roi || NUMBERS[0]->analog_roi)
|
||||
{
|
||||
NUMBERS[0]->ReturnValue = RundeOutput(NUMBERS[0]->Value, NUMBERS[0]->Nachkomma);
|
||||
NUMBERS[0]->ReturnValueNoError = NUMBERS[0]->ReturnValue;
|
||||
}
|
||||
|
||||
UpdatePreValueINI = true; // Konvertierung ins neue Format
|
||||
@@ -507,7 +505,7 @@ void ClassFlowPostProcessing::InitNUMBERS()
|
||||
|
||||
_number->ReturnRawValue = ""; // Rohwert (mit N & führenden 0)
|
||||
_number->ReturnValue = ""; // korrigierter Rückgabewert, ggf. mit Fehlermeldung
|
||||
_number->ReturnValueNoError = ""; // korrigierter Rückgabewert ohne Fehlermeldung
|
||||
// _number->ReturnValueNoError = ""; // korrigierter Rückgabewert ohne Fehlermeldung
|
||||
_number->ErrorMessageText = ""; // Fehlermeldung bei Consistency Check
|
||||
_number->ReturnPreValue = "";
|
||||
_number->PreValueOkay = false;
|
||||
@@ -526,7 +524,7 @@ void ClassFlowPostProcessing::InitNUMBERS()
|
||||
_number->Value = 0; // letzer ausgelesener Wert, inkl. Korrekturen
|
||||
_number->ReturnRawValue = ""; // Rohwert (mit N & führenden 0)
|
||||
_number->ReturnValue = ""; // korrigierter Rückgabewert, ggf. mit Fehlermeldung
|
||||
_number->ReturnValueNoError = ""; // korrigierter Rückgabewert ohne Fehlermeldung
|
||||
// _number->ReturnValueNoError = ""; // korrigierter Rückgabewert ohne Fehlermeldung
|
||||
_number->ErrorMessageText = ""; // Fehlermeldung bei Consistency Check
|
||||
|
||||
_number->Nachkomma = _number->AnzahlAnalog;
|
||||
@@ -607,7 +605,10 @@ bool ClassFlowPostProcessing::doFlow(string zwtime)
|
||||
for (int j = 0; j < NUMBERS.size(); ++j)
|
||||
{
|
||||
NUMBERS[j]->ReturnRawValue = "";
|
||||
NUMBERS[j]->ReturnRateValue = "";
|
||||
NUMBERS[j]->ReturnValue = "";
|
||||
NUMBERS[j]->ErrorMessageText = "";
|
||||
NUMBERS[j]->Value = -1;
|
||||
|
||||
UpdateNachkommaDecimalShift();
|
||||
|
||||
@@ -624,109 +625,83 @@ bool ClassFlowPostProcessing::doFlow(string zwtime)
|
||||
if (NUMBERS[j]->analog_roi)
|
||||
NUMBERS[j]->ReturnRawValue = NUMBERS[j]->ReturnRawValue + flowAnalog->getReadout(j, NUMBERS[j]->isExtendedResolution);
|
||||
|
||||
NUMBERS[j]->ReturnRawValue = ShiftDecimal(NUMBERS[j]->ReturnRawValue, NUMBERS[j]->DecimalShift);
|
||||
NUMBERS[j]->ReturnRawValue = ShiftDecimal(NUMBERS[j]->ReturnRawValue, NUMBERS[j]->DecimalShift);
|
||||
|
||||
printf("ReturnRaw %s", NUMBERS[j]->ReturnRawValue.c_str());
|
||||
|
||||
|
||||
if (IgnoreLeadingNaN)
|
||||
{
|
||||
while ((NUMBERS[j]->ReturnRawValue.length() > 1) && (NUMBERS[j]->ReturnRawValue[0] == 'N'))
|
||||
{
|
||||
NUMBERS[j]->ReturnRawValue.erase(0, 1);
|
||||
}
|
||||
}
|
||||
|
||||
rohwert = NUMBERS[j]->ReturnRawValue;
|
||||
NUMBERS[j]->ReturnValue = NUMBERS[j]->ReturnRawValue;
|
||||
|
||||
if (!PreValueUse || !NUMBERS[j]->PreValueOkay)
|
||||
if (findDelimiterPos(NUMBERS[j]->ReturnValue, "N") != std::string::npos)
|
||||
{
|
||||
NUMBERS[j]->ReturnValue = NUMBERS[j]->ReturnRawValue;
|
||||
NUMBERS[j]->ReturnValueNoError = NUMBERS[j]->ReturnRawValue;
|
||||
|
||||
if ((findDelimiterPos(NUMBERS[j]->ReturnValue, "N") == std::string::npos) && (NUMBERS[j]->ReturnValue.length() > 0))
|
||||
{
|
||||
while ((NUMBERS[j]->ReturnValue.length() > 1) && (NUMBERS[j]->ReturnValue[0] == '0'))
|
||||
{
|
||||
NUMBERS[j]->ReturnValue.erase(0, 1);
|
||||
}
|
||||
NUMBERS[j]->Value = std::stof(NUMBERS[j]->ReturnValue);
|
||||
NUMBERS[j]->ReturnValueNoError = NUMBERS[j]->ReturnValue;
|
||||
|
||||
NUMBERS[j]->PreValueOkay = true;
|
||||
NUMBERS[j]->PreValue = NUMBERS[j]->Value;
|
||||
NUMBERS[j]->ReturnPreValue = RundeOutput(NUMBERS[j]->PreValue, NUMBERS[j]->Nachkomma);
|
||||
NUMBERS[j]->lastvalue = flowMakeImage->getTimeImageTaken();
|
||||
zwtime = ConvertTimeToString(NUMBERS[j]->lastvalue, PREVALUE_TIME_FORMAT_OUTPUT);
|
||||
|
||||
UpdatePreValueINI = true;
|
||||
SavePreValue();
|
||||
}
|
||||
if (PreValueUse && NUMBERS[j]->PreValueOkay)
|
||||
NUMBERS[j]->ReturnValue = ErsetzteN(NUMBERS[j]->ReturnValue, NUMBERS[j]->PreValue);
|
||||
else
|
||||
{
|
||||
NUMBERS[j]->ReturnValue = "";
|
||||
NUMBERS[j]->ReturnValueNoError = "";
|
||||
}
|
||||
continue; // es gibt keinen Zahl, da noch ein N vorhanden ist.
|
||||
}
|
||||
else
|
||||
|
||||
// Lösche führende Nullen (außer es ist nur noch einen 0)
|
||||
while ((NUMBERS[j]->ReturnValue.length() > 1) && (NUMBERS[j]->ReturnValue[0] == '0'))
|
||||
NUMBERS[j]->ReturnValue.erase(0, 1);
|
||||
|
||||
NUMBERS[j]->Value = std::stof(NUMBERS[j]->ReturnValue);
|
||||
|
||||
if (NUMBERS[j]->checkDigitIncreaseConsistency)
|
||||
{
|
||||
zw = ErsetzteN(NUMBERS[j]->ReturnRawValue, NUMBERS[j]->PreValue);
|
||||
NUMBERS[j]->Value = checkDigitConsistency(NUMBERS[j]->Value, NUMBERS[j]->DecimalShift, NUMBERS[j]->analog_roi != NULL, NUMBERS[j]->PreValue);
|
||||
}
|
||||
|
||||
NUMBERS[j]->Value = std::stof(zw);
|
||||
if (NUMBERS[j]->checkDigitIncreaseConsistency)
|
||||
{
|
||||
NUMBERS[j]->Value = checkDigitConsistency(NUMBERS[j]->Value, NUMBERS[j]->DecimalShift, NUMBERS[j]->analog_roi != NULL, NUMBERS[j]->PreValue);
|
||||
}
|
||||
|
||||
zwvalue = RundeOutput(NUMBERS[j]->Value, NUMBERS[j]->Nachkomma);
|
||||
|
||||
if ((!NUMBERS[j]->AllowNegativeRates) && (NUMBERS[j]->Value < NUMBERS[j]->PreValue))
|
||||
if (!NUMBERS[j]->AllowNegativeRates)
|
||||
{
|
||||
if (NUMBERS[j]->Value < NUMBERS[j]->PreValue)
|
||||
{
|
||||
NUMBERS[j]->ErrorMessageText = NUMBERS[j]->ErrorMessageText + "Neg. Rate - Read: " + zwvalue + " - Raw: " + NUMBERS[j]->ReturnRawValue + " - Pre: " + RundeOutput(NUMBERS[j]->PreValue, NUMBERS[j]->Nachkomma) + " ";
|
||||
NUMBERS[j]->Value = NUMBERS[j]->PreValue;
|
||||
zwvalue = RundeOutput(NUMBERS[j]->Value, NUMBERS[j]->Nachkomma);
|
||||
NUMBERS[j]->ReturnValue = "";
|
||||
continue;
|
||||
}
|
||||
}
|
||||
|
||||
double difference = difftime(imagetime, NUMBERS[j]->lastvalue); // in Sekunden
|
||||
difference /= 60;
|
||||
NUMBERS[j]->FlowRateAct = (NUMBERS[j]->Value - NUMBERS[j]->PreValue) / difference;
|
||||
NUMBERS[j]->ReturnRateValue = std::to_string(NUMBERS[j]->FlowRateAct);
|
||||
double difference = difftime(imagetime, NUMBERS[j]->lastvalue); // in Sekunden
|
||||
difference /= 60;
|
||||
NUMBERS[j]->FlowRateAct = (NUMBERS[j]->Value - NUMBERS[j]->PreValue) / difference;
|
||||
NUMBERS[j]->ReturnRateValue = to_string(NUMBERS[j]->FlowRateAct);
|
||||
|
||||
if (NUMBERS[j]->useMaxRateValue && PreValueUse && NUMBERS[j]->PreValueOkay)
|
||||
{
|
||||
float _ratedifference;
|
||||
if (NUMBERS[j]->RateType == RateChange)
|
||||
_ratedifference = (NUMBERS[j]->Value - NUMBERS[j]->PreValue) / difference;
|
||||
_ratedifference = NUMBERS[j]->FlowRateAct;
|
||||
else
|
||||
_ratedifference = (NUMBERS[j]->Value - NUMBERS[j]->PreValue);
|
||||
|
||||
if (NUMBERS[j]->useMaxRateValue && (abs(_ratedifference) > NUMBERS[j]->MaxRateValue))
|
||||
|
||||
if (abs(_ratedifference) > abs(NUMBERS[j]->MaxRateValue))
|
||||
{
|
||||
NUMBERS[j]->ErrorMessageText = NUMBERS[j]->ErrorMessageText + "Rate too high - Read: " + RundeOutput(NUMBERS[j]->Value, NUMBERS[j]->Nachkomma) + " - Pre: " + RundeOutput(NUMBERS[j]->PreValue, NUMBERS[j]->Nachkomma);
|
||||
NUMBERS[j]->Value = NUMBERS[j]->PreValue;
|
||||
zwvalue = RundeOutput(NUMBERS[j]->Value, NUMBERS[j]->Nachkomma);
|
||||
}
|
||||
|
||||
NUMBERS[j]->ReturnValueNoError = zwvalue;
|
||||
NUMBERS[j]->ReturnValue = zwvalue;
|
||||
if (NUMBERS[j]->ErrorMessage && (NUMBERS[j]->ErrorMessageText.length() > 0))
|
||||
NUMBERS[j]->ReturnValue = NUMBERS[j]->ReturnValue + "\t" + NUMBERS[j]->ErrorMessageText;
|
||||
|
||||
if (NUMBERS[j]->ErrorMessageText.length() == 0)
|
||||
{
|
||||
NUMBERS[j]->lastvalue = imagetime;
|
||||
NUMBERS[j]->PreValue = NUMBERS[j]->Value;
|
||||
|
||||
NUMBERS[j]->ReturnValueNoError = NUMBERS[j]->ReturnValue;
|
||||
NUMBERS[j]->ReturnPreValue = RundeOutput(NUMBERS[j]->PreValue, NUMBERS[j]->Nachkomma);
|
||||
NUMBERS[j]->ErrorMessageText = "no error";
|
||||
UpdatePreValueINI = true;
|
||||
}
|
||||
else
|
||||
{
|
||||
NUMBERS[j]->ReturnRateValue = "";
|
||||
NUMBERS[j]->ReturnValue = "";
|
||||
NUMBERS[j]->ReturnValueNoError = "";
|
||||
NUMBERS[j]->timeStamp = "";
|
||||
|
||||
NUMBERS[j]->ReturnRateValue = "";
|
||||
continue;
|
||||
}
|
||||
}
|
||||
|
||||
NUMBERS[j]->lastvalue = imagetime;
|
||||
NUMBERS[j]->PreValue = NUMBERS[j]->Value;
|
||||
NUMBERS[j]->PreValueOkay = true;
|
||||
|
||||
|
||||
NUMBERS[j]->ReturnValue = RundeOutput(NUMBERS[j]->Value, NUMBERS[j]->Nachkomma);
|
||||
NUMBERS[j]->ReturnPreValue = RundeOutput(NUMBERS[j]->PreValue, NUMBERS[j]->Nachkomma);
|
||||
|
||||
NUMBERS[j]->ErrorMessageText = "no error";
|
||||
UpdatePreValueINI = true;
|
||||
|
||||
string _zw = "PostProcessing - Raw: " + NUMBERS[j]->ReturnRawValue + " Value: " + NUMBERS[j]->ReturnValue + " Error: " + NUMBERS[j]->ErrorMessageText;
|
||||
LogFile.WriteToFile(_zw);
|
||||
}
|
||||
@@ -788,7 +763,7 @@ string ClassFlowPostProcessing::getReadoutParam(bool _rawValue, bool _noerror, i
|
||||
if (_rawValue)
|
||||
return NUMBERS[_number]->ReturnRawValue;
|
||||
if (_noerror)
|
||||
return NUMBERS[_number]->ReturnValueNoError;
|
||||
return NUMBERS[_number]->ReturnValue;
|
||||
return NUMBERS[_number]->ReturnValue;
|
||||
}
|
||||
|
||||
@@ -864,14 +839,14 @@ float ClassFlowPostProcessing::checkDigitConsistency(float input, int _decilamsh
|
||||
while (pot <= pot_max)
|
||||
{
|
||||
zw = input / pow(10, pot-1);
|
||||
aktdigit_before = ((int) round(zw) + 10) % 10;
|
||||
aktdigit_before = ((int) zw) % 10;
|
||||
zw = _preValue / pow(10, pot-1);
|
||||
olddigit_before = ((int) round(zw) + 10) % 10;
|
||||
olddigit_before = ((int) zw) % 10;
|
||||
|
||||
zw = input / pow(10, pot);
|
||||
aktdigit = ((int) round(zw) + 10) % 10;
|
||||
aktdigit = ((int) zw) % 10;
|
||||
zw = _preValue / pow(10, pot);
|
||||
olddigit = ((int) round(zw) + 10) % 10;
|
||||
olddigit = ((int) zw) % 10;
|
||||
|
||||
no_nulldurchgang = (olddigit_before <= aktdigit_before);
|
||||
|
||||
|
||||
@@ -122,28 +122,6 @@ static void event_handler(void* arg, esp_event_base_t event_base,
|
||||
// xEventGroupSetBits(s_wifi_event_group, WIFI_FAIL_BIT);
|
||||
// }
|
||||
ESP_LOGI(TAG,"connect to the AP fail");
|
||||
} else if (event_base == IP_EVENT && event_id == IP_EVENT_STA_GOT_IP) {
|
||||
ip_event_got_ip_t* event = (ip_event_got_ip_t*) event_data;
|
||||
ESP_LOGI(TAG, "got ip:" IPSTR, IP2STR(&event->ip_info.ip));
|
||||
s_retry_num = 0;
|
||||
xEventGroupSetBits(s_wifi_event_group, WIFI_CONNECTED_BIT);
|
||||
LEDBlinkTask(1000, 5, true);
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
static void event_handler(void* arg, esp_event_base_t event_base,
|
||||
int32_t event_id, void* event_data)
|
||||
{
|
||||
if (event_base == WIFI_EVENT && event_id == WIFI_EVENT_STA_START) {
|
||||
LEDBlinkTask(200, 1, true);
|
||||
esp_wifi_connect();
|
||||
} else if (event_base == WIFI_EVENT && event_id == WIFI_EVENT_STA_DISCONNECTED) {
|
||||
// if (s_retry_num < EXAMPLE_ESP_MAXIMUM_RETRY){
|
||||
esp_wifi_connect();
|
||||
s_retry_num++;
|
||||
ESP_LOGI(TAG, "retry to connect to the AP");
|
||||
ESP_LOGI(TAG,"connect to the AP fail");
|
||||
} else if (event_base == IP_EVENT && event_id == IP_EVENT_STA_GOT_IP) {
|
||||
ip_event_got_ip_t* event = (ip_event_got_ip_t*) event_data;
|
||||
ESP_LOGI(TAG, "got ip:" IPSTR, IP2STR(&event->ip_info.ip));
|
||||
@@ -153,7 +131,6 @@ static void event_handler(void* arg, esp_event_base_t event_base,
|
||||
LEDBlinkTask(1000, 5, true);
|
||||
}
|
||||
}
|
||||
*/
|
||||
|
||||
void strinttoip4(const char *ip, int &a, int &b, int &c, int &d) {
|
||||
std::string zw = std::string(ip);
|
||||
@@ -246,101 +223,13 @@ void wifi_init_sta(const char *_ssid, const char *_password, const char *_hostna
|
||||
} else {
|
||||
ESP_LOGE(TAG, "UNEXPECTED EVENT");
|
||||
}
|
||||
ssid = std::string(_ssid);
|
||||
|
||||
|
||||
/* The event will not be processed after unregister */
|
||||
// ESP_ERROR_CHECK(esp_event_handler_instance_unregister(IP_EVENT, IP_EVENT_STA_GOT_IP, instance_got_ip));
|
||||
// ESP_ERROR_CHECK(esp_event_handler_instance_unregister(WIFI_EVENT, ESP_EVENT_ANY_ID, instance_any_id));
|
||||
// vEventGroupDelete(s_wifi_event_group);
|
||||
|
||||
/*
|
||||
ssid = std::string(_ssid);
|
||||
|
||||
s_wifi_event_group = xEventGroupCreate();
|
||||
|
||||
ESP_ERROR_CHECK(esp_netif_init());
|
||||
ESP_ERROR_CHECK(esp_event_loop_create_default());
|
||||
|
||||
/////////////////////////////////////////////////////////////////
|
||||
|
||||
|
||||
esp_netif_t *my_sta = esp_netif_create_default_wifi_sta();
|
||||
|
||||
if ((_ipadr != NULL) && (_gw != NULL) && (_netmask != NULL))
|
||||
{
|
||||
ESP_LOGI(TAG, "set IP %s, GW %s, Netmask %s manual", _ipadr, _gw, _netmask);
|
||||
esp_netif_dhcpc_stop(my_sta);
|
||||
|
||||
esp_netif_ip_info_t ip_info;
|
||||
int a, b, c, d;
|
||||
strinttoip4(_ipadr, a, b, c, d);
|
||||
IP4_ADDR(&ip_info.ip, a, b, c, d);
|
||||
strinttoip4(_gw, a, b, c, d);
|
||||
IP4_ADDR(&ip_info.gw, a, b, c, d);
|
||||
strinttoip4(_netmask, a, b, c, d);
|
||||
IP4_ADDR(&ip_info.netmask, a, b, c, d);
|
||||
|
||||
esp_netif_set_ip_info(my_sta, &ip_info);
|
||||
}
|
||||
|
||||
wifi_init_config_t cfg = WIFI_INIT_CONFIG_DEFAULT();
|
||||
ESP_ERROR_CHECK(esp_wifi_init(&cfg));
|
||||
|
||||
if ((_ipadr != NULL) && (_gw != NULL) && (_netmask != NULL))
|
||||
{
|
||||
if (_dns == NULL)
|
||||
_dns = _gw;
|
||||
|
||||
ESP_LOGI(TAG, "set DNS manual");
|
||||
esp_netif_dns_info_t dns_info;
|
||||
ip4_addr_t ip;
|
||||
ip.addr = esp_ip4addr_aton(_dns);
|
||||
ip_addr_set_ip4_u32(&dns_info.ip, ip.addr);
|
||||
ESP_ERROR_CHECK(esp_netif_set_dns_info(my_sta, ESP_NETIF_DNS_MAIN, &dns_info));
|
||||
}
|
||||
|
||||
ESP_ERROR_CHECK(esp_event_handler_register(WIFI_EVENT, ESP_EVENT_ANY_ID, &event_handler, NULL));
|
||||
ESP_ERROR_CHECK(esp_event_handler_register(IP_EVENT, IP_EVENT_STA_GOT_IP, &event_handler, NULL));
|
||||
|
||||
wifi_config_t wifi_config = { };
|
||||
|
||||
strcpy((char*)wifi_config.sta.ssid, (const char*)_ssid);
|
||||
strcpy((char*)wifi_config.sta.password, (const char*)_password);
|
||||
|
||||
ESP_ERROR_CHECK(esp_wifi_set_mode(WIFI_MODE_STA) );
|
||||
ESP_ERROR_CHECK(esp_wifi_set_config(WIFI_IF_STA, &wifi_config) );
|
||||
ESP_ERROR_CHECK(esp_wifi_start() );
|
||||
|
||||
if (_hostname != NULL)
|
||||
{
|
||||
esp_err_t ret = tcpip_adapter_set_hostname(TCPIP_ADAPTER_IF_STA , _hostname);
|
||||
hostname = std::string(_hostname);
|
||||
if(ret != ESP_OK ){
|
||||
ESP_LOGE(TAG,"failed to set hostname:%d",ret);
|
||||
}
|
||||
}
|
||||
|
||||
ESP_LOGI(TAG, "wifi_init_sta finished.");
|
||||
|
||||
// Waiting until either the connection is established (WIFI_CONNECTED_BIT) or connection failed for the maximum
|
||||
// number of re-tries (WIFI_FAIL_BIT). The bits are set by event_handler() (see above)
|
||||
EventBits_t bits = xEventGroupWaitBits(s_wifi_event_group,
|
||||
WIFI_CONNECTED_BIT | WIFI_FAIL_BIT,
|
||||
pdFALSE,
|
||||
pdFALSE,
|
||||
portMAX_DELAY);
|
||||
|
||||
// xEventGroupWaitBits() returns the bits before the call returned, hence we can test which event actually
|
||||
// happened.
|
||||
if (bits & WIFI_CONNECTED_BIT) {
|
||||
ESP_LOGI(TAG, "connected to ap SSID:%s password:%s",
|
||||
_ssid, _password);
|
||||
} else if (bits & WIFI_FAIL_BIT) {
|
||||
ESP_LOGI(TAG, "Failed to connect to SSID:%s, password:%s",
|
||||
_ssid, _password);
|
||||
} else {
|
||||
ESP_LOGE(TAG, "UNEXPECTED EVENT");
|
||||
}
|
||||
*/
|
||||
}
|
||||
|
||||
int get_WIFI_RSSI()
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
const char* GIT_REV="b0d8ed6";
|
||||
const char* GIT_REV="7187101";
|
||||
const char* GIT_TAG="";
|
||||
const char* GIT_BRANCH="master";
|
||||
const char* BUILD_TIME="2022-02-12 09:04";
|
||||
const char* BUILD_TIME="2022-02-22 19:05";
|
||||
@@ -13,7 +13,7 @@ extern "C"
|
||||
#include "Helper.h"
|
||||
#include <fstream>
|
||||
|
||||
const char* GIT_BASE_BRANCH = "master - v10.4.0 - 2022-02-12";
|
||||
const char* GIT_BASE_BRANCH = "master - v10.5.2 - 2022-02-22";
|
||||
|
||||
|
||||
const char* git_base_branch(void)
|
||||
|
||||
@@ -1224,8 +1224,10 @@ CONFIG_OV5640_SUPPORT=y
|
||||
CONFIG_GC2145_SUPPORT=y
|
||||
CONFIG_GC032A_SUPPORT=y
|
||||
CONFIG_GC0308_SUPPORT=y
|
||||
CONFIG_BF3005_SUPPORT=y
|
||||
# CONFIG_SCCB_HARDWARE_I2C_PORT0 is not set
|
||||
CONFIG_SCCB_HARDWARE_I2C_PORT1=y
|
||||
CONFIG_SCCB_CLK_FREQ=100000
|
||||
# CONFIG_GC_SENSOR_WINDOWING_MODE is not set
|
||||
CONFIG_GC_SENSOR_SUBSAMPLE_MODE=y
|
||||
CONFIG_CAMERA_CORE0=y
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
const char* GIT_REV="b0d8ed6";
|
||||
const char* GIT_REV="7187101";
|
||||
const char* GIT_TAG="";
|
||||
const char* GIT_BRANCH="master";
|
||||
const char* BUILD_TIME="2022-02-12 09:04";
|
||||
const char* BUILD_TIME="2022-02-22 19:05";
|
||||
BIN
firmware/ana-s2-q-20220213.tflite
Normal file
BIN
firmware/ana-s2-q-20220213.tflite
Normal file
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
@@ -1480,12 +1480,21 @@ function WriteParameter(_param, _category, _cat, _name, _optional, _number = -1)
|
||||
if (textToFind == undefined)
|
||||
continue;
|
||||
|
||||
_isFound = false;
|
||||
element.selectedIndex = -1;
|
||||
for (var i = 0; i < element.options.length; i++) {
|
||||
if (element.options[i].value.toLowerCase() === textToFind.toLowerCase()) {
|
||||
element.selectedIndex = i;
|
||||
_isFound = true;
|
||||
break;
|
||||
}
|
||||
}
|
||||
if (!_isFound)
|
||||
{
|
||||
_zw_txt = "In the selectd field the value '" + textToFind + "' in the parameter '";
|
||||
_zw_txt = _zw_txt + _cat + "' in the field '" + _name + "' is invalid.\nPLEASE CHECK BEFORE SAVING!";
|
||||
alert(_zw_txt);
|
||||
}
|
||||
}
|
||||
else if ((element.getAttribute("type") != null) && (element.getAttribute("type").toLowerCase() == "checkbox")) {
|
||||
element.checked = NUMBERS[_number][_cat][_name]["value"+j] == "true";
|
||||
@@ -1512,12 +1521,22 @@ function WriteParameter(_param, _category, _cat, _name, _optional, _number = -1)
|
||||
if (textToFind == undefined)
|
||||
continue;
|
||||
|
||||
_isFound = false;
|
||||
element.selectedIndex = -1;
|
||||
for (var i = 0; i < element.options.length; i++) {
|
||||
if (element.options[i].value.toLowerCase() === textToFind.toLowerCase()) {
|
||||
element.selectedIndex = i;
|
||||
_isFound = true;
|
||||
break;
|
||||
}
|
||||
}
|
||||
if (!_isFound)
|
||||
{
|
||||
_zw_txt = "In the selectd field the value '" + textToFind + "' in the section '";
|
||||
_zw_txt = _zw_txt + _cat + "' in the field '" + _name + "' is invalid.\nPLEASE CHECK BEFORE SAVING!";
|
||||
alert(_zw_txt);
|
||||
}
|
||||
|
||||
}
|
||||
else if ((element.getAttribute("type") != null) && (element.getAttribute("type").toLowerCase() == "checkbox")) {
|
||||
element.checked = _param[_cat][_name]["value"+j] == "true";
|
||||
|
||||
@@ -13,7 +13,7 @@ function getbasepath(){
|
||||
{
|
||||
// host = "http://192.168.2.219"; // jomjol interner test
|
||||
// host = "http://192.168.178.46"; // jomjol interner test
|
||||
host = "http://192.168.178.62"; // jomjol interner Real
|
||||
host = "http://192.168.178.34"; // jomjol interner Real
|
||||
// host = "http://192.168.43.191";
|
||||
// host = "."; // jomjol interner localhost
|
||||
|
||||
|
||||
@@ -1 +1 @@
|
||||
13.1.0
|
||||
13.1.1
|
||||
Reference in New Issue
Block a user