mirror of
https://github.com/jomjol/AI-on-the-edge-device.git
synced 2025-12-12 14:37:06 +03:00
@@ -2,8 +2,6 @@ cmake_minimum_required(VERSION 3.13.4)
|
||||
|
||||
list(APPEND EXTRA_COMPONENT_DIRS $ENV{IDF_PATH}/examples/common_components/protocol_examples_common)
|
||||
|
||||
set(PROJECT_VER "0.0.9.3")
|
||||
|
||||
ADD_CUSTOM_COMMAND(
|
||||
OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/version.cpp
|
||||
${CMAKE_CURRENT_BINARY_DIR}/_version.cpp
|
||||
|
||||
@@ -39,6 +39,7 @@ set(VERSION "const char* GIT_REV=\"${GIT_REV}${GIT_DIFF}\";
|
||||
const char* GIT_TAG=\"${GIT_TAG}\";
|
||||
const char* GIT_BRANCH=\"${GIT_BRANCH}\";
|
||||
const char* BUILD_TIME=\"${BUILD_TIME}\";")
|
||||
set(VERSION_HTML "${GIT_BRANCH}, ${GIT_REV}${GIT_DIFF}, ${GIT_TAG}")
|
||||
|
||||
if(EXISTS ${CMAKE_CURRENT_SOURCE_DIR}/version.cpp)
|
||||
file(READ ${CMAKE_CURRENT_SOURCE_DIR}/version.cpp VERSION_)
|
||||
@@ -48,6 +49,7 @@ endif()
|
||||
|
||||
if (NOT "${VERSION}" STREQUAL "${VERSION_}")
|
||||
file(WRITE ${CMAKE_CURRENT_SOURCE_DIR}/version.cpp "${VERSION}")
|
||||
file(WRITE ${CMAKE_CURRENT_SOURCE_DIR}/../sd-card/html/version.txt "${VERSION_HTML}")
|
||||
endif()
|
||||
#######################################################################
|
||||
#######################################################################
|
||||
|
||||
@@ -29,6 +29,11 @@
|
||||
#include "server_camera.h"
|
||||
#include "Helper.h"
|
||||
|
||||
extern const char* GIT_TAG;
|
||||
extern const char* GIT_REV;
|
||||
extern const char* GIT_BRANCH;
|
||||
extern const char* BUILD_TIME;
|
||||
|
||||
// #include "jomjol_WS2812Slow.h"
|
||||
#include "SmartLeds.h"
|
||||
|
||||
@@ -133,6 +138,12 @@ void task_NoSDBlink(void *pvParameter)
|
||||
extern "C" void app_main(void)
|
||||
{
|
||||
TickType_t xDelay;
|
||||
string versionFormated = "Branch: '" + std::string(GIT_BRANCH) + "', Tag: '" + std::string(GIT_TAG) + \
|
||||
"', Revision: " + std::string(GIT_REV) +", Date/Time: " + std::string(BUILD_TIME);
|
||||
|
||||
printf("=============================================================================================\n");
|
||||
printf("%s\n", versionFormated.c_str());
|
||||
printf("=============================================================================================\n");
|
||||
|
||||
PowerResetCamera();
|
||||
esp_err_t cam = Camera.InitCam();
|
||||
@@ -180,6 +191,7 @@ extern "C" void app_main(void)
|
||||
LogFile.WriteToFile("=============================================================================================");
|
||||
LogFile.WriteToFile("=================================== Main Started ============================================");
|
||||
LogFile.WriteToFile("=============================================================================================");
|
||||
LogFile.WriteToFile(versionFormated);
|
||||
LogFile.SwitchOnOff(false);
|
||||
|
||||
std::string zw = gettimestring("%Y%m%d-%H%M%S");
|
||||
|
||||
@@ -82,7 +82,9 @@ esp_err_t info_get_handler(httpd_req_t *req)
|
||||
|
||||
if (_task.compare("GitBaseBranch") == 0)
|
||||
{
|
||||
httpd_resp_sendstr_chunk(req, git_base_branch());
|
||||
string buf = "Branch: '" + std::string(GIT_BRANCH) + "', Tag: '" + std::string(GIT_TAG) + \
|
||||
"', Revision: " + std::string(GIT_REV);
|
||||
httpd_resp_sendstr_chunk(req, buf.c_str());
|
||||
httpd_resp_sendstr_chunk(req, NULL);
|
||||
return ESP_OK;
|
||||
}
|
||||
@@ -285,7 +287,8 @@ esp_err_t sysinfo_handler(httpd_req_t *req)
|
||||
std::string gitversion = libfive_git_version();
|
||||
std::string buildtime = build_time();
|
||||
std::string gitbranch = libfive_git_branch();
|
||||
std::string gitbasebranch = git_base_branch();
|
||||
std::string gittag = libfive_git_version();
|
||||
std::string gitrevision = libfive_git_revision();
|
||||
std::string htmlversion = getHTMLversion();
|
||||
char freeheapmem[11];
|
||||
sprintf(freeheapmem, "%zu", esp_get_free_heap_size());
|
||||
@@ -300,7 +303,8 @@ esp_err_t sysinfo_handler(httpd_req_t *req)
|
||||
\"firmware\" : \"" + gitversion + "\",\
|
||||
\"buildtime\" : \"" + buildtime + "\",\
|
||||
\"gitbranch\" : \"" + gitbranch + "\",\
|
||||
\"gitbasebranch\" : \"" + gitbasebranch + "\",\
|
||||
\"gittag\" : \"" + gittag + "\",\
|
||||
\"gitrevision\" : \"" + gitrevision + "\",\
|
||||
\"html\" : \"" + htmlversion + "\",\
|
||||
\"cputemp\" : \"" + cputemp + "\",\
|
||||
\"hostname\" : \"" + hostname + "\",\
|
||||
|
||||
@@ -1,3 +1,6 @@
|
||||
#ifndef _VERSION_H
|
||||
#define _VERSION_H
|
||||
|
||||
// These variables are autogenerated and compiled
|
||||
// into the library by the version.cmake script
|
||||
extern "C"
|
||||
@@ -13,14 +16,6 @@ extern "C"
|
||||
#include "Helper.h"
|
||||
#include <fstream>
|
||||
|
||||
const char* GIT_BASE_BRANCH = "master - v11.3.0 - 2022-09-16";
|
||||
|
||||
|
||||
const char* git_base_branch(void)
|
||||
{
|
||||
return GIT_BASE_BRANCH;
|
||||
}
|
||||
|
||||
|
||||
const char* build_time(void)
|
||||
{
|
||||
@@ -43,7 +38,7 @@ const char* libfive_git_branch(void)
|
||||
}
|
||||
|
||||
|
||||
char _char_getHTMLversion[20]="NaN\0";
|
||||
char _char_getHTMLversion[50]="NaN\0";
|
||||
|
||||
const char* getHTMLversion(void){
|
||||
FILE* pFile;
|
||||
@@ -53,8 +48,10 @@ const char* getHTMLversion(void){
|
||||
if (pFile == NULL)
|
||||
return _char_getHTMLversion;
|
||||
|
||||
fgets(_char_getHTMLversion, 20, pFile);
|
||||
fgets(_char_getHTMLversion, sizeof(_char_getHTMLversion), pFile);
|
||||
fclose(pFile);
|
||||
|
||||
return _char_getHTMLversion;
|
||||
}
|
||||
|
||||
#endif // _VERSION_H
|
||||
@@ -29,3 +29,28 @@ function LoadHostname() {
|
||||
// alert("Loading Hostname failed");
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
function LoadVersion() {
|
||||
_basepath = getbasepath();
|
||||
|
||||
var xhttp = new XMLHttpRequest();
|
||||
xhttp.addEventListener('load', function(event) {
|
||||
if (xhttp.status >= 200 && xhttp.status < 300) {
|
||||
version = xhttp.responseText;
|
||||
document.getElementById("Version").innerHTML = version;
|
||||
}
|
||||
else {
|
||||
console.warn(request.statusText, request.responseText);
|
||||
}
|
||||
});
|
||||
|
||||
try {
|
||||
url = _basepath + '/version?type=GitBaseBranch';
|
||||
xhttp.open("GET", url, true);
|
||||
xhttp.send();
|
||||
|
||||
}
|
||||
catch (error)
|
||||
{}
|
||||
}
|
||||
|
||||
@@ -151,8 +151,11 @@ li.dropdown {
|
||||
|
||||
<iframe name="maincontent" class="iframe" id="maincontent" src="wasserzaehler_roi.html"></iframe>
|
||||
|
||||
<span id="Version" style="font-size: 10px; margin-top: -5px">Loading version...</span>
|
||||
|
||||
<script type="text/javascript">
|
||||
LoadHostname();
|
||||
LoadVersion();
|
||||
</script>
|
||||
|
||||
</div>
|
||||
|
||||
@@ -152,11 +152,15 @@ li.dropdown {
|
||||
|
||||
<iframe name="maincontent" class="iframe" id="maincontent" src="edit_config_param.html"></iframe>
|
||||
|
||||
<span id="Version" style="font-size: 10px; margin-top: -5px">Loading version...</span>
|
||||
|
||||
<script type="text/javascript" src="common.js"></script>
|
||||
<script type="text/javascript" src="gethost.js"></script>
|
||||
|
||||
|
||||
<script type="text/javascript">
|
||||
LoadHostname();
|
||||
LoadVersion();
|
||||
</script>
|
||||
|
||||
</div>
|
||||
|
||||
@@ -12,7 +12,7 @@ h3 {font-size: 1.2em;}
|
||||
p {font-size: 1em;}
|
||||
|
||||
div {
|
||||
width: 250px;
|
||||
width: 350px;
|
||||
padding: 10px 5px;
|
||||
border: 1px solid #ccc;
|
||||
font-family: arial;
|
||||
@@ -93,22 +93,22 @@ div {
|
||||
|
||||
<tr>
|
||||
<td>
|
||||
Git-Base-Branch:
|
||||
Git-Tag:
|
||||
</td>
|
||||
<td>
|
||||
<div>
|
||||
<object data="/version?type=GitBaseBranch"></object>
|
||||
<object data="/version?type=GitTag"></object>
|
||||
</div>
|
||||
</td>
|
||||
</tr>
|
||||
|
||||
<tr>
|
||||
<td>
|
||||
Git-Version:
|
||||
Git-Revision:
|
||||
</td>
|
||||
<td>
|
||||
<div>
|
||||
<object data="/version?type=GitVersion"></object>
|
||||
<object data="/version?type=GitRevision"></object>
|
||||
</div>
|
||||
</td>
|
||||
</tr>
|
||||
|
||||
@@ -1 +1,2 @@
|
||||
16.4.1
|
||||
# HTML version
|
||||
# Do not edit, it will get be updated by cmake!
|
||||
Reference in New Issue
Block a user