Compare commits

...

13 Commits

Author SHA1 Message Date
jomjol
1371be6f2c v10.4.0 2022-02-12 09:11:43 +01:00
jomjol
b0d8ed6248 v10.4.0 2022-02-12 09:02:00 +01:00
jomjol
379f4585e3 Rolling 20220211 2022-02-11 21:38:40 +01:00
jomjol
45a71981c8 Rolling 20220208 2022-02-08 19:36:25 +01:00
jomjol
ac3409f644 Update FeatureRequest.md 2022-02-06 20:24:59 +01:00
jomjol
11c33f81dd Rolling 20220206 2022-02-06 19:50:47 +01:00
jomjol
641cc860d8 v10.3.0 2022-01-29 15:59:13 +01:00
jomjol
2029bd6e8a Rolling 20220122 2022-01-29 15:41:56 +01:00
jomjol
1ca5e1218d Rolling 20220128 2022-01-28 19:17:05 +01:00
jomjol
887c704f63 Rolling 20220127 2022-01-27 21:43:54 +01:00
jomjol
567dc74cd7 Rolling 20220123 2022-01-23 19:47:34 +01:00
jomjol
53606d5055 Rolling 20220121 2022-01-21 20:50:54 +01:00
jomjol
19a6c21c44 Rolling 20220118 2022-01-18 07:16:38 +01:00
65 changed files with 1906 additions and 586 deletions

View File

@@ -11,6 +11,30 @@
____
#### #22 Direct hint to the different neural network files in the other repositories
* https://github.com/jomjol/AI-on-the-edge-device/issues/644
#### #21 Extended "CheckDigitalConsistency" Logik
* https://github.com/jomjol/AI-on-the-edge-device/issues/590
#### #20 Deep sleep and push mode
* Let the device be normally in deep sleep state, and wake it up periodically to collect data and push it via MQTT or HTTP post.
#### #19 Extended log informations
* https://github.com/jomjol/AI-on-the-edge-device/issues/580
#### #18 Document WLAN-strength in web page
* https://github.com/jomjol/AI-on-the-edge-device/issues/563

View File

@@ -46,7 +46,7 @@ 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) - self recovery implemented
* ~~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,9 +54,38 @@ In other cases you can contact the developer via email: <img src="https://raw.gi
##### 10.4.0 - Stability Increase (2022-02-12)
- Graphical configuration: select available neural network files (*.tfl, *.tflite) from drop down menu
- OTA-update: add option to upload tfl / tflite files to the correct locatioin (`/config/`)
- in future the new files will also be copied to the `firmware` directory of the repository
- Added Wifi RSSI to MQTT information
- Updated analog neural network file (`ana-s3-q-20220105.tflite`)
- Updated digital neural network file (`dig-s1-q-20220102.tflite`)
- Updated build environment to `Espressif 3.5.0`
##### 10.3.0 - Stability Increase (2022-01-29)
- Implemented LED flash dimming (`LEDIntensity`).
Remark: as auto illumination in the camera is used, this is rather for energy saving. It will not help reducing reflections
- Additional camera parameters: saturation, contrast (although not too much impact yet)
- Readings with not automatically removable "N"s are handled like "error" --> no return value in the field "value" anymore
(still reported back via field "raw value")
- Updated esp32 camera hardware driver
- Bug fix: MQTT, html improvements
**ATTENTION: The new ESP32 camera hardware driver is much more stable on newer OV2640 versions (no or much less reboots) but seems to be not fully compatible with older versions.**
* If you have problem with stalled systems you can try the following
- Update the parameter `ImageQuality` to `12` instead of current value `5` (manually in the `config.ini`)
- If this is not helping, you might need to update your hardware or stay with version 9.2
##### 10.2.0 - Stability Increase (2022-01-14)
- **ATTENTION:** Due to the update camera driver, the image looks different and a new setup might be needed
- Due to the update camera driver, the image looks different and a new setup might be needed
- Update reference image
- Update Alignment marks

View File

@@ -3,8 +3,6 @@ on:
push:
branches:
- master
- bugfix/*
- feature/*
pull_request:
jobs:

View File

@@ -0,0 +1,21 @@
name: Push component to https://components.espressif.com
on:
push:
tags:
- v*
jobs:
upload_components:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@master
with:
submodules: "recursive"
- name: Upload component to the component registry
uses: espressif/github-actions/upload_components@master
with:
name: "esp32-camera"
version: "git"
namespace: "espressif"
service_url: ${{ secrets.IDF_COMPONENT_API_URL }}
api_token: ${{ secrets.IDF_COMPONENT_API_TOKEN }}

View File

@@ -13,6 +13,7 @@ if(IDF_TARGET STREQUAL "esp32" OR IDF_TARGET STREQUAL "esp32s2" OR IDF_TARGET ST
sensors/gc0308.c
sensors/gc2145.c
sensors/gc032a.c
sensors/bf3005.c
conversions/yuv.c
conversions/to_jpg.cpp
conversions/to_bmp.c

View File

@@ -62,6 +62,13 @@ menu "Camera configuration"
help
Enable this option if you want to use the GC0308.
Disable this option to save memory.
config BF3005_SUPPORT
bool "Support BF3005(BYD3005) VGA"
default y
help
Enable this option if you want to use the BF3005.
Disable this option to save memory.
choice SCCB_HARDWARE_I2C_PORT
bool "I2C peripheral to use for SCCB"
@@ -74,6 +81,14 @@ menu "Camera configuration"
endchoice
config SCCB_CLK_FREQ
int "SCCB clk frequency"
default 100000
range 100000 400000
help
Increasing this value can reduce the initialization time of the sensor.
Please refer to the relevant instructions of the sensor to adjust the value.
choice GC_SENSOR_WINDOW_MODE
bool "GalaxyCore Sensor Window Mode"
depends on (GC2145_SUPPORT || GC032A_SUPPORT || GC0308_SUPPORT)

View File

@@ -24,6 +24,7 @@ This repository hosts ESP32 series Soc compatible driver for image sensors. Addi
| GC032A | 640 x 480 | color | YUV/YCbCr422<br/>RAW Bayer<br/>RGB565 | 1/10" |
| GC0308 | 640 x 480 | color | YUV/YCbCr422<br/>RAW Bayer<br/>RGB565 | 1/6.5" |
| GC2145 | 1600 x 1200 | color | YUV/YCbCr422<br/>RAW Bayer<br/>RGB565 | 1/5" |
| BF3005 | 640 x 480 | color | YUV/YCbCr422<br/>RAW Bayer<br/>RGB565 | 1/4" |
## Important to Remember

View File

@@ -263,7 +263,7 @@ static esp_err_t cam_dma_config(const camera_config_t *config)
}
}
/* Allocate memeory for frame buffer */
/* Allocate memory for frame buffer */
size_t alloc_size = fb_size * sizeof(uint8_t) + dma_align;
uint32_t _caps = MALLOC_CAP_8BIT;
if (CAMERA_FB_IN_DRAM == config->fb_location) {

View File

@@ -54,7 +54,9 @@
#if CONFIG_GC0308_SUPPORT
#include "gc0308.h"
#endif
#if CONFIG_BF3005_SUPPORT
#include "bf3005.h"
#endif
#if defined(ARDUINO_ARCH_ESP32) && defined(CONFIG_ARDUHAL_ESP_LOG)
#include "esp32-hal-log.h"
@@ -114,6 +116,9 @@ static const sensor_func_t g_sensors[] = {
#if CONFIG_GC0308_SUPPORT
{gc0308_detect, gc0308_init},
#endif
#if CONFIG_BF3005_SUPPORT
{bf3005_detect, bf3005_init},
#endif
};
static esp_err_t camera_probe(const camera_config_t *config, camera_model_t *out_camera_model)

View File

@@ -26,6 +26,7 @@ typedef enum {
GC2145_PID = 0x2145,
GC032A_PID = 0x232a,
GC0308_PID = 0x9b,
BF3005_PID = 0x30,
} camera_pid_t;
typedef enum {
@@ -38,6 +39,7 @@ typedef enum {
CAMERA_GC2145,
CAMERA_GC032A,
CAMERA_GC0308,
CAMERA_BF3005,
CAMERA_MODEL_MAX,
CAMERA_NONE,
} camera_model_t;
@@ -52,6 +54,7 @@ typedef enum {
GC2145_SCCB_ADDR = 0x3C,// 0x78 >> 1
GC032A_SCCB_ADDR = 0x21,// 0x42 >> 1
GC0308_SCCB_ADDR = 0x21,// 0x42 >> 1
BF3005_SCCB_ADDR = 0x6E,
} camera_sccb_addr_t;
typedef enum {

View File

@@ -25,13 +25,13 @@ static const char* TAG = "sccb";
#include "driver/i2c.h"
#define SCCB_FREQ 100000 /*!< I2C master frequency*/
#define WRITE_BIT I2C_MASTER_WRITE /*!< I2C master write */
#define READ_BIT I2C_MASTER_READ /*!< I2C master read */
#define ACK_CHECK_EN 0x1 /*!< I2C master will check ack from slave*/
#define ACK_CHECK_DIS 0x0 /*!< I2C master will not check ack from slave */
#define ACK_VAL 0x0 /*!< I2C ack value */
#define NACK_VAL 0x1 /*!< I2C nack value */
#define SCCB_FREQ CONFIG_SCCB_CLK_FREQ /*!< I2C master frequency*/
#define WRITE_BIT I2C_MASTER_WRITE /*!< I2C master write */
#define READ_BIT I2C_MASTER_READ /*!< I2C master read */
#define ACK_CHECK_EN 0x1 /*!< I2C master will check ack from slave*/
#define ACK_CHECK_DIS 0x0 /*!< I2C master will not check ack from slave */
#define ACK_VAL 0x0 /*!< I2C ack value */
#define NACK_VAL 0x1 /*!< I2C nack value */
#if CONFIG_SCCB_HARDWARE_I2C_PORT1
const int SCCB_I2C_PORT = 1;
#else

View File

@@ -12,6 +12,7 @@ const camera_sensor_info_t camera_sensor[CAMERA_MODEL_MAX] = {
{CAMERA_GC2145, "GC2145", GC2145_SCCB_ADDR, GC2145_PID, FRAMESIZE_UXGA, false},
{CAMERA_GC032A, "GC032A", GC032A_SCCB_ADDR, GC032A_PID, FRAMESIZE_VGA, false},
{CAMERA_GC0308, "GC0308", GC0308_SCCB_ADDR, GC0308_PID, FRAMESIZE_VGA, false},
{CAMERA_BF3005, "BF3005", BF3005_SCCB_ADDR, BF3005_PID, FRAMESIZE_VGA, false},
};
const resolution_info_t resolution[FRAMESIZE_INVALID] = {

View File

@@ -0,0 +1,5 @@
description: ESP32 compatible driver for OV2640, OV3660, OV5640, OV7670 and OV7725 image sensors.
targets:
- esp32
- esp32s2
- esp32s3

View File

@@ -1,6 +1,6 @@
{
"name": "esp32-camera",
"version": "1.0.0",
"version": "2.0.0",
"keywords": "esp32, camera, espressif, esp32-cam",
"description": "ESP32 compatible driver for OV2640, OV3660, OV5640, OV7670 and OV7725 image sensors.",
"repository": {

View File

@@ -0,0 +1,541 @@
/*
* This file is part of the OpenMV project.
* Copyright (c) 2013/2014 Ibrahim Abdelkader <i.abdalkader@gmail.com>
* This work is licensed under the MIT license, see the file LICENSE for details.
*
* BF3005 driver.
*
* Copyright 2015-2021 Espressif Systems (Shanghai) PTE LTD
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*
*/
#include <stdint.h>
#include <stdlib.h>
#include <string.h>
#include <stdio.h>
#include "sccb.h"
#include "xclk.h"
#include "bf3005.h"
#include "bf3005_regs.h"
#include "freertos/FreeRTOS.h"
#include "freertos/task.h"
#if defined(ARDUINO_ARCH_ESP32) && defined(CONFIG_ARDUHAL_ESP_LOG)
#include "esp32-hal-log.h"
#else
#include "esp_log.h"
static const char* TAG = "bf3005";
#endif
static const uint8_t default_regs[][2] = {
{0x12, 0x40}, //soft reset
{0xff, 0xff}, //delay
{0xff, 0xff}, //delay
{0xff, 0xff}, //delay
{0xff, 0xff}, //delay
{0x13, 0x10},
{0x8c, 0x00},
{0x8d, 0x64},
{0x87, 0x10},
{0x13, 0x17},
{0x00, 0x20},
{0x01, 0x1a},
{0x02, 0x22},
{0x09, 0x03},
{0x0c, 0x80},
{0x0d, 0x24},
{0x0e, 0x21},
{0x0f, 0x28},
{0x11, 0x08},
{0x15, 0x10}, // 0X10
{0x16, 0x03},
{0x1e, 0x30},
{0x20, 0x8a},
{0x21, 0x03},
{0x23, 0x55},
{0x24, 0x68},
{0x25, 0x78},
{0x2a, 0x00},
{0x2b, 0x00},
{0x2d, 0x4f},
{0x2e, 0x98},
{0x2f, 0x04},
{0x30, 0xad},
{0x31, 0x17},
{0x32, 0x6e},
{0x33, 0x20},
{0x35, 0xa6},
{0x3b, 0x00},
{0x3e, 0x00},
{0x3f, 0xA8},
{0x40, 0x38},
{0x41, 0x32},
{0x42, 0x2b},
{0x43, 0x26},
{0x44, 0x1a},
{0x45, 0x16},
{0x46, 0x10},
{0x47, 0x0f},
{0x48, 0x0c},
{0x49, 0x0a},
{0x4b, 0x09},
{0x4c, 0x08},
{0x4d, 0x3c},
{0x4e, 0x06},
{0x4f, 0x05},
{0x50, 0x03},
{0x51, 0x25},
{0x52, 0x88},
{0x53, 0x03},
{0x63, 0x20},
{0x64, 0x02},
{0x65, 0xa6},
{0x66, 0xb6},
{0x69, 0x00},
{0x70, 0xFF},
{0x71, 0xa6},
{0x72, 0x2f},
{0x73, 0x2f},
{0x74, 0x2F},
{0x75, 0x0e},
{0x76, 0x1e},
{0x77, 0x00},
{0x78, 0x1e},
{0x79, 0x8a},
{0x7d, 0xe2},
{0x80, 0x44},
{0x81, 0x00},
{0x82, 0x18},
{0x83, 0x1b},
{0x84, 0x24},
{0x85, 0x2a},
{0x86, 0x4f},
{0x89, 0x82}, //0x82
{0x8b, 0x02},
{0x8e, 0x03},
{0x8f, 0xFC},
{0x9d, 0x4d},
{0x9e, 0x41},
{0xa1, 0x21},
{0xa2, 0x12},
{0xa3, 0x32},
{0xa4, 0x05},
{0xa5, 0x32},
{0xa6, 0x04},
{0xa7, 0x7f},
{0xa8, 0x7f},
{0xa9, 0x21},
{0xaa, 0x21},
{0xab, 0x21},
{0xac, 0x0a},
{0xad, 0xf0},
{0xae, 0xff},
{0xaf, 0x1d},
{0xb0, 0x94},
{0xb1, 0xc0},
{0xb2, 0xc0},
{0xd2, 0x30},
{0xe0, 0x0d},
{0xe1, 0x44},
{0xe7, 0x7c},
{0xe8, 0x89},
{0xe9, 0x01},
{0xea, 0x01},
{0xf0, 0x01},
{0xf3, 0x49},
{0xf4, 0xff},
{0xf5, 0x01},
{0xf6, 0xf2},
{0xf7, 0x6f},
{0x1b, 0x80},
{0x00, 0x00},
};
static int get_reg(sensor_t *sensor, int reg, int mask)
{
int ret = SCCB_Read(sensor->slv_addr, reg & 0xFF);
if(ret > 0){
ret &= mask;
}
return ret;
}
static int set_reg(sensor_t *sensor, int reg, int mask, int value)
{
int ret = 0;
ret = SCCB_Read(sensor->slv_addr, reg & 0xFF);
if(ret < 0){
return ret;
}
value = (ret & ~mask) | (value & mask);
ret = SCCB_Write(sensor->slv_addr, reg & 0xFF, value);
return ret;
}
static int set_reg_bits(sensor_t *sensor, uint8_t reg, uint8_t offset, uint8_t length, uint8_t value)
{
int ret = 0;
ret = SCCB_Read(sensor->slv_addr, reg);
if(ret < 0){
return ret;
}
uint8_t mask = ((1 << length) - 1) << offset;
value = (ret & ~mask) | ((value << offset) & mask);
ret = SCCB_Write(sensor->slv_addr, reg & 0xFF, value);
return ret;
}
static int get_reg_bits(sensor_t *sensor, uint8_t reg, uint8_t offset, uint8_t length)
{
int ret = 0;
ret = SCCB_Read(sensor->slv_addr, reg);
if(ret < 0){
return ret;
}
uint8_t mask = ((1 << length) - 1) << offset;
return (ret & mask) >> offset;
}
static int reset(sensor_t *sensor)
{
int i=0;
const uint8_t (*regs)[2];
// Write default regsiters
for (i=0, regs = default_regs; regs[i][0]; i++) {
SCCB_Write(sensor->slv_addr, regs[i][0], regs[i][1]);
}
// Delay
vTaskDelay(50 / portTICK_PERIOD_MS);
return 0;
}
static int set_pixformat(sensor_t *sensor, pixformat_t pixformat)
{
int ret=0;
sensor->pixformat = pixformat;
switch (pixformat) {
case PIXFORMAT_RGB565:
set_reg_bits(sensor, 0x12, 2, 1, 1);
break;
case PIXFORMAT_RAW:
set_reg_bits(sensor, 0x12, 0, 3, 0x4);
break;
case PIXFORMAT_YUV422:
case PIXFORMAT_GRAYSCALE:
set_reg_bits(sensor, 0x12, 2, 1, 0);
break;
default:
return -1;
}
// Delay
vTaskDelay(30 / portTICK_PERIOD_MS);
return ret;
}
static int set_framesize(sensor_t *sensor, framesize_t framesize)
{
int ret=0;
if (framesize > FRAMESIZE_VGA) {
return -1;
}
uint16_t w = resolution[framesize].width;
uint16_t h = resolution[framesize].height;
// uint8_t reg = SCCB_Read(sensor->slv_addr, COM7);
sensor->status.framesize = framesize;
// Write MSBs
ret |= SCCB_Write(sensor->slv_addr, 0x17, 0);
ret |= SCCB_Write(sensor->slv_addr, 0x18, w>>2);
ret |= SCCB_Write(sensor->slv_addr, 0x19, 0);
ret |= SCCB_Write(sensor->slv_addr, 0x1a, h>>2);
// Write LSBs
ret |= SCCB_Write(sensor->slv_addr, 0x03, 0);
printf("%s %d\r\n", __func__, __LINE__);
if((w<=320)&&(h<=240))
{
printf("%s %d\r\n", __func__, __LINE__);
// Enable auto-scaling/zooming factors
//ret |= SCCB_Write(sensor->slv_addr, 0x12, 0x50);
set_reg_bits(sensor, 0x12, 4, 1, 1);
ret |= SCCB_Write(sensor->slv_addr, 0x17, (80-w/4));
ret |= SCCB_Write(sensor->slv_addr, 0x18, (80+w/4));
ret |= SCCB_Write(sensor->slv_addr, 0x19, (60-h/4));
ret |= SCCB_Write(sensor->slv_addr, 0x1a, (60+h/4));
ret |= SCCB_Write(sensor->slv_addr, 0x03, 0);
} else if((w<=640)&&(h<=480))
{
// Enable auto-scaling/zooming factors
//ret |= SCCB_Write(sensor->slv_addr, 0x12, 0x40);
set_reg_bits(sensor, 0x12, 4, 1, 0);
ret |= SCCB_Write(sensor->slv_addr, 0x17, (80-w/8));
ret |= SCCB_Write(sensor->slv_addr, 0x18, (80+w/8));
ret |= SCCB_Write(sensor->slv_addr, 0x19, (60-h/8));
ret |= SCCB_Write(sensor->slv_addr, 0x1a, (60+h/8));
ret |= SCCB_Write(sensor->slv_addr, 0x03, 0);
}
// Delay
vTaskDelay(30 / portTICK_PERIOD_MS);
return ret;
}
static int set_colorbar(sensor_t *sensor, int value)
{
int ret=0;
sensor->status.colorbar = value;
ret |= SCCB_Write(sensor->slv_addr, 0xb9, value);
return ret;
}
static int set_whitebal(sensor_t *sensor, int enable)
{
if(set_reg_bits(sensor, 0x13, 1, 1, enable) >= 0){
sensor->status.awb = !!enable;
}
return sensor->status.awb;
}
static int set_gain_ctrl(sensor_t *sensor, int enable)
{
if(set_reg_bits(sensor, 0x13, 2, 1, enable) >= 0){
sensor->status.agc = !!enable;
}
return sensor->status.agc;
}
static int set_exposure_ctrl(sensor_t *sensor, int enable)
{
if(set_reg_bits(sensor, 0x13, 0, 1, enable) >= 0){
sensor->status.aec = !!enable;
}
return sensor->status.aec;
}
static int set_hmirror(sensor_t *sensor, int enable)
{
if(set_reg_bits(sensor, 0x1e, 5, 1, enable) >= 0){
sensor->status.hmirror = !!enable;
}
return sensor->status.hmirror;
}
static int set_vflip(sensor_t *sensor, int enable)
{
if(set_reg_bits(sensor, 0x1e, 4, 1, enable) >= 0){
sensor->status.vflip = !!enable;
}
return sensor->status.vflip;
}
static int set_raw_gma_dsp(sensor_t *sensor, int enable)
{
int ret = 0;
ret = set_reg_bits(sensor, 0xf1, 1, 1, !enable);
if (ret == 0) {
ESP_LOGD(TAG, "Set raw_gma to: %d", !enable);
sensor->status.raw_gma = !enable;
}
return ret;
}
static int set_lenc_dsp(sensor_t *sensor, int enable)
{
int ret = 0;
ret = set_reg_bits(sensor, 0xf1, 0, 1, !enable);
if (ret == 0) {
ESP_LOGD(TAG, "Set lenc to: %d", !enable);
sensor->status.lenc = !enable;
}
return ret;
}
static int set_agc_gain(sensor_t *sensor, int option)
{
int ret = 0;
ret = set_reg_bits(sensor, 0x13, 4, 1, !!option);
if (ret == 0) {
ESP_LOGD(TAG, "Set gain to: %d", !!option);
sensor->status.agc_gain = !!option;
}
return ret;
}
static int set_awb_gain_dsp(sensor_t *sensor, int value)
{
int ret = 0;
ret = SCCB_Write(sensor->slv_addr, 0xa6, value);
if (ret == 0) {
ESP_LOGD(TAG, "Set awb gain threthold to: %d", value);
sensor->status.awb_gain = value;
}
return ret;
}
static int set_brightness(sensor_t *sensor, int level)
{
int ret = 0;
ret = SCCB_Write(sensor->slv_addr, 0x55, level);
if (ret == 0) {
ESP_LOGD(TAG, "Set brightness to: %d", level);
sensor->status.brightness = level;
}
return ret;
}
static int set_contrast(sensor_t *sensor, int level)
{
int ret = 0;
ret = SCCB_Write(sensor->slv_addr, 0x56, level);
if (ret == 0) {
ESP_LOGD(TAG, "Set contrast to: %d", level);
sensor->status.contrast = level;
}
return ret;
}
static int set_sharpness(sensor_t *sensor, int level)
{
int ret = 0;
ret = SCCB_Write(sensor->slv_addr, 0x70, level);
if (ret == 0) {
ESP_LOGD(TAG, "Set sharpness to: %d", level);
sensor->status.sharpness = level;
}
return ret;
}
static int init_status(sensor_t *sensor)
{
sensor->status.brightness = SCCB_Read(sensor->slv_addr, 0x55);
sensor->status.contrast = SCCB_Read(sensor->slv_addr, 0x56);
sensor->status.saturation = 0;
sensor->status.ae_level = 0;
sensor->status.gainceiling = SCCB_Read(sensor->slv_addr, 0x87);
sensor->status.awb = get_reg_bits(sensor, 0x13, 1, 1);
sensor->status.awb_gain = SCCB_Read(sensor->slv_addr, 0xa6);
sensor->status.aec = get_reg_bits(sensor, 0x13, 0, 1);
sensor->status.agc = get_reg_bits(sensor, 0x13, 2, 1);
sensor->status.raw_gma = get_reg_bits(sensor, 0xf1, 1, 1);
sensor->status.lenc = get_reg_bits(sensor, 0xf1, 0, 1);
sensor->status.hmirror = get_reg_bits(sensor, 0x1e, 5, 1);
sensor->status.vflip = get_reg_bits(sensor, 0x1e, 4, 1);
sensor->status.colorbar = SCCB_Read(sensor->slv_addr, 0xb9);
sensor->status.sharpness = SCCB_Read(sensor->slv_addr, 0x70);
return 0;
}
static int set_dummy(sensor_t *sensor, int val){ return -1; }
static int set_gainceiling_dummy(sensor_t *sensor, gainceiling_t val){ return -1; }
static int set_res_raw(sensor_t *sensor, int startX, int startY, int endX, int endY, int offsetX, int offsetY, int totalX, int totalY, int outputX, int outputY, bool scale, bool binning){return -1;}
static int _set_pll(sensor_t *sensor, int bypass, int multiplier, int sys_div, int root_2x, int pre_div, int seld5, int pclk_manual, int pclk_div){return -1;}
static int set_xclk(sensor_t *sensor, int timer, int xclk)
{
int ret = 0;
sensor->xclk_freq_hz = xclk * 1000000U;
ret = xclk_timer_conf(timer, sensor->xclk_freq_hz);
return ret;
}
int bf3005_detect(int slv_addr, sensor_id_t *id)
{
if (BF3005_SCCB_ADDR == slv_addr) {
uint16_t PID = SCCB_Read(slv_addr, 0xFC);
if (BF3005_PID == PID) {
id->PID = PID;
id->VER = SCCB_Read(slv_addr, 0xFD);
id->MIDL = SCCB_Read(slv_addr, 0xFC);
id->MIDH = SCCB_Read(slv_addr, 0xFD);
return PID;
} else {
ESP_LOGI(TAG, "Mismatch PID=0x%x", PID);
}
}
return 0;
}
int bf3005_init(sensor_t *sensor)
{
// Set function pointers
sensor->reset = reset;
sensor->init_status = init_status;
sensor->set_pixformat = set_pixformat;
sensor->set_framesize = set_framesize;
sensor->set_brightness = set_brightness;
sensor->set_contrast = set_contrast;
sensor->set_colorbar = set_colorbar;
sensor->set_gain_ctrl = set_gain_ctrl;
sensor->set_exposure_ctrl = set_exposure_ctrl;
sensor->set_hmirror = set_hmirror;
sensor->set_vflip = set_vflip;
sensor->set_whitebal = set_whitebal;
sensor->set_awb_gain = set_awb_gain_dsp;
sensor->set_agc_gain = set_agc_gain;
sensor->set_raw_gma = set_raw_gma_dsp;
sensor->set_lenc = set_lenc_dsp;
sensor->set_sharpness = set_sharpness;
//not supported
sensor->set_saturation= set_dummy;
sensor->set_denoise = set_dummy;
sensor->set_quality = set_dummy;
sensor->set_special_effect = set_dummy;
sensor->set_wb_mode = set_dummy;
sensor->set_ae_level = set_dummy;
sensor->set_gainceiling = set_gainceiling_dummy;
sensor->get_reg = get_reg;
sensor->set_reg = set_reg;
sensor->set_res_raw = set_res_raw;
sensor->set_pll = _set_pll;
sensor->set_xclk = set_xclk;
ESP_LOGD(TAG, "BF3005 Attached");
return 0;
}

View File

@@ -184,6 +184,8 @@ static int set_framesize(sensor_t *sensor, framesize_t framesize)
uint16_t h = resolution[framesize].height;
uint16_t row_s = (resolution[FRAMESIZE_VGA].height - h) / 2;
uint16_t col_s = (resolution[FRAMESIZE_VGA].width - w) / 2;
(void)row_s;
(void)col_s;
#if CONFIG_GC_SENSOR_SUBSAMPLE_MODE
struct subsample_cfg {

View File

@@ -190,6 +190,8 @@ static int set_framesize(sensor_t *sensor, framesize_t framesize)
uint16_t h = resolution[framesize].height;
uint16_t row_s = (resolution[FRAMESIZE_UXGA].height - h) / 2;
uint16_t col_s = (resolution[FRAMESIZE_UXGA].width - w) / 2;
(void)row_s;
(void)col_s;
#if CONFIG_GC_SENSOR_SUBSAMPLE_MODE
struct subsample_cfg {

View File

@@ -0,0 +1,33 @@
/*
* This file is part of the OpenMV project.
* Copyright (c) 2013/2014 Ibrahim Abdelkader <i.abdalkader@gmail.com>
* This work is licensed under the MIT license, see the file LICENSE for details.
*
* BF3005 driver.
*
*/
#ifndef __BF3005_H__
#define __BF3005_H__
#include "sensor.h"
/**
* @brief Detect sensor pid
*
* @param slv_addr SCCB address
* @param id Detection result
* @return
* 0: Can't detect this sensor
* Nonzero: This sensor has been detected
*/
int bf3005_detect(int slv_addr, sensor_id_t *id);
/**
* @brief initialize sensor function pointers
*
* @param sensor pointer of sensor
* @return
* Always 0
*/
int bf3005_init(sensor_t *sensor);
#endif // __BF3005_H__

View File

@@ -0,0 +1,337 @@
/*
* This file is part of the OpenMV project.
* Copyright (c) 2013/2014 Ibrahim Abdelkader <i.abdalkader@gmail.com>
* This work is licensed under the MIT license, see the file LICENSE for details.
*
* BF3005 register definitions.
*/
#ifndef __REG_REGS_H__
#define __REG_REGS_H__
#if 0
#define GAIN 0x00 /* AGC <20>C Gain control gain setting */
#define BLUE 0x01 /* AWB <20>C Blue channel gain setting */
#define RED 0x02 /* AWB <20>C Red channel gain setting */
#define GREEN 0x03 /* AWB <20>C Green channel gain setting */
#define BAVG 0x05 /* U/B Average Level */
#define GAVG 0x06 /* Y/Gb Average Level */
#define RAVG 0x07 /* V/R Average Level */
#define AECH 0x08 /* Exposure Value <20>C AEC MSBs */
#define COM2 0x09 /* Common Control 2 */
#define COM2_SOFT_SLEEP 0x10 /* Soft sleep mode */
#define COM2_OUT_DRIVE_1x 0x00 /* Output drive capability 1x */
#define COM2_OUT_DRIVE_2x 0x01 /* Output drive capability 2x */
#define COM2_OUT_DRIVE_3x 0x02 /* Output drive capability 3x */
#define COM2_OUT_DRIVE_4x 0x03 /* Output drive capability 4x */
#define REG_PID 0x0A /* Product ID Number MSB */
#define REG_VER 0x0B /* Product ID Number LSB */
#define COM3 0x0C /* Common Control 3 */
#define COM3_VFLIP 0x80 /* Vertical flip image ON/OFF selection */
#define COM3_MIRROR 0x40 /* Horizontal mirror image ON/OFF selection */
#define COM3_SWAP_BR 0x20 /* Swap B/R output sequence in RGB output mode */
#define COM3_SWAP_YUV 0x10 /* Swap Y/UV output sequence in YUV output mode */
#define COM3_SWAP_MSB 0x08 /* Swap output MSB/LSB */
#define COM3_TRI_CLOCK 0x04 /* Tri-state option for output clock at power-down period */
#define COM3_TRI_DATA 0x02 /* Tri-state option for output data at power-down period */
#define COM3_COLOR_BAR 0x01 /* Sensor color bar test pattern output enable */
#define COM3_SET_CBAR(r, x) ((r&0xFE)|((x&1)<<0))
#define COM3_SET_MIRROR(r, x) ((r&0xBF)|((x&1)<<6))
#define COM3_SET_FLIP(r, x) ((r&0x7F)|((x&1)<<7))
#define COM4 0x0D /* Common Control 4 */
#define COM4_PLL_BYPASS 0x00 /* Bypass PLL */
#define COM4_PLL_4x 0x40 /* PLL frequency 4x */
#define COM4_PLL_6x 0x80 /* PLL frequency 6x */
#define COM4_PLL_8x 0xc0 /* PLL frequency 8x */
#define COM4_AEC_FULL 0x00 /* AEC evaluate full window */
#define COM4_AEC_1_2 0x10 /* AEC evaluate 1/2 window */
#define COM4_AEC_1_4 0x20 /* AEC evaluate 1/4 window */
#define COM4_AEC_2_3 0x30 /* AEC evaluate 2/3 window */
#define COM5 0x0E /* Common Control 5 */
#define COM5_AFR 0x80 /* Auto frame rate control ON/OFF selection (night mode) */
#define COM5_AFR_SPEED 0x40 /* Auto frame rate control speed selection */
#define COM5_AFR_0 0x00 /* No reduction of frame rate */
#define COM5_AFR_1_2 0x10 /* Max reduction to 1/2 frame rate */
#define COM5_AFR_1_4 0x20 /* Max reduction to 1/4 frame rate */
#define COM5_AFR_1_8 0x30 /* Max reduction to 1/8 frame rate */
#define COM5_AFR_4x 0x04 /* Add frame when AGC reaches 4x gain */
#define COM5_AFR_8x 0x08 /* Add frame when AGC reaches 8x gain */
#define COM5_AFR_16x 0x0c /* Add frame when AGC reaches 16x gain */
#define COM5_AEC_NO_LIMIT 0x01 /* No limit to AEC increase step */
#define COM6 0x0F /* Common Control 6 */
#define COM6_AUTO_WINDOW 0x01 /* Auto window setting ON/OFF selection when format changes */
#define AEC 0x10 /* AEC[7:0] (see register AECH for AEC[15:8]) */
#define CLKRC 0x11 /* Internal Clock */
#define COM7 0x12 /* Common Control 7 */
#define COM7_RESET 0x80 /* SCCB Register Reset */
#define COM7_RES_VGA 0x00 /* Resolution VGA */
#define COM7_RES_QVGA 0x40 /* Resolution QVGA */
#define COM7_BT656 0x20 /* BT.656 protocol ON/OFF */
#define COM7_SENSOR_RAW 0x10 /* Sensor RAW */
#define COM7_FMT_GBR422 0x00 /* RGB output format GBR422 */
#define COM7_FMT_RGB565 0x04 /* RGB output format RGB565 */
#define COM7_FMT_RGB555 0x08 /* RGB output format RGB555 */
#define COM7_FMT_RGB444 0x0C /* RGB output format RGB444 */
#define COM7_FMT_YUV 0x00 /* Output format YUV */
#define COM7_FMT_P_BAYER 0x01 /* Output format Processed Bayer RAW */
#define COM7_FMT_RGB 0x02 /* Output format RGB */
#define COM7_FMT_R_BAYER 0x03 /* Output format Bayer RAW */
#define COM7_SET_FMT(r, x) ((r&0xFC)|((x&0x3)<<0))
#define COM7_SET_RGB(r, x) ((r&0xF0)|(x&0x0C)|COM7_FMT_RGB)
#define COM8 0x13 /* Common Control 8 */
#define COM8_FAST_AUTO 0x80 /* Enable fast AGC/AEC algorithm */
#define COM8_STEP_VSYNC 0x00 /* AEC - Step size limited to vertical blank */
#define COM8_STEP_UNLIMIT 0x40 /* AEC - Step size unlimited step size */
#define COM8_BANDF_EN 0x20 /* Banding filter ON/OFF */
#define COM8_AEC_BANDF 0x10 /* Enable AEC below banding value */
#define COM8_AEC_FINE_EN 0x08 /* Fine AEC ON/OFF control */
#define COM8_AGC_EN 0x04 /* AGC Enable */
#define COM8_AWB_EN 0x02 /* AWB Enable */
#define COM8_AEC_EN 0x01 /* AEC Enable */
#define COM8_SET_AGC(r, x) ((r&0xFB)|((x&0x1)<<2))
#define COM8_SET_AWB(r, x) ((r&0xFD)|((x&0x1)<<1))
#define COM8_SET_AEC(r, x) ((r&0xFE)|((x&0x1)<<0))
#define COM9 0x14 /* Common Control 9 */
#define COM9_HISTO_AVG 0x80 /* Histogram or average based AEC/AGC selection */
#define COM9_AGC_GAIN_2x 0x00 /* Automatic Gain Ceiling 2x */
#define COM9_AGC_GAIN_4x 0x10 /* Automatic Gain Ceiling 4x */
#define COM9_AGC_GAIN_8x 0x20 /* Automatic Gain Ceiling 8x */
#define COM9_AGC_GAIN_16x 0x30 /* Automatic Gain Ceiling 16x */
#define COM9_AGC_GAIN_32x 0x40 /* Automatic Gain Ceiling 32x */
#define COM9_DROP_VSYNC 0x04 /* Drop VSYNC output of corrupt frame */
#define COM9_DROP_HREF 0x02 /* Drop HREF output of corrupt frame */
#define COM9_SET_AGC(r, x) ((r&0x8F)|((x&0x07)<<4))
#define COM10 0x15 /* Common Control 10 */
#define COM10_NEGATIVE 0x80 /* Output negative data */
#define COM10_HSYNC_EN 0x40 /* HREF changes to HSYNC */
#define COM10_PCLK_FREE 0x00 /* PCLK output option: free running PCLK */
#define COM10_PCLK_MASK 0x20 /* PCLK output option: masked during horizontal blank */
#define COM10_PCLK_REV 0x10 /* PCLK reverse */
#define COM10_HREF_REV 0x08 /* HREF reverse */
#define COM10_VSYNC_FALLING 0x00 /* VSYNC changes on falling edge of PCLK */
#define COM10_VSYNC_RISING 0x04 /* VSYNC changes on rising edge of PCLK */
#define COM10_VSYNC_NEG 0x02 /* VSYNC negative */
#define COM10_OUT_RANGE_8 0x01 /* Output data range: Full range */
#define COM10_OUT_RANGE_10 0x00 /* Output data range: Data from [10] to [F0] (8 MSBs) */
#define REG16 0x16 /* Register 16 */
#define REG16_BIT_SHIFT 0x80 /* Bit shift test pattern options */
#define HSTART 0x17 /* Horizontal Frame (HREF column) Start 8 MSBs (2 LSBs are at HREF[5:4]) */
#define HSIZE 0x18 /* Horizontal Sensor Size (2 LSBs are at HREF[1:0]) */
#define VSTART 0x19 /* Vertical Frame (row) Start 8 MSBs (1 LSB is at HREF[6]) */
#define VSIZE 0x1A /* Vertical Sensor Size (1 LSB is at HREF[2]) */
#define PSHFT 0x1B /* Data Format - Pixel Delay Select */
#define REG_MIDH 0x1C /* Manufacturer ID Byte <20>C High */
#define REG_MIDL 0x1D /* Manufacturer ID Byte <20>C Low */
#define LAEC 0x1F /* Fine AEC Value - defines exposure value less than one row period */
#define COM11 0x20 /* Common Control 11 */
#define COM11_SNGL_FRAME_EN 0x02 /* Single frame ON/OFF selection */
#define COM11_SNGL_XFR_TRIG 0x01 /* Single frame transfer trigger */
#define BDBASE 0x22 /* Banding Filter Minimum AEC Value */
#define DBSTEP 0x23 /* Banding Filter Maximum Step */
#define AEW 0x24 /* AGC/AEC - Stable Operating Region (Upper Limit) */
#define AEB 0x25 /* AGC/AEC - Stable Operating Region (Lower Limit) */
#define VPT 0x26 /* AGC/AEC Fast Mode Operating Region */
#define REG28 0x28 /* Selection on the number of dummy rows, N */
#define HOUTSIZE 0x29 /* Horizontal Data Output Size MSBs (2 LSBs at register EXHCH[1:0]) */
#define EXHCH 0x2A /* Dummy Pixel Insert MSB */
#define EXHCL 0x2B /* Dummy Pixel Insert LSB */
#define VOUTSIZE 0x2C /* Vertical Data Output Size MSBs (LSB at register EXHCH[2]) */
#define ADVFL 0x2D /* LSB of Insert Dummy Rows in Vertical Sync (1 bit equals 1 row) */
#define ADVFH 0x2E /* MSB of Insert Dummy Rows in Vertical Sync */
#define YAVE 0x2F /* Y/G Channel Average Value */
#define LUMHTH 0x30 /* Histogram AEC/AGC Luminance High Level Threshold */
#define LUMLTH 0x31 /* Histogram AEC/AGC Luminance Low Level Threshold */
#define HREF 0x32 /* Image Start and Size Control */
#define DM_LNL 0x33 /* Dummy Row Low 8 Bits */
#define DM_LNH 0x34 /* Dummy Row High 8 Bits */
#define ADOFF_B 0x35 /* AD Offset Compensation Value for B Channel */
#define ADOFF_R 0x36 /* AD Offset Compensation Value for R Channel */
#define ADOFF_GB 0x37 /* AD Offset Compensation Value for GB Channel */
#define ADOFF_GR 0x38 /* AD Offset Compensation Value for GR Channel */
#define OFF_B 0x39 /* AD Offset Compensation Value for B Channel */
#define OFF_R 0x3A /* AD Offset Compensation Value for R Channel */
#define OFF_GB 0x3B /* AD Offset Compensation Value for GB Channel */
#define OFF_GR 0x3C /* AD Offset Compensation Value for GR Channel */
#define COM12 0x3D /* DC offset compensation for analog process */
#define COM13 0x3E /* Common Control 13 */
#define COM13_BLC_EN 0x80 /* BLC enable */
#define COM13_ADC_EN 0x40 /* ADC channel BLC ON/OFF control */
#define COM13_ANALOG_BLC 0x20 /* Analog processing channel BLC ON/OFF control */
#define COM13_ABLC_GAIN_EN 0x04 /* ABLC gain trigger enable */
#define COM14 0x3F /* Common Control 14 */
#define COM15 0x40 /* Common Control 15 */
#define COM16 0x41 /* Common Control 16 */
#define TGT_B 0x42 /* BLC Blue Channel Target Value */
#define TGT_R 0x43 /* BLC Red Channel Target Value */
#define TGT_GB 0x44 /* BLC Gb Channel Target Value */
#define TGT_GR 0x45 /* BLC Gr Channel Target Value */
#define LC_CTR 0x46 /* Lens Correction Control */
#define LC_CTR_RGB_COMP_1 0x00 /* R, G, and B channel compensation coefficient is set by LC_COEF (0x49) */
#define LC_CTR_RGB_COMP_3 0x04 /* R, G, and B channel compensation coefficient is set by registers
LC_COEFB (0x4B), LC_COEF (0x49), and LC_COEFR (0x4C), respectively */
#define LC_CTR_EN 0x01 /* Lens correction enable */
#define LC_XC 0x47 /* X Coordinate of Lens Correction Center Relative to Array Center */
#define LC_YC 0x48 /* Y Coordinate of Lens Correction Center Relative to Array Center */
#define LC_COEF 0x49 /* Lens Correction Coefficient */
#define LC_RADI 0x4A /* Lens Correction Radius */
#define LC_COEFB 0x4B /* Lens Correction B Channel Compensation Coefficient */
#define LC_COEFR 0x4C /* Lens Correction R Channel Compensation Coefficient */
#define FIXGAIN 0x4D /* Analog Fix Gain Amplifier */
#define AREF0 0x4E /* Sensor Reference Control */
#define AREF1 0x4F /* Sensor Reference Current Control */
#define AREF2 0x50 /* Analog Reference Control */
#define AREF3 0x51 /* ADC Reference Control */
#define AREF4 0x52 /* ADC Reference Control */
#define AREF5 0x53 /* ADC Reference Control */
#define AREF6 0x54 /* Analog Reference Control */
#define AREF7 0x55 /* Analog Reference Control */
#define UFIX 0x60 /* U Channel Fixed Value Output */
#define VFIX 0x61 /* V Channel Fixed Value Output */
#define AWBB_BLK 0x62 /* AWB Option for Advanced AWB */
#define AWB_CTRL0 0x63 /* AWB Control Byte 0 */
#define AWB_CTRL0_GAIN_EN 0x80 /* AWB gain enable */
#define AWB_CTRL0_CALC_EN 0x40 /* AWB calculate enable */
#define AWB_CTRL0_WBC_MASK 0x0F /* WBC threshold 2 */
#define DSP_CTRL1 0x64 /* DSP Control Byte 1 */
#define DSP_CTRL1_FIFO_EN 0x80 /* FIFO enable/disable selection */
#define DSP_CTRL1_UV_EN 0x40 /* UV adjust function ON/OFF selection */
#define DSP_CTRL1_SDE_EN 0x20 /* SDE enable */
#define DSP_CTRL1_MTRX_EN 0x10 /* Color matrix ON/OFF selection */
#define DSP_CTRL1_INTRP_EN 0x08 /* Interpolation ON/OFF selection */
#define DSP_CTRL1_GAMMA_EN 0x04 /* Gamma function ON/OFF selection */
#define DSP_CTRL1_BLACK_EN 0x02 /* Black defect auto correction ON/OFF */
#define DSP_CTRL1_WHITE_EN 0x01 /* White defect auto correction ON/OFF */
#define DSP_CTRL2 0x65 /* DSP Control Byte 2 */
#define DSP_CTRL2_VDCW_EN 0x08 /* Vertical DCW enable */
#define DSP_CTRL2_HDCW_EN 0x04 /* Horizontal DCW enable */
#define DSP_CTRL2_VZOOM_EN 0x02 /* Vertical zoom out enable */
#define DSP_CTRL2_HZOOM_EN 0x01 /* Horizontal zoom out enable */
#define DSP_CTRL3 0x66 /* DSP Control Byte 3 */
#define DSP_CTRL3_UV_EN 0x80 /* UV output sequence option */
#define DSP_CTRL3_CBAR_EN 0x20 /* DSP color bar ON/OFF selection */
#define DSP_CTRL3_FIFO_EN 0x08 /* FIFO power down ON/OFF selection */
#define DSP_CTRL3_SCAL1_PWDN 0x04 /* Scaling module power down control 1 */
#define DSP_CTRL3_SCAL2_PWDN 0x02 /* Scaling module power down control 2 */
#define DSP_CTRL3_INTRP_PWDN 0x01 /* Interpolation module power down control */
#define DSP_CTRL3_SET_CBAR(r, x) ((r&0xDF)|((x&1)<<5))
#define DSP_CTRL4 0x67 /* DSP Control Byte 4 */
#define DSP_CTRL4_YUV_RGB 0x00 /* Output selection YUV or RGB */
#define DSP_CTRL4_RAW8 0x02 /* Output selection RAW8 */
#define DSP_CTRL4_RAW10 0x03 /* Output selection RAW10 */
#define AWB_BIAS 0x68 /* AWB BLC Level Clip */
#define AWB_CTRL1 0x69 /* AWB Control 1 */
#define AWB_CTRL2 0x6A /* AWB Control 2 */
#define AWB_CTRL3 0x6B /* AWB Control 3 */
#define AWB_CTRL3_ADVANCED 0x80 /* AWB mode select - Advanced AWB */
#define AWB_CTRL3_SIMPLE 0x00 /* AWB mode select - Simple AWB */
#define AWB_CTRL4 0x6C /* AWB Control 4 */
#define AWB_CTRL5 0x6D /* AWB Control 5 */
#define AWB_CTRL6 0x6E /* AWB Control 6 */
#define AWB_CTRL7 0x6F /* AWB Control 7 */
#define AWB_CTRL8 0x70 /* AWB Control 8 */
#define AWB_CTRL9 0x71 /* AWB Control 9 */
#define AWB_CTRL10 0x72 /* AWB Control 10 */
#define AWB_CTRL11 0x73 /* AWB Control 11 */
#define AWB_CTRL12 0x74 /* AWB Control 12 */
#define AWB_CTRL13 0x75 /* AWB Control 13 */
#define AWB_CTRL14 0x76 /* AWB Control 14 */
#define AWB_CTRL15 0x77 /* AWB Control 15 */
#define AWB_CTRL16 0x78 /* AWB Control 16 */
#define AWB_CTRL17 0x79 /* AWB Control 17 */
#define AWB_CTRL18 0x7A /* AWB Control 18 */
#define AWB_CTRL19 0x7B /* AWB Control 19 */
#define AWB_CTRL20 0x7C /* AWB Control 20 */
#define AWB_CTRL21 0x7D /* AWB Control 21 */
#define GAM1 0x7E /* Gamma Curve 1st Segment Input End Point 0x04 Output Value */
#define GAM2 0x7F /* Gamma Curve 2nd Segment Input End Point 0x08 Output Value */
#define GAM3 0x80 /* Gamma Curve 3rd Segment Input End Point 0x10 Output Value */
#define GAM4 0x81 /* Gamma Curve 4th Segment Input End Point 0x20 Output Value */
#define GAM5 0x82 /* Gamma Curve 5th Segment Input End Point 0x28 Output Value */
#define GAM6 0x83 /* Gamma Curve 6th Segment Input End Point 0x30 Output Value */
#define GAM7 0x84 /* Gamma Curve 7th Segment Input End Point 0x38 Output Value */
#define GAM8 0x85 /* Gamma Curve 8th Segment Input End Point 0x40 Output Value */
#define GAM9 0x86 /* Gamma Curve 9th Segment Input End Point 0x48 Output Value */
#define GAM10 0x87 /* Gamma Curve 10th Segment Input End Point 0x50 Output Value */
#define GAM11 0x88 /* Gamma Curve 11th Segment Input End Point 0x60 Output Value */
#define GAM12 0x89 /* Gamma Curve 12th Segment Input End Point 0x70 Output Value */
#define GAM13 0x8A /* Gamma Curve 13th Segment Input End Point 0x90 Output Value */
#define GAM14 0x8B /* Gamma Curve 14th Segment Input End Point 0xB0 Output Value */
#define GAM15 0x8C /* Gamma Curve 15th Segment Input End Point 0xD0 Output Value */
#define SLOP 0x8D /* Gamma Curve Highest Segment Slope */
#define DNSTH 0x8E /* De-noise Threshold */
#define EDGE0 0x8F /* Edge Enhancement Strength Control */
#define EDGE1 0x90 /* Edge Enhancement Threshold Control */
#define DNSOFF 0x91 /* Auto De-noise Threshold Control */
#define EDGE2 0x92 /* Edge Enhancement Strength Upper Limit */
#define EDGE3 0x93 /* Edge Enhancement Strength Upper Limit */
#define MTX1 0x94 /* Matrix Coefficient 1 */
#define MTX2 0x95 /* Matrix Coefficient 2 */
#define MTX3 0x96 /* Matrix Coefficient 3 */
#define MTX4 0x97 /* Matrix Coefficient 4 */
#define MTX5 0x98 /* Matrix Coefficient 5 */
#define MTX6 0x99 /* Matrix Coefficient 6 */
#define MTX_CTRL 0x9A /* Matrix Control */
#define MTX_CTRL_DBL_EN 0x80 /* Matrix double ON/OFF selection */
#define BRIGHTNESS 0x9B /* Brightness Control */
#define CONTRAST 0x9C /* Contrast Gain */
#define UVADJ0 0x9E /* Auto UV Adjust Control 0 */
#define UVADJ1 0x9F /* Auto UV Adjust Control 1 */
#define SCAL0 0xA0 /* DCW Ratio Control */
#define SCAL1 0xA1 /* Horizontal Zoom Out Control */
#define SCAL2 0xA2 /* Vertical Zoom Out Control */
#define FIFODLYM 0xA3 /* FIFO Manual Mode Delay Control */
#define FIFODLYA 0xA4 /* FIFO Auto Mode Delay Control */
#define SDE 0xA6 /* Special Digital Effect Control */
#define SDE_NEGATIVE_EN 0x40 /* Negative image enable */
#define SDE_GRAYSCALE_EN 0x20 /* Gray scale image enable */
#define SDE_V_FIXED_EN 0x10 /* V fixed value enable */
#define SDE_U_FIXED_EN 0x08 /* U fixed value enable */
#define SDE_CONT_BRIGHT_EN 0x04 /* Contrast/Brightness enable */
#define SDE_SATURATION_EN 0x02 /* Saturation enable */
#define SDE_HUE_EN 0x01 /* Hue enable */
#define USAT 0xA7 /* U Component Saturation Gain */
#define VSAT 0xA8 /* V Component Saturation Gain */
#define HUECOS 0xA9 /* Cosine value <20><> 0x80 */
#define HUESIN 0xAA /* Sine value <20><> 0x80 */
#define SIGN_BIT 0xAB /* Sign Bit for Hue and Brightness */
#define DSPAUTO 0xAC /* DSP Auto Function ON/OFF Control */
#define DSPAUTO_AWB_EN 0x80 /* AWB auto threshold control */
#define DSPAUTO_DENOISE_EN 0x40 /* De-noise auto threshold control */
#define DSPAUTO_EDGE_EN 0x20 /* Sharpness (edge enhancement) auto strength control */
#define DSPAUTO_UV_EN 0x10 /* UV adjust auto slope control */
#define DSPAUTO_SCAL0_EN 0x08 /* Auto scaling factor control (register SCAL0 (0xA0)) */
#define DSPAUTO_SCAL1_EN 0x04 /* Auto scaling factor control (registers SCAL1 (0xA1 and SCAL2 (0xA2))*/
#define SET_REG(reg, x) (##reg_DEFAULT|x)
#endif //__REG_REGS_H__
#endif

View File

@@ -34,6 +34,12 @@ static inline int gpio_ll_get_level(gpio_dev_t *hw, int gpio_num)
#include "xclk.h"
#include "cam_hal.h"
#if (ESP_IDF_VERSION_MAJOR >= 5)
#define GPIO_PIN_INTR_POSEDGE GPIO_INTR_POSEDGE
#define GPIO_PIN_INTR_NEGEDGE GPIO_INTR_NEGEDGE
#define gpio_matrix_in(a,b,c) gpio_iomux_in(a,b)
#endif
static const char *TAG = "esp32 ll_cam";
#define I2S_ISR_ENABLE(i) {I2S0.int_clr.i = 1;I2S0.int_ena.i = 1;}

View File

@@ -21,6 +21,12 @@
#include "xclk.h"
#include "cam_hal.h"
#if (ESP_IDF_VERSION_MAJOR >= 5)
#define GPIO_PIN_INTR_POSEDGE GPIO_INTR_POSEDGE
#define GPIO_PIN_INTR_NEGEDGE GPIO_INTR_NEGEDGE
#define gpio_matrix_in(a,b,c) gpio_iomux_in(a,b)
#endif
static const char *TAG = "s2 ll_cam";
#define I2S_ISR_ENABLE(i) {I2S0.int_clr.i = 1;I2S0.int_ena.i = 1;}

View File

@@ -23,6 +23,11 @@
#include "ll_cam.h"
#include "cam_hal.h"
#if (ESP_IDF_VERSION_MAJOR >= 5)
#define gpio_matrix_in(a,b,c) gpio_iomux_in(a,b)
#define gpio_matrix_out(a,b,c,d) gpio_iomux_out(a,b,c)
#endif
static const char *TAG = "s3 ll_cam";
static void IRAM_ATTR ll_cam_vsync_isr(void *arg)

Binary file not shown.

View File

@@ -30,10 +30,26 @@
// #define DEBUG_DETAIL_ON
#define USE_PWM_LEDFLASH
#ifdef USE_PWM_LEDFLASH
//// PWM für Flash-LED
#define LEDC_TIMER LEDC_TIMER_1 // LEDC_TIMER_0
#define LEDC_MODE LEDC_LOW_SPEED_MODE
#define LEDC_OUTPUT_IO (4) // Define the output GPIO
#define LEDC_CHANNEL LEDC_CHANNEL_1
#define LEDC_DUTY_RES LEDC_TIMER_13_BIT // Set duty resolution to 13 bits
//#define LEDC_DUTY (195) // Set duty to 50%. ((2 ** 13) - 1) * 50% = 4095
#define LEDC_FREQUENCY (5000) // Frequency in Hertz. Set frequency at 5 kHz
#endif
// ESP32Cam (AiThinker) PIN Map
#define CAM_PIN_PWDN (gpio_num_t) 32
#define CAM_PIN_PWDN 32
#define CAM_PIN_RESET -1 //software reset will be performed
#define CAM_PIN_XCLK 0
#define CAM_PIN_SIOD 26
@@ -51,6 +67,7 @@
#define CAM_PIN_HREF 23
#define CAM_PIN_PCLK 22
static const char *TAGCAMERACLASS = "server_part_camera";
static camera_config_t camera_config = {
@@ -74,17 +91,18 @@ static camera_config_t camera_config = {
//XCLK 20MHz or 10MHz for OV2640 double FPS (Experimental)
.xclk_freq_hz = 20000000, // Orginalwert
// .xclk_freq_hz = 5000000, // Test, um die Bildfehler los zu werden !!!!
// .xclk_freq_hz = 5000000, // Test, um die Bildfehler los zu werden !!!! Hängt in Version 9.2 !!!!
.ledc_timer = LEDC_TIMER_0,
.ledc_channel = LEDC_CHANNEL_0,
.pixel_format = PIXFORMAT_JPEG, //YUV422,GRAYSCALE,RGB565,JPEG
.frame_size = FRAMESIZE_VGA, //QQVGA-UXGA Do not use sizes above QVGA when not JPEG
// .frame_size = FRAMESIZE_UXGA, //QQVGA-UXGA Do not use sizes above QVGA when not JPEG
.jpeg_quality = 5, //0-63 lower number means higher quality
.jpeg_quality = 12, //0-63 lower number means higher quality
.fb_count = 1, //if more than one, i2s runs in continuous mode. Use only with JPEG
.fb_location = CAMERA_FB_IN_PSRAM, /*!< The location where the frame buffer will be allocated */
// .grab_mode = CAMERA_GRAB_WHEN_EMPTY,
.grab_mode = CAMERA_GRAB_LATEST,
.grab_mode = CAMERA_GRAB_LATEST, // erst ab neuer esp32cam-version
};
@@ -102,29 +120,36 @@ typedef struct {
} jpg_chunking_t;
#define LEDC_LS_CH2_GPIO (4)
#define LEDC_LS_CH2_CHANNEL LEDC_CHANNEL_2
#define LEDC_LS_TIMER LEDC_TIMER_1
#define LEDC_LS_MODE LEDC_LOW_SPEED_MODE
#define LEDC_TEST_DUTY (4000)
void CCamera::ledc_init(void)
{
#ifdef USE_PWM_LEDFLASH
void test(){
// Prepare and then apply the LEDC PWM timer configuration
ledc_timer_config_t ledc_timer = { };
ledc_timer.speed_mode = LEDC_MODE;
ledc_timer.timer_num = LEDC_TIMER;
ledc_timer.duty_resolution = LEDC_DUTY_RES;
ledc_timer.freq_hz = LEDC_FREQUENCY; // Set output frequency at 5 kHz
ledc_timer.clk_cfg = LEDC_AUTO_CLK;
ESP_ERROR_CHECK(ledc_timer_config(&ledc_timer));
// Prepare and then apply the LEDC PWM channel configuration
ledc_channel_config_t ledc_channel = { };
ledc_channel.channel = LEDC_LS_CH2_CHANNEL;
ledc_channel.duty = 0;
ledc_channel.gpio_num = FLASH_GPIO;
ledc_channel.speed_mode = LEDC_LS_MODE;
ledc_channel.hpoint = 0;
ledc_channel.timer_sel = LEDC_LS_TIMER;
ledc_channel.speed_mode = LEDC_MODE;
ledc_channel.channel = LEDC_CHANNEL;
ledc_channel.timer_sel = LEDC_TIMER;
ledc_channel.intr_type = LEDC_INTR_DISABLE;
ledc_channel.gpio_num = LEDC_OUTPUT_IO;
ledc_channel.duty = 0; // Set duty to 0%
ledc_channel.hpoint = 0;
ledc_channel_config(&ledc_channel);
ledc_set_duty(ledc_channel.speed_mode, ledc_channel.channel, LEDC_TEST_DUTY);
ledc_update_duty(ledc_channel.speed_mode, ledc_channel.channel);
vTaskDelay(1000 / portTICK_PERIOD_MS);
};
ESP_ERROR_CHECK(ledc_channel_config(&ledc_channel));
#endif
}
static size_t jpg_encode_stream(void * arg, size_t index, const void* data, size_t len){
@@ -147,9 +172,11 @@ bool CCamera::SetBrightnessContrastSaturation(int _brightness, int _contrast, in
_brightness = min(2, max(-2, _brightness));
if (_contrast > -100)
_contrast = min(2, max(-2, _contrast));
// _saturation = min(2, max(-2, _saturation));
if (_saturation > -100)
_saturation = min(2, max(-2, _saturation));
// s->set_saturation(s, _saturation);
if (_saturation > -100)
s->set_saturation(s, _saturation);
if (_contrast > -100)
s->set_contrast(s, _contrast);
if (_brightness > -100)
@@ -222,6 +249,7 @@ void CCamera::SetQualitySize(int qual, framesize_t resol)
void CCamera::EnableAutoExposure(int flashdauer)
{
printf("EnableAutoExposure");
LEDOnOff(true);
if (flashdauer > 0)
LightOnOff(true);
@@ -520,15 +548,31 @@ void CCamera::LightOnOff(bool status)
printf("Use gpioHandler flashLigh\n");
gpioHandler->flashLightEnable(status);
} else {
#ifdef USE_PWM_LEDFLASH
if (status)
{
printf("Internal Flash-LED turn on with PWM %d\n", led_intensity);
ESP_ERROR_CHECK(ledc_set_duty(LEDC_MODE, LEDC_CHANNEL, led_intensity));
// Update duty to apply the new value
ESP_ERROR_CHECK(ledc_update_duty(LEDC_MODE, LEDC_CHANNEL));
}
else
{
printf("Internal Flash-LED turn off PWM\n");
ESP_ERROR_CHECK(ledc_set_duty(LEDC_MODE, LEDC_CHANNEL, 0));
ESP_ERROR_CHECK(ledc_update_duty(LEDC_MODE, LEDC_CHANNEL));
}
#else
// Init the GPIO
gpio_pad_select_gpio(FLASH_GPIO);
/* Set the GPIO as a push/pull output */
// Set the GPIO as a push/pull output
gpio_set_direction(FLASH_GPIO, GPIO_MODE_OUTPUT);
if (status)
gpio_set_level(FLASH_GPIO, 1);
else
gpio_set_level(FLASH_GPIO, 0);
#endif
}
}
@@ -619,18 +663,12 @@ CCamera::CCamera()
contrast = -5;
saturation = -5;
isFixedExposure = false;
ledc_init();
}
esp_err_t CCamera::InitCam()
{
if(CAM_PIN_PWDN != -1){
// Init the GPIO
gpio_pad_select_gpio(CAM_PIN_PWDN);
/* Set the GPIO as a push/pull output */
gpio_set_direction(CAM_PIN_PWDN, GPIO_MODE_OUTPUT);
gpio_set_level(CAM_PIN_PWDN, 0);
}
printf("Init Camera\n");
ActualQuality = camera_config.jpeg_quality;
ActualResolution = camera_config.frame_size;
@@ -642,4 +680,14 @@ esp_err_t CCamera::InitCam()
}
return ESP_OK;
}
}
void CCamera::SetLEDIntensity(float _intrel)
{
_intrel = min(_intrel, (float) 100);
_intrel = max(_intrel, (float) 0);
_intrel = _intrel / 100;
led_intensity = (int) (_intrel * 8191);
printf("Set led_intensity to %d of 8191\n", led_intensity);
}

View File

@@ -23,6 +23,9 @@ class CCamera {
int brightness, contrast, saturation;
bool isFixedExposure;
int waitbeforepicture_org;
int led_intensity = 4095;
void ledc_init(void);
public:
int image_height, image_width;
@@ -36,6 +39,7 @@ class CCamera {
void SetQualitySize(int qual, framesize_t resol);
bool SetBrightnessContrastSaturation(int _brightness, int _contrast, int _saturation);
void GetCameraParameter(httpd_req_t *req, int &qual, framesize_t &resol);
void SetLEDIntensity(float _intrel);
void EnableAutoExposure(int flashdauer);

View File

@@ -8,8 +8,8 @@
#include "ClassLogFile.h"
// #define SCRATCH_BUFSIZE2 8192
// char scratch2[SCRATCH_BUFSIZE2];
#define SCRATCH_BUFSIZE2 8192
char scratch2[SCRATCH_BUFSIZE2];
//#define DEBUG_DETAIL_ON
static const char *TAGPARTCAMERA = "server_camera";

View File

@@ -72,40 +72,44 @@ static const char *TAG_FILESERVER = "file_server";
using namespace std;
static esp_err_t get_tflite_file_handler(httpd_req_t *req){
esp_err_t get_tflite_file_handler(httpd_req_t *req)
{
DIR *verzeichnis;
struct dirent *files;
struct dirent *entry;
struct stat entry_stat;
std::string _filename, _fileext, _result = "";
std::string _delimiter = ".";
std::string _filename, _fileext;
size_t pos = 0;
const char verz_name[] = "/sdcard/config";
printf("Suche TFLITE in /sdcard/config/\n");
verzeichnis=opendir("/sdcard/config");
httpd_resp_set_hdr(req, "Access-Control-Allow-Origin", "*");
httpd_resp_set_type(req, "text/plain");
printf("Suche TFLITE in /sdcard/config\n");
while((files = readdir(verzeichnis)))
DIR *dir = opendir(verz_name);
while ((entry = readdir(dir)) != NULL)
{
_filename = files->d_name;
_fileext = _filename;
_filename = std::string(entry->d_name);
printf("File: %s\t", _filename.c_str());
while ((pos = _fileext.find(_delimiter))) {
_fileext.erase(0, pos + _delimiter.length());
}
_fileext = _filename;
pos = _fileext.find(".");
if (pos != std::string::npos)
_fileext = _fileext.erase(0, pos + 1);
printf(" Extension: %s\n", _fileext.c_str());
if ((_fileext == "tfl") || (_fileext == "tflite"))
{
_result = _result + _filename + "\t";
_filename = "/config/" + _filename + "\t";
httpd_resp_sendstr_chunk(req, _filename.c_str());
}
}
closedir(verzeichnis);
closedir(dir);
httpd_resp_set_hdr(req, "Access-Control-Allow-Origin", "*");
httpd_resp_set_type(req, "text/plain");
httpd_resp_sendstr_chunk(req, _result.c_str());
httpd_resp_sendstr_chunk(req, NULL);
return ESP_OK;
}
@@ -363,6 +367,7 @@ static esp_err_t download_get_handler(httpd_req_t *req)
}
}
printf("uri: %s, filename: %s, filepath: %s\n", req->uri, filename, filepath);
return http_resp_dir_html(req, filepath, filename, readonly);
}

View File

@@ -5,4 +5,6 @@ void register_server_file_uri(httpd_handle_t server, const char *base_path);
void unzip(std::string _in_zip_file, std::string _target_directory);
void delete_all_in_directory(std::string _directory);
void delete_all_in_directory(std::string _directory);
esp_err_t get_tflite_file_handler(httpd_req_t *req);

View File

@@ -21,22 +21,12 @@ ClassFlowCNNGeneral::ClassFlowCNNGeneral(ClassFlowAlignment *_flowalign, t_CNNTy
previousElement = NULL;
SaveAllFiles = false;
disabled = false;
// extendedResolution = false;
isLogImageSelect = false;
CNNType = AutoDetect;
CNNType = _cnntype;
flowpostalignment = _flowalign;
}
/*
int ClassFlowCNNGeneral::AnzahlROIs(int _analog = 0)
{
int zw = GENERAL[_analog]->ROI.size();
if (extendedResolution && (CNNType != Digital)) zw++; // da letzte Ziffer inkl Nachhkomma, es sei denn, das Nachkomma gibt es nicht (Digital)
return zw;
}
*/
string ClassFlowCNNGeneral::getReadout(int _analog = 0, bool _extendedResolution = false)
{
string result = "";
@@ -78,7 +68,6 @@ string ClassFlowCNNGeneral::getReadout(int _analog = 0, bool _extendedResolution
if (CNNType == DigitalHyprid)
{
// int ergebnis_nachkomma = -1;
int zif_akt = -1;
float zahl = GENERAL[_analog]->ROI[GENERAL[_analog]->ROI.size() - 1]->result_float;
@@ -127,7 +116,6 @@ string ClassFlowCNNGeneral::getReadout(int _analog = 0, bool _extendedResolution
int ClassFlowCNNGeneral::ZeigerEvalHybrid(float zahl, float zahl_vorgaenger, int eval_vorgaenger)
{
int ergebnis_nachkomma = ((int) floor(zahl * 10)) % 10;
// int ergebnis_vorkomma = ((int) floor(zahl)) % 10;
if (zahl_vorgaenger < 0) // keine Vorzahl vorhanden !!! --> Runde die Zahl
{
@@ -206,13 +194,6 @@ bool ClassFlowCNNGeneral::ReadParameter(FILE* pfile, string& aktparamgraph)
) // Paragraph passt nicht
return false;
/*
if ((aktparamgraph.compare("[Analog]") != 0) && (aktparamgraph.compare(";[Analog]") != 0)
&& (aktparamgraph.compare("[Digit]") != 0) && (aktparamgraph.compare(";[Digit]"))) // Paragraph passt nicht
return false;
*/
if (aktparamgraph[0] == ';')
{
disabled = true;
@@ -273,14 +254,6 @@ bool ClassFlowCNNGeneral::ReadParameter(FILE* pfile, string& aktparamgraph)
if (toUpper(zerlegt[1]) == "TRUE")
SaveAllFiles = true;
}
/*
if ((toUpper(zerlegt[0]) == "EXTENDEDRESOLUTION") && (zerlegt.size() > 1))
{
if (toUpper(zerlegt[1]) == "TRUE")
extendedResolution = true;
}
*/
}
@@ -303,7 +276,6 @@ general* ClassFlowCNNGeneral::FindGENERAL(string _name_number)
}
general* ClassFlowCNNGeneral::GetGENERAL(string _name, bool _create = true)
{
string _analog, _roi;
@@ -338,6 +310,7 @@ general* ClassFlowCNNGeneral::GetGENERAL(string _name, bool _create = true)
roi* neuroi = new roi;
neuroi->name = _roi;
_ret->ROI.push_back(neuroi);
printf("GetGENERAL - GENERAL %s - roi %s\n", _analog.c_str(), _roi.c_str());
@@ -435,7 +408,8 @@ void ClassFlowCNNGeneral::DrawROI(CImageBasis *_zw)
for (int i = 0; i < GENERAL[_ana]->ROI.size(); ++i)
{
_zw->drawRect(GENERAL[_ana]->ROI[i]->posx, GENERAL[_ana]->ROI[i]->posy, GENERAL[_ana]->ROI[i]->deltax, GENERAL[_ana]->ROI[i]->deltay, r, g, b, 1);
_zw->drawCircle((int) (GENERAL[_ana]->ROI[i]->posx + GENERAL[_ana]->ROI[i]->deltax/2), (int) (GENERAL[_ana]->ROI[i]->posy + GENERAL[_ana]->ROI[i]->deltay/2), (int) (GENERAL[_ana]->ROI[i]->deltax/2), r, g, b, 2);
// _zw->drawCircle((int) (GENERAL[_ana]->ROI[i]->posx + GENERAL[_ana]->ROI[i]->deltax/2), (int) (GENERAL[_ana]->ROI[i]->posy + GENERAL[_ana]->ROI[i]->deltay/2), (int) (GENERAL[_ana]->ROI[i]->deltax/2), r, g, b, 2);
_zw->drawEllipse( (int) (GENERAL[_ana]->ROI[i]->posx + GENERAL[_ana]->ROI[i]->deltax/2), (int) (GENERAL[_ana]->ROI[i]->posy + GENERAL[_ana]->ROI[i]->deltay/2), (int) (GENERAL[_ana]->ROI[i]->deltax/2), (int) (GENERAL[_ana]->ROI[i]->deltay/2), r, g, b, 2);
_zw->drawLine((int) (GENERAL[_ana]->ROI[i]->posx + GENERAL[_ana]->ROI[i]->deltax/2), (int) GENERAL[_ana]->ROI[i]->posy, (int) (GENERAL[_ana]->ROI[i]->posx + GENERAL[_ana]->ROI[i]->deltax/2), (int) (GENERAL[_ana]->ROI[i]->posy + GENERAL[_ana]->ROI[i]->deltay), r, g, b, 2);
_zw->drawLine((int) GENERAL[_ana]->ROI[i]->posx, (int) (GENERAL[_ana]->ROI[i]->posy + GENERAL[_ana]->ROI[i]->deltay/2), (int) GENERAL[_ana]->ROI[i]->posx + GENERAL[_ana]->ROI[i]->deltax, (int) (GENERAL[_ana]->ROI[i]->posy + GENERAL[_ana]->ROI[i]->deltay/2), r, g, b, 2);
}
@@ -481,6 +455,10 @@ bool ClassFlowCNNGeneral::doNeuralNetwork(string time)
CNNType = Digital;
printf("TFlite-Type set to Digital\n");
break;
case 20:
CNNType = DigitalHyprid10;
printf("TFlite-Type set to DigitalHyprid10\n");
break;
case 22:
CNNType = DigitalHyprid;
printf("TFlite-Type set to DigitalHyprid\n");
@@ -488,7 +466,6 @@ bool ClassFlowCNNGeneral::doNeuralNetwork(string time)
default:
printf("ERROR ERROR ERROR - tflite passt nicht zur Firmware - ERROR ERROR ERROR\n");
}
// flowpostprocessing->UpdateNachkommaDecimalShift();
}
for (int _ana = 0; _ana < GENERAL.size(); ++_ana)
@@ -558,6 +535,30 @@ bool ClassFlowCNNGeneral::doNeuralNetwork(string time)
_zwres = "Result General(DigitalHyprid)" + to_string(i) + ": " + to_string(GENERAL[_ana]->ROI[i]->result_float);
if (debugdetailgeneral) LogFile.WriteToFile(_zwres);
if (isLogImage)
LogImage(logPath, GENERAL[_ana]->ROI[i]->name, &GENERAL[_ana]->ROI[i]->result_float, NULL, time, GENERAL[_ana]->ROI[i]->image_org);
} break;
case DigitalHyprid10:
{
int _num, _nachkomma;
tflite->LoadInputImageBasis(GENERAL[_ana]->ROI[i]->image);
tflite->Invoke();
if (debugdetailgeneral) LogFile.WriteToFile("Nach Invoke");
_num = tflite->GetOutClassification(0, 9);
_nachkomma = tflite->GetOutClassification(10, 19);
string _zwres = "Nach Invoke - Nummer: " + to_string(_num) + " Nachkomma: " + to_string(_nachkomma);
if (debugdetailgeneral) LogFile.WriteToFile(_zwres);
GENERAL[_ana]->ROI[i]->result_float = fmod((double) _num + (((double)_nachkomma)-5)/10 + (double) 10, 10);
printf("Result General(DigitalHyprid)%i: %f\n", i, GENERAL[_ana]->ROI[i]->result_float);
_zwres = "Result General(DigitalHyprid)" + to_string(i) + ": " + to_string(GENERAL[_ana]->ROI[i]->result_float);
if (debugdetailgeneral) LogFile.WriteToFile(_zwres);
if (isLogImage)
LogImage(logPath, GENERAL[_ana]->ROI[i]->name, &GENERAL[_ana]->ROI[i]->result_float, NULL, time, GENERAL[_ana]->ROI[i]->image_org);
} break;
@@ -574,7 +575,6 @@ bool ClassFlowCNNGeneral::doNeuralNetwork(string time)
bool ClassFlowCNNGeneral::isExtendedResolution(int _number)
{
// if (extendedResolution && !(CNNType == Digital))
if (!(CNNType == Digital))
return true;
@@ -615,13 +615,9 @@ std::vector<HTMLInfo*> ClassFlowCNNGeneral::GetHTMLInfo()
zw->image = GENERAL[_ana]->ROI[i]->image;
zw->image_org = GENERAL[_ana]->ROI[i]->image_org;
// printf("Push %s\n", zw->filename.c_str());
result.push_back(zw);
}
// printf("größe: %d\n", result.size());
return result;
}

View File

@@ -3,7 +3,6 @@
#include"ClassFlowDefineTypes.h"
#include "ClassFlowAlignment.h"
// #include "ClassFlowPostProcessing.h"
enum t_CNNType {
@@ -11,6 +10,7 @@ enum t_CNNType {
Analogue,
Digital,
DigitalHyprid,
DigitalHyprid10,
None
};
@@ -50,7 +50,6 @@ public:
std::vector<HTMLInfo*> GetHTMLInfo();
// int AnzahlROIs(int _analog);
int getAnzahlGENERAL();
general* GetGENERAL(int _analog);
general* GetGENERAL(string _name, bool _create);
@@ -59,8 +58,6 @@ public:
bool isExtendedResolution(int _number = 0);
// void setPostprocessing(ClassFlowPostProcessing *_fpp){flowpostprocessing = _fpp;};
void UpdateNameNumbers(std::vector<std::string> *_name_numbers);
t_CNNType getCNNType(){return CNNType;};

View File

@@ -41,8 +41,6 @@ std::string ClassFlowControll::doSingleStep(std::string _stepname, std::string _
_classname = "ClassFlowAlignment";
}
if ((_stepname.compare(0, 7, "[Digits") == 0) || (_stepname.compare(0, 8, ";[Digits") == 0)) {
// if ((_stepname.compare("[Digits]") == 0) || (_stepname.compare(";[Digits]") == 0)){
// printf("Digits!!!\n");
_classname = "ClassFlowCNNGeneral";
}
if ((_stepname.compare("[Analog]") == 0) || (_stepname.compare(";[Analog]") == 0)){

View File

@@ -16,10 +16,16 @@ struct general {
std::vector<roi*> ROI;
};
enum t_RateType {
AbsoluteChange,
RateChange
};
struct NumberPost {
float MaxRateValue;
bool useMaxRateValue;
t_RateType RateType;
bool ErrorMessage;
bool PreValueOkay;
bool AllowNegativeRates;

View File

@@ -1,6 +1,7 @@
#include <sstream>
#include "ClassFlowMQTT.h"
#include "Helper.h"
#include "connect_wlan.h"
#include "time_sntp.h"
#include "interface_mqtt.h"
@@ -110,9 +111,12 @@ bool ClassFlowMQTT::ReadParameter(FILE* pfile, string& aktparamgraph)
}
}
printf("Init Read with uri: %s, clientname: %s, user: %s, password: %s, maintopic: %s\n", uri.c_str(), clientname.c_str(), user.c_str(), password.c_str(), mainerrortopic.c_str());
if (!MQTTisConnected() && (uri.length() > 0) && (maintopic.length() > 0))
{
{
printf("InitMQTTInit\n");
mainerrortopic = maintopic + "/connection";
printf("Init MQTT with uri: %s, clientname: %s, user: %s, password: %s, maintopic: %s\n", uri.c_str(), clientname.c_str(), user.c_str(), password.c_str(), mainerrortopic.c_str());
MQTTInit(uri, clientname, user, password, mainerrortopic, 60);
MQTTPublish(mainerrortopic, "connected");
MQTTenable = true;
@@ -153,6 +157,12 @@ bool ClassFlowMQTT::doFlow(string zwtime)
sprintf(freeheapmem, "%zu", esp_get_free_heap_size());
MQTTPublish(zw, freeheapmem);
zw = maintopic + "/" + "Wifi RSSI";
char rssi[11];
sprintf(rssi, "%d", get_WIFI_RSSI());
MQTTPublish(zw, rssi);
if (flowpostprocessing)
{
std::vector<NumberPost*>* NUMBERS = flowpostprocessing->GetNumbers();

View File

@@ -5,10 +5,14 @@
#include "CImageBasis.h"
#include "ClassControllCamera.h"
#include "esp_wifi.h"
#include <time.h>
// #define DEBUG_DETAIL_ON
// #define WIFITURNOFF
static const char* TAG = "flow_make_image";
esp_err_t ClassFlowMakeImage::camera_capture(){
@@ -118,7 +122,15 @@ bool ClassFlowMakeImage::ReadParameter(FILE* pfile, string& aktparamgraph)
if ((toUpper(zerlegt[0]) == "FIXEDEXPOSURE") && (zerlegt.size() > 1))
{
if (toUpper(zerlegt[1]) == "TRUE")
FixedExposure = true;
FixedExposure = true;
}
if ((toUpper(zerlegt[0]) == "LEDINTENSITY") && (zerlegt.size() > 1))
{
float ledintensity = stof(zerlegt[1]);
ledintensity = min((float) 100, ledintensity);
ledintensity = max((float) 0, ledintensity);
Camera.SetLEDIntensity(ledintensity);
}
}
@@ -162,8 +174,18 @@ bool ClassFlowMakeImage::doFlow(string zwtime)
LogFile.WriteHeapInfo("ClassFlowMakeImage::doFlow - Before takePictureWithFlash");
#endif
#ifdef WIFITURNOFF
esp_wifi_stop(); // to save power usage and
#endif
takePictureWithFlash(flashdauer);
#ifdef WIFITURNOFF
esp_wifi_start();
#endif
#ifdef DEBUG_DETAIL_ON
LogFile.WriteHeapInfo("ClassFlowMakeImage::doFlow - After takePictureWithFlash");
#endif

View File

@@ -111,25 +111,9 @@ bool ClassFlowPostProcessing::LoadPreValue(void)
double difference = difftime(tStart, NUMBERS[j]->lastvalue);
difference /= 60;
if (difference > PreValueAgeStartup)
{
NUMBERS[j]->PreValueOkay = false;
}
else
{
NUMBERS[j]->PreValueOkay = true;
/*
NUMBERS[j]->Value = NUMBERS[j]->PreValue;
NUMBERS[j]->ReturnValue = to_string(NUMBERS[j]->Value);
NUMBERS[j]->ReturnValueNoError = NUMBERS[j]->ReturnValue;
if (NUMBERS[j]->digit_roi || NUMBERS[j]->analog_roi)
{
NUMBERS[j]->ReturnValue = RundeOutput(NUMBERS[j]->Value, NUMBERS[j]->Nachkomma + 1); // SIcherheitshalber 1 Stelle mehr, da ggf. Exgtended Resolution an ist (wird erst beim ersten Durchlauf gesetzt)
NUMBERS[j]->ReturnValueNoError = NUMBERS[j]->ReturnValue;
}
*/
}
}
}
@@ -320,6 +304,39 @@ void ClassFlowPostProcessing::handleDecimalSeparator(string _decsep, string _val
}
}
void ClassFlowPostProcessing::handleMaxRateType(string _decsep, string _value)
{
string _digit, _decpos;
int _pospunkt = _decsep.find_first_of(".");
// printf("Name: %s, Pospunkt: %d\n", _decsep.c_str(), _pospunkt);
if (_pospunkt > -1)
_digit = _decsep.substr(0, _pospunkt);
else
_digit = "default";
for (int j = 0; j < NUMBERS.size(); ++j)
{
t_RateType _rt = AbsoluteChange;
if (toUpper(_value) == "RATECHANGE")
_rt = RateChange;
if (_digit == "default") // erstmal auf default setzen (falls sonst nichts gesetzt)
{
NUMBERS[j]->RateType = _rt;
}
if (NUMBERS[j]->name == _digit)
{
NUMBERS[j]->RateType = _rt;
}
}
}
void ClassFlowPostProcessing::handleMaxRateValue(string _decsep, string _value)
{
string _digit, _decpos;
@@ -395,6 +412,10 @@ bool ClassFlowPostProcessing::ReadParameter(FILE* pfile, string& aktparamgraph)
{
handleMaxRateValue(zerlegt[0], zerlegt[1]);
}
if ((toUpper(_param) == "MAXRATETYPE") && (zerlegt.size() > 1))
{
handleMaxRateType(zerlegt[0], zerlegt[1]);
}
if ((toUpper(_param) == "PREVALUEUSE") && (zerlegt.size() > 1))
{
@@ -492,6 +513,7 @@ void ClassFlowPostProcessing::InitNUMBERS()
_number->PreValueOkay = false;
_number->AllowNegativeRates = false;
_number->MaxRateValue = 0.1;
_number->RateType = AbsoluteChange;
_number->useMaxRateValue = false;
_number->checkDigitIncreaseConsistency = false;
_number->DecimalShift = 0;
@@ -638,6 +660,11 @@ bool ClassFlowPostProcessing::doFlow(string zwtime)
UpdatePreValueINI = true;
SavePreValue();
}
else
{
NUMBERS[j]->ReturnValue = "";
NUMBERS[j]->ReturnValueNoError = "";
}
}
else
{
@@ -659,11 +686,17 @@ bool ClassFlowPostProcessing::doFlow(string zwtime)
}
double difference = difftime(imagetime, NUMBERS[j]->lastvalue); // in Sekunden
difference /= 60; // in Minuten
difference /= 60;
NUMBERS[j]->FlowRateAct = (NUMBERS[j]->Value - NUMBERS[j]->PreValue) / difference;
NUMBERS[j]->ReturnRateValue = std::to_string(NUMBERS[j]->FlowRateAct);
float _ratedifference;
if (NUMBERS[j]->RateType == RateChange)
_ratedifference = (NUMBERS[j]->Value - NUMBERS[j]->PreValue) / difference;
else
_ratedifference = (NUMBERS[j]->Value - NUMBERS[j]->PreValue);
if (NUMBERS[j]->useMaxRateValue && (abs(NUMBERS[j]->FlowRateAct) > NUMBERS[j]->MaxRateValue))
if (NUMBERS[j]->useMaxRateValue && (abs(_ratedifference) > 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;
@@ -831,14 +864,14 @@ float ClassFlowPostProcessing::checkDigitConsistency(float input, int _decilamsh
while (pot <= pot_max)
{
zw = input / pow(10, pot-1);
aktdigit_before = ((int) zw + 10) % 10;
aktdigit_before = ((int) round(zw) + 10) % 10;
zw = _preValue / pow(10, pot-1);
olddigit_before = ((int) zw + 10) % 10;
olddigit_before = ((int) round(zw) + 10) % 10;
zw = input / pow(10, pot);
aktdigit = ((int) zw + 10) % 10;
aktdigit = ((int) round(zw) + 10) % 10;
zw = _preValue / pow(10, pot);
olddigit = ((int) zw + 10) % 10;
olddigit = ((int) round(zw) + 10) % 10;
no_nulldurchgang = (olddigit_before <= aktdigit_before);

View File

@@ -8,6 +8,7 @@
#include <string>
class ClassFlowPostProcessing :
public ClassFlow
{
@@ -38,7 +39,9 @@ protected:
void InitNUMBERS();
void handleDecimalSeparator(string _decsep, string _value);
void handleMaxRateValue(string _decsep, string _value);
void handleDecimalExtendedResolution(string _decsep, string _value);
void handleDecimalExtendedResolution(string _decsep, string _value);
void handleMaxRateType(string _decsep, string _value);

View File

@@ -274,6 +274,28 @@ void CImageBasis::drawLine(int x1, int y1, int x2, int y2, int r, int g, int b,
}
}
void CImageBasis::drawEllipse(int x1, int y1, int radx, int rady, int r, int g, int b, int thickness)
{
float deltarad, aktrad;
int _thick, _x, _y;
int rad = radx;
if (rady > radx)
rad = rady;
deltarad = 1 / (4 * M_PI * (rad + thickness - 1));
for (aktrad = 0; aktrad <= (2 * M_PI); aktrad += deltarad)
for (_thick = 0; _thick < thickness; ++_thick)
{
_x = sin(aktrad) * (radx + _thick) + x1;
_y = cos(aktrad) * (rady + _thick) + y1;
if (isInImage(_x, _y))
setPixelColor(_x, _y, r, g, b);
}
}
void CImageBasis::drawCircle(int x1, int y1, int rad, int r, int g, int b, int thickness)
{
float deltarad, aktrad;

View File

@@ -57,6 +57,8 @@ class CImageBasis
void drawRect(int x, int y, int dx, int dy, int r = 255, int g = 255, int b = 255, int thickness = 1);
void drawLine(int x1, int y1, int x2, int y2, int r, int g, int b, int thickness = 1);
void drawCircle(int x1, int y1, int rad, int r, int g, int b, int thickness = 1);
void drawEllipse(int x1, int y1, int radx, int rady, int r, int g, int b, int thickness = 1);
void setPixelColor(int x, int y, int r, int g, int b);
void Contrast(float _contrast);
bool ImageOkay();

View File

@@ -14,6 +14,7 @@ bool debugdetail = true;
// #define CONFIG_BROKER_URL "mqtt://192.168.178.43:1883"
esp_mqtt_event_id_t esp_mmqtt_ID = MQTT_EVENT_ANY;
// ESP_EVENT_ANY_ID
bool mqtt_connected = false;
esp_mqtt_client_handle_t client = NULL;

View File

@@ -20,7 +20,9 @@
#include "ClassLogFile.h"
#include "server_GPIO.h"
// #define DEBUG_DETAIL_ON
#include "server_file.h"
#define DEBUG_DETAIL_ON
ClassFlowControll tfliteflow;
@@ -199,7 +201,7 @@ esp_err_t handler_json(httpd_req_t *req)
printf("handler_JSON uri:\n"); printf(req->uri); printf("\n");
char _query[100];
char _size[10];
// char _size[10];
httpd_resp_set_hdr(req, "Access-Control-Allow-Origin", "*");
httpd_resp_set_type(req, "application/json");
@@ -393,6 +395,13 @@ esp_err_t handler_editflow(httpd_req_t *req)
}
}
if (_task.compare("tflite") == 0)
{
printf("Get tflite list\n");
return get_tflite_file_handler(req);
}
if (_task.compare("copy") == 0)
{
string in, out, zw;
@@ -491,13 +500,19 @@ esp_err_t handler_editflow(httpd_req_t *req)
std::string _bri = "";
std::string _con = "";
std::string _sat = "";
std::string _int = "";
int bri = -100;
int sat = -100;
int con = -100;
int intens = -100;
if (httpd_query_key_value(_query, "host", _valuechar, 30) == ESP_OK) {
_host = std::string(_valuechar);
}
if (httpd_query_key_value(_query, "int", _valuechar, 30) == ESP_OK) {
_int = std::string(_valuechar);
intens = stoi(_int);
}
if (httpd_query_key_value(_query, "bri", _valuechar, 30) == ESP_OK) {
_bri = std::string(_valuechar);
bri = stoi(_bri);
@@ -515,7 +530,10 @@ esp_err_t handler_editflow(httpd_req_t *req)
// printf("Parameter host: "); printf(_host.c_str()); printf("\n");
// string zwzw = "Do " + _task + " start\n"; printf(zwzw.c_str());
Camera.SetBrightnessContrastSaturation(bri, con, sat);
Camera.SetLEDIntensity(intens);
printf("test_take - vor MakeImage");
std::string zw = tfliteflow.doSingleStep("[MakeImage]", _host);
httpd_resp_set_hdr(req, "Access-Control-Allow-Origin", "*");
httpd_resp_sendstr_chunk(req, zw.c_str());
}
@@ -701,7 +719,7 @@ void TFliteDoAutoStart()
printf("task_autodoFlow configMINIMAL_STACK_SIZE: %d\n", _i);
printf("getESPHeapInfo: %s\n", getESPHeapInfo().c_str());
xReturned = xTaskCreate(&task_autodoFlow, "task_autodoFlow", configMINIMAL_STACK_SIZE * 48, NULL, tskIDLE_PRIORITY+1, &xHandletask_autodoFlow);
xReturned = xTaskCreate(&task_autodoFlow, "task_autodoFlow", configMINIMAL_STACK_SIZE * 35, NULL, tskIDLE_PRIORITY+1, &xHandletask_autodoFlow);
if( xReturned != pdPASS )
{

View File

@@ -343,6 +343,12 @@ void wifi_init_sta(const char *_ssid, const char *_password, const char *_hostna
*/
}
int get_WIFI_RSSI()
{
wifi_ap_record_t ap;
esp_wifi_sta_get_ap_info(&ap);
return ap.rssi;
}
void wifi_init_sta(const char *_ssid, const char *_password, const char *_hostname)
{

View File

@@ -9,6 +9,7 @@ void wifi_init_sta(const char *_ssid, const char *_password);
std::string* getIPAddress();
std::string* getSSID();
int get_WIFI_RSSI();
extern std::string hostname;
extern std::string std_hostname;

View File

@@ -143,7 +143,17 @@ void task_NoSDBlink(void *pvParameter)
extern "C" void app_main(void)
{
TickType_t xDelay;
PowerResetCamera();
esp_err_t cam = Camera.InitCam();
Camera.LightOnOff(false);
xDelay = 2000 / portTICK_PERIOD_MS;
printf("nach init camera: sleep for : %ldms\n", (long) xDelay);
// LogFile.WriteToFile("Startsequence 06");
vTaskDelay( xDelay );
// LogFile.WriteToFile("Startsequence 07");
if (!Init_NVS_SDCard())
{
xTaskCreate(&task_NoSDBlink, "task_NoSDBlink", configMINIMAL_STACK_SIZE * 64, NULL, tskIDLE_PRIORITY+1, NULL);
@@ -192,28 +202,7 @@ extern "C" void app_main(void)
std::string zw = gettimestring("%Y%m%d-%H%M%S");
printf("time %s\n", zw.c_str());
// Camera.InitCam();
// Camera.LightOnOff(false);
xDelay = 2000 / portTICK_PERIOD_MS;
printf("main: sleep for : %ldms\n", (long) xDelay);
vTaskDelay( xDelay );
server = start_webserver();
register_server_camera_uri(server);
register_server_tflite_uri(server);
register_server_file_uri(server, "/sdcard");
register_server_ota_sdcard_uri(server);
gpio_handler_create(server);
printf("vor reg server main\n");
register_server_main_uri(server, "/sdcard");
printf("vor dotautostart\n");
// init camera module
printf("Do Reset Camera\n");
PowerResetCamera();
size_t _hsize = getESPHeapSize();
if (_hsize < 4000000)
@@ -225,7 +214,6 @@ extern "C" void app_main(void)
LogFile.WriteToFile(_zws);
LogFile.SwitchOnOff(false);
} else {
esp_err_t cam = Camera.InitCam();
if (cam != ESP_OK) {
ESP_LOGE(TAGMAIN, "Failed to initialize camera module. "
"Check that your camera module is working and connected properly.");
@@ -245,12 +233,31 @@ extern "C" void app_main(void)
doReboot();
}
esp_camera_fb_return(fb);
Camera.LightOnOff(false);
TFliteDoAutoStart();
}
}
xDelay = 2000 / portTICK_PERIOD_MS;
printf("main: sleep for : %ldms\n", (long) xDelay*10);
vTaskDelay( xDelay );
printf("starting server\n");
server = start_webserver();
register_server_camera_uri(server);
register_server_tflite_uri(server);
register_server_file_uri(server, "/sdcard");
register_server_ota_sdcard_uri(server);
gpio_handler_create(server);
printf("vor reg server main\n");
register_server_main_uri(server, "/sdcard");
printf("vor dotautostart\n");
TFliteDoAutoStart();
}

View File

@@ -1,4 +1,4 @@
const char* GIT_REV="8972f17";
const char* GIT_REV="b0d8ed6";
const char* GIT_TAG="";
const char* GIT_BRANCH="master";
const char* BUILD_TIME="2022-01-14 20:29";
const char* BUILD_TIME="2022-02-12 09:04";

View File

@@ -13,7 +13,7 @@ extern "C"
#include "Helper.h"
#include <fstream>
const char* GIT_BASE_BRANCH = "master - v10.2.0 - 2022-01-14";
const char* GIT_BASE_BRANCH = "master - v10.4.0 - 2022-02-12";
const char* git_base_branch(void)

View File

@@ -63,6 +63,7 @@ CONFIG_BOOTLOADER_WDT_TIME_MS=9000
# CONFIG_BOOTLOADER_SKIP_VALIDATE_ALWAYS is not set
CONFIG_BOOTLOADER_RESERVE_RTC_SIZE=0
# CONFIG_BOOTLOADER_CUSTOM_RESERVE_RTC is not set
CONFIG_BOOTLOADER_FLASH_XMC_SUPPORT=y
# end of Bootloader config
#
@@ -89,11 +90,11 @@ CONFIG_ESPTOOLPY_FLASHFREQ_40M=y
# CONFIG_ESPTOOLPY_FLASHFREQ_20M is not set
CONFIG_ESPTOOLPY_FLASHFREQ="40m"
# CONFIG_ESPTOOLPY_FLASHSIZE_1MB is not set
CONFIG_ESPTOOLPY_FLASHSIZE_2MB=y
# CONFIG_ESPTOOLPY_FLASHSIZE_4MB is not set
# CONFIG_ESPTOOLPY_FLASHSIZE_2MB is not set
CONFIG_ESPTOOLPY_FLASHSIZE_4MB=y
# CONFIG_ESPTOOLPY_FLASHSIZE_8MB is not set
# CONFIG_ESPTOOLPY_FLASHSIZE_16MB is not set
CONFIG_ESPTOOLPY_FLASHSIZE="2MB"
CONFIG_ESPTOOLPY_FLASHSIZE="4MB"
CONFIG_ESPTOOLPY_FLASHSIZE_DETECT=y
CONFIG_ESPTOOLPY_BEFORE_RESET=y
# CONFIG_ESPTOOLPY_BEFORE_NORESET is not set
@@ -532,6 +533,8 @@ CONFIG_ESP_NETIF_TCPIP_ADAPTER_COMPATIBLE_LAYER=y
CONFIG_ESP_SYSTEM_PANIC_PRINT_REBOOT=y
# CONFIG_ESP_SYSTEM_PANIC_SILENT_REBOOT is not set
# CONFIG_ESP_SYSTEM_PANIC_GDBSTUB is not set
# CONFIG_ESP_SYSTEM_PSRAM_LEAKAGE_WORKAROUND is not set
# CONFIG_ESP_SYSTEM_FLASH_LEAKAGE_WORKAROUND is not set
#
# Memory protection
@@ -657,6 +660,10 @@ CONFIG_FMB_SERIAL_BUF_SIZE=256
CONFIG_FMB_SERIAL_ASCII_BITS_PER_SYMB=8
CONFIG_FMB_SERIAL_ASCII_TIMEOUT_RESPOND_MS=1000
CONFIG_FMB_PORT_TASK_PRIO=10
# CONFIG_FMB_PORT_TASK_AFFINITY_NO_AFFINITY is not set
CONFIG_FMB_PORT_TASK_AFFINITY_CPU0=y
# CONFIG_FMB_PORT_TASK_AFFINITY_CPU1 is not set
CONFIG_FMB_PORT_TASK_AFFINITY=0x0
CONFIG_FMB_CONTROLLER_SLAVE_ID_SUPPORT=y
CONFIG_FMB_CONTROLLER_SLAVE_ID=0x00112233
CONFIG_FMB_CONTROLLER_NOTIFY_TIMEOUT=20
@@ -666,6 +673,8 @@ CONFIG_FMB_EVENT_QUEUE_TIMEOUT=20
CONFIG_FMB_TIMER_PORT_ENABLED=y
CONFIG_FMB_TIMER_GROUP=0
CONFIG_FMB_TIMER_INDEX=0
CONFIG_FMB_MASTER_TIMER_GROUP=0
CONFIG_FMB_MASTER_TIMER_INDEX=0
# CONFIG_FMB_TIMER_ISR_IN_IRAM is not set
# end of Modbus configuration
@@ -1212,13 +1221,13 @@ CONFIG_WPA_MBEDTLS_CRYPTO=y
CONFIG_OV2640_SUPPORT=y
# CONFIG_OV3660_SUPPORT is not set
# CONFIG_OV5640_SUPPORT is not set
CONFIG_GC2145_SUPPORT=y
CONFIG_GC032A_SUPPORT=y
CONFIG_GC0308_SUPPORT=y
# CONFIG_GC2145_SUPPORT is not set
# CONFIG_GC032A_SUPPORT is not set
# CONFIG_GC0308_SUPPORT is not set
# CONFIG_BF3005_SUPPORT is not set
# CONFIG_SCCB_HARDWARE_I2C_PORT0 is not set
CONFIG_SCCB_HARDWARE_I2C_PORT1=y
# CONFIG_GC_SENSOR_WINDOWING_MODE is not set
CONFIG_GC_SENSOR_SUBSAMPLE_MODE=y
CONFIG_SCCB_CLK_FREQ=100000
CONFIG_CAMERA_CORE0=y
# CONFIG_CAMERA_CORE1 is not set
# CONFIG_CAMERA_NO_AFFINITY is not set

View File

@@ -63,6 +63,7 @@ CONFIG_BOOTLOADER_WDT_TIME_MS=9000
# CONFIG_BOOTLOADER_SKIP_VALIDATE_ALWAYS is not set
CONFIG_BOOTLOADER_RESERVE_RTC_SIZE=0
# CONFIG_BOOTLOADER_CUSTOM_RESERVE_RTC is not set
CONFIG_BOOTLOADER_FLASH_XMC_SUPPORT=y
# end of Bootloader config
#
@@ -303,9 +304,9 @@ CONFIG_ESP32_REV_MIN_0=y
CONFIG_ESP32_REV_MIN=0
CONFIG_ESP32_DPORT_WORKAROUND=y
# CONFIG_ESP32_DEFAULT_CPU_FREQ_80 is not set
# CONFIG_ESP32_DEFAULT_CPU_FREQ_160 is not set
CONFIG_ESP32_DEFAULT_CPU_FREQ_240=y
CONFIG_ESP32_DEFAULT_CPU_FREQ_MHZ=240
CONFIG_ESP32_DEFAULT_CPU_FREQ_160=y
# CONFIG_ESP32_DEFAULT_CPU_FREQ_240 is not set
CONFIG_ESP32_DEFAULT_CPU_FREQ_MHZ=160
CONFIG_ESP32_SPIRAM_SUPPORT=y
#
@@ -532,6 +533,8 @@ CONFIG_ESP_NETIF_TCPIP_ADAPTER_COMPATIBLE_LAYER=y
CONFIG_ESP_SYSTEM_PANIC_PRINT_REBOOT=y
# CONFIG_ESP_SYSTEM_PANIC_SILENT_REBOOT is not set
# CONFIG_ESP_SYSTEM_PANIC_GDBSTUB is not set
# CONFIG_ESP_SYSTEM_PSRAM_LEAKAGE_WORKAROUND is not set
# CONFIG_ESP_SYSTEM_FLASH_LEAKAGE_WORKAROUND is not set
#
# Memory protection
@@ -657,6 +660,10 @@ CONFIG_FMB_SERIAL_BUF_SIZE=256
CONFIG_FMB_SERIAL_ASCII_BITS_PER_SYMB=8
CONFIG_FMB_SERIAL_ASCII_TIMEOUT_RESPOND_MS=1000
CONFIG_FMB_PORT_TASK_PRIO=10
# CONFIG_FMB_PORT_TASK_AFFINITY_NO_AFFINITY is not set
CONFIG_FMB_PORT_TASK_AFFINITY_CPU0=y
# CONFIG_FMB_PORT_TASK_AFFINITY_CPU1 is not set
CONFIG_FMB_PORT_TASK_AFFINITY=0x0
CONFIG_FMB_CONTROLLER_SLAVE_ID_SUPPORT=y
CONFIG_FMB_CONTROLLER_SLAVE_ID=0x00112233
CONFIG_FMB_CONTROLLER_NOTIFY_TIMEOUT=20
@@ -666,6 +673,8 @@ CONFIG_FMB_EVENT_QUEUE_TIMEOUT=20
CONFIG_FMB_TIMER_PORT_ENABLED=y
CONFIG_FMB_TIMER_GROUP=0
CONFIG_FMB_TIMER_INDEX=0
CONFIG_FMB_MASTER_TIMER_GROUP=0
CONFIG_FMB_MASTER_TIMER_INDEX=0
# CONFIG_FMB_TIMER_ISR_IN_IRAM is not set
# end of Modbus configuration
@@ -1212,11 +1221,19 @@ CONFIG_WPA_MBEDTLS_CRYPTO=y
CONFIG_OV2640_SUPPORT=y
# CONFIG_OV3660_SUPPORT is not set
# CONFIG_OV5640_SUPPORT is not set
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
# CONFIG_CAMERA_CORE1 is not set
# CONFIG_CAMERA_NO_AFFINITY is not set
CONFIG_CAMERA_DMA_BUFFER_SIZE_MAX=32768
# end of Camera configuration
# end of Component config
@@ -1225,3 +1242,162 @@ CONFIG_CAMERA_CORE0=y
#
# CONFIG_LEGACY_INCLUDE_COMMON_HEADERS is not set
# end of Compatibility options
# Deprecated options for backward compatibility
CONFIG_TOOLPREFIX="xtensa-esp32-elf-"
# CONFIG_LOG_BOOTLOADER_LEVEL_NONE is not set
# CONFIG_LOG_BOOTLOADER_LEVEL_ERROR is not set
# CONFIG_LOG_BOOTLOADER_LEVEL_WARN is not set
CONFIG_LOG_BOOTLOADER_LEVEL_INFO=y
# CONFIG_LOG_BOOTLOADER_LEVEL_DEBUG is not set
# CONFIG_LOG_BOOTLOADER_LEVEL_VERBOSE is not set
CONFIG_LOG_BOOTLOADER_LEVEL=3
# CONFIG_APP_ROLLBACK_ENABLE is not set
# CONFIG_FLASH_ENCRYPTION_ENABLED is not set
# CONFIG_FLASHMODE_QIO is not set
# CONFIG_FLASHMODE_QOUT is not set
CONFIG_FLASHMODE_DIO=y
# CONFIG_FLASHMODE_DOUT is not set
# CONFIG_MONITOR_BAUD_9600B is not set
# CONFIG_MONITOR_BAUD_57600B is not set
CONFIG_MONITOR_BAUD_115200B=y
# CONFIG_MONITOR_BAUD_230400B is not set
# CONFIG_MONITOR_BAUD_921600B is not set
# CONFIG_MONITOR_BAUD_2MB is not set
# CONFIG_MONITOR_BAUD_OTHER is not set
CONFIG_MONITOR_BAUD_OTHER_VAL=115200
CONFIG_MONITOR_BAUD=115200
# CONFIG_COMPILER_OPTIMIZATION_LEVEL_DEBUG is not set
CONFIG_COMPILER_OPTIMIZATION_LEVEL_RELEASE=y
CONFIG_OPTIMIZATION_ASSERTIONS_ENABLED=y
# CONFIG_OPTIMIZATION_ASSERTIONS_SILENT is not set
# CONFIG_OPTIMIZATION_ASSERTIONS_DISABLED is not set
# CONFIG_CXX_EXCEPTIONS is not set
CONFIG_STACK_CHECK_NONE=y
# CONFIG_STACK_CHECK_NORM is not set
# CONFIG_STACK_CHECK_STRONG is not set
# CONFIG_STACK_CHECK_ALL is not set
# CONFIG_WARN_WRITE_STRINGS is not set
# CONFIG_DISABLE_GCC8_WARNINGS is not set
# CONFIG_ESP32_APPTRACE_DEST_TRAX is not set
CONFIG_ESP32_APPTRACE_DEST_NONE=y
CONFIG_ESP32_APPTRACE_LOCK_ENABLE=y
CONFIG_BTDM_CONTROLLER_BLE_MAX_CONN_EFF=0
CONFIG_BTDM_CONTROLLER_BR_EDR_MAX_ACL_CONN_EFF=0
CONFIG_BTDM_CONTROLLER_BR_EDR_MAX_SYNC_CONN_EFF=0
CONFIG_BTDM_CONTROLLER_PINNED_TO_CORE=0
CONFIG_ADC2_DISABLE_DAC=y
CONFIG_SPIRAM_SUPPORT=y
# CONFIG_WIFI_LWIP_ALLOCATION_FROM_SPIRAM_FIRST is not set
CONFIG_TRACEMEM_RESERVE_DRAM=0x0
# CONFIG_TWO_UNIVERSAL_MAC_ADDRESS is not set
CONFIG_FOUR_UNIVERSAL_MAC_ADDRESS=y
CONFIG_NUMBER_OF_UNIVERSAL_MAC_ADDRESS=4
# CONFIG_ULP_COPROC_ENABLED is not set
CONFIG_ULP_COPROC_RESERVE_MEM=0
CONFIG_BROWNOUT_DET=y
CONFIG_BROWNOUT_DET_LVL_SEL_0=y
# CONFIG_BROWNOUT_DET_LVL_SEL_1 is not set
# CONFIG_BROWNOUT_DET_LVL_SEL_2 is not set
# CONFIG_BROWNOUT_DET_LVL_SEL_3 is not set
# CONFIG_BROWNOUT_DET_LVL_SEL_4 is not set
# CONFIG_BROWNOUT_DET_LVL_SEL_5 is not set
# CONFIG_BROWNOUT_DET_LVL_SEL_6 is not set
# CONFIG_BROWNOUT_DET_LVL_SEL_7 is not set
CONFIG_BROWNOUT_DET_LVL=0
CONFIG_REDUCE_PHY_TX_POWER=y
CONFIG_ESP32_RTC_CLOCK_SOURCE_INTERNAL_RC=y
# CONFIG_ESP32_RTC_CLOCK_SOURCE_EXTERNAL_CRYSTAL is not set
# CONFIG_ESP32_RTC_CLOCK_SOURCE_EXTERNAL_OSC is not set
# CONFIG_ESP32_RTC_CLOCK_SOURCE_INTERNAL_8MD256 is not set
# CONFIG_DISABLE_BASIC_ROM_CONSOLE is not set
# CONFIG_NO_BLOBS is not set
# CONFIG_COMPATIBLE_PRE_V2_1_BOOTLOADERS is not set
CONFIG_SYSTEM_EVENT_QUEUE_SIZE=32
CONFIG_SYSTEM_EVENT_TASK_STACK_SIZE=2304
CONFIG_MAIN_TASK_STACK_SIZE=3584
CONFIG_IPC_TASK_STACK_SIZE=1024
CONFIG_CONSOLE_UART_DEFAULT=y
# CONFIG_CONSOLE_UART_CUSTOM is not set
# CONFIG_ESP_CONSOLE_UART_NONE is not set
CONFIG_CONSOLE_UART=y
CONFIG_CONSOLE_UART_NUM=0
CONFIG_CONSOLE_UART_BAUDRATE=115200
CONFIG_INT_WDT=y
CONFIG_INT_WDT_TIMEOUT_MS=300
CONFIG_INT_WDT_CHECK_CPU1=y
CONFIG_TASK_WDT=y
# CONFIG_TASK_WDT_PANIC is not set
CONFIG_TASK_WDT_TIMEOUT_S=5
CONFIG_TASK_WDT_CHECK_IDLE_TASK_CPU0=y
CONFIG_TASK_WDT_CHECK_IDLE_TASK_CPU1=y
# CONFIG_EVENT_LOOP_PROFILING is not set
CONFIG_POST_EVENTS_FROM_ISR=y
CONFIG_POST_EVENTS_FROM_IRAM_ISR=y
# CONFIG_ESP32S2_PANIC_PRINT_HALT is not set
CONFIG_ESP32S2_PANIC_PRINT_REBOOT=y
# CONFIG_ESP32S2_PANIC_SILENT_REBOOT is not set
# CONFIG_ESP32S2_PANIC_GDBSTUB is not set
CONFIG_TIMER_TASK_STACK_SIZE=3584
# CONFIG_ESP32_ENABLE_COREDUMP_TO_FLASH is not set
# CONFIG_ESP32_ENABLE_COREDUMP_TO_UART is not set
CONFIG_ESP32_ENABLE_COREDUMP_TO_NONE=y
CONFIG_MB_MASTER_TIMEOUT_MS_RESPOND=150
CONFIG_MB_MASTER_DELAY_MS_CONVERT=200
CONFIG_MB_QUEUE_LENGTH=20
CONFIG_MB_SERIAL_TASK_STACK_SIZE=4096
CONFIG_MB_SERIAL_BUF_SIZE=256
CONFIG_MB_SERIAL_TASK_PRIO=10
CONFIG_MB_CONTROLLER_SLAVE_ID_SUPPORT=y
CONFIG_MB_CONTROLLER_SLAVE_ID=0x00112233
CONFIG_MB_CONTROLLER_NOTIFY_TIMEOUT=20
CONFIG_MB_CONTROLLER_NOTIFY_QUEUE_SIZE=20
CONFIG_MB_CONTROLLER_STACK_SIZE=4096
CONFIG_MB_EVENT_QUEUE_TIMEOUT=20
CONFIG_MB_TIMER_PORT_ENABLED=y
CONFIG_MB_TIMER_GROUP=0
CONFIG_MB_TIMER_INDEX=0
# CONFIG_ENABLE_STATIC_TASK_CLEAN_UP_HOOK is not set
CONFIG_TIMER_TASK_PRIORITY=1
CONFIG_TIMER_TASK_STACK_DEPTH=2048
CONFIG_TIMER_QUEUE_LENGTH=10
# CONFIG_L2_TO_L3_COPY is not set
# CONFIG_USE_ONLY_LWIP_SELECT is not set
CONFIG_ESP_GRATUITOUS_ARP=y
CONFIG_GARP_TMR_INTERVAL=60
CONFIG_TCPIP_RECVMBOX_SIZE=32
CONFIG_TCP_MAXRTX=12
CONFIG_TCP_SYNMAXRTX=12
CONFIG_TCP_MSS=1440
CONFIG_TCP_MSL=60000
CONFIG_TCP_SND_BUF_DEFAULT=5744
CONFIG_TCP_WND_DEFAULT=5744
CONFIG_TCP_RECVMBOX_SIZE=6
CONFIG_TCP_QUEUE_OOSEQ=y
# CONFIG_ESP_TCP_KEEP_CONNECTION_WHEN_IP_CHANGES is not set
CONFIG_TCP_OVERSIZE_MSS=y
# CONFIG_TCP_OVERSIZE_QUARTER_MSS is not set
# CONFIG_TCP_OVERSIZE_DISABLE is not set
CONFIG_UDP_RECVMBOX_SIZE=6
CONFIG_TCPIP_TASK_STACK_SIZE=3072
CONFIG_TCPIP_TASK_AFFINITY_NO_AFFINITY=y
# CONFIG_TCPIP_TASK_AFFINITY_CPU0 is not set
# CONFIG_TCPIP_TASK_AFFINITY_CPU1 is not set
CONFIG_TCPIP_TASK_AFFINITY=0x7FFFFFFF
# CONFIG_PPP_SUPPORT is not set
CONFIG_ESP32_PTHREAD_TASK_PRIO_DEFAULT=5
CONFIG_ESP32_PTHREAD_TASK_STACK_SIZE_DEFAULT=3072
CONFIG_ESP32_PTHREAD_STACK_MIN=768
CONFIG_ESP32_DEFAULT_PTHREAD_CORE_NO_AFFINITY=y
# CONFIG_ESP32_DEFAULT_PTHREAD_CORE_0 is not set
# CONFIG_ESP32_DEFAULT_PTHREAD_CORE_1 is not set
CONFIG_ESP32_PTHREAD_TASK_CORE_DEFAULT=-1
CONFIG_ESP32_PTHREAD_TASK_NAME_DEFAULT="pthread"
CONFIG_SPI_FLASH_WRITING_DANGEROUS_REGIONS_ABORTS=y
# CONFIG_SPI_FLASH_WRITING_DANGEROUS_REGIONS_FAILS is not set
# CONFIG_SPI_FLASH_WRITING_DANGEROUS_REGIONS_ALLOWED is not set
CONFIG_SUPPRESS_SELECT_DEBUG_OUTPUT=y
CONFIG_SUPPORT_TERMIOS=y
CONFIG_SEMIHOSTFS_MAX_MOUNT_POINTS=1
CONFIG_SEMIHOSTFS_HOST_PATH_MAX_LEN=128
# End of deprecated options

View File

@@ -1,4 +1,4 @@
const char* GIT_REV="8972f17";
const char* GIT_REV="b0d8ed6";
const char* GIT_TAG="";
const char* GIT_BRANCH="master";
const char* BUILD_TIME="2022-01-14 20:29";
const char* BUILD_TIME="2022-02-12 09:04";

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

View File

@@ -3,9 +3,10 @@
WaitBeforeTakingPicture = 5
;LogfileRetentionInDays = 15
Brightness = 0
;Contrast = 0
;Saturation = 0
ImageQuality = 5
Contrast = 0
Saturation = 0
LEDIntensity = 50
ImageQuality = 12
ImageSize = VGA
FixedExposure = false
@@ -20,7 +21,7 @@ FlipImageSize = false
/config/ref1.jpg 442 142
[Digits]
Model = /config/dig-s2-q-20220104.tflite
Model = /config/dig-s2-q-20220211.tflite
;LogImageLocation = /log/digit
;LogfileRetentionInDays = 3
ModelInputSize = 20 32

Binary file not shown.

View File

@@ -133,7 +133,8 @@ textarea {
<input type="number" id="MakeImage_ImageQuality_value1" size="13" min="0" max="63">
</td>
<td class="description">
Quality index for picture (default = "5" - "0" high ... "63" low)
Quality index for picture (default = "12" - "0" high ... "63" low) <br>
Remark: values smaller than 12 can result in a reboot, as the bigger sized JPEG might not fit in the available RAM!
</td>
</tr>
<tr class="expert" id="ex3">
@@ -152,6 +153,22 @@ textarea {
Picture size camera (default = "VGA")
</td>
</tr>
<tr class="expert" id="LEDIntensity_ex3">
<td width="20px" style="padding-left: 40px;">
</td>
<td>
<class id="MakeImage_LEDIntensity_text" style="color:black;">LEDIntensity</class>
</td>
<td>
<input type="number" id="MakeImage_LEDIntensity_value1" size="13" min="0" max="100">
</td>
<td style="font-size: 80%;">
Internal LED Flash Intensity (PWM from 0% - 100%). <br>
Remark: as the camera autoillumination settings are used, this is rather for energy saving, than reducing reflections.
</td>
</tr>
<tr class="expert" id="Brightness_ex3">
<td width="20px" style="padding-left: 40px;">
</td>
@@ -165,6 +182,37 @@ textarea {
Image Brightness (-2 .. 2 - default = "0")
</td>
</tr>
<tr class="expert" id="Contrast_ex3">
<td width="20px" style="padding-left: 40px;">
</td>
<td>
<class id="MakeImage_Contrast_text" style="color:black;">Contrast</class>
</td>
<td>
<input type="number" id="MakeImage_Contrast_value1" size="13" min="-2" max="2">
</td>
<td style="font-size: 80%;">
Image Contrast (-2 .. 2 - default = "0") <br>
Remark: camera driver is not fully supporting this setting yet (no impact on image)
</td>
</tr>
<tr class="expert" id="Saturation_ex3">
<td width="20px" style="padding-left: 40px;">
</td>
<td>
<class id="MakeImage_Saturation_text" style="color:black;">Saturation</class>
</td>
<td>
<input type="number" id="MakeImage_Saturation_value1" size="13" min="-2" max="2">
</td>
<td style="font-size: 80%;">
Image Saturation (-2 .. 2 - default = "0") <br>
Remark: camera driver is not fully supporting this setting yet (no impact on image)
</td>
</tr>
<tr class="expert" id="MakeImage_FixedExposure_ex10">
<td width="20px" style="padding-left: 40px;">
</td>
@@ -183,37 +231,6 @@ textarea {
</tr>
<!--
<tr class="expert" id="Contrast_ex3">
<td width="20px" style="padding-left: 40px;">
</td>
<td>
<class id="MakeImage_Contrast_text" style="color:black;">Contrast</class>
</td>
<td>
<input type="number" id="MakeImage_Contrast_value1" size="13" min="-2" max="2">
</td>
<td style="font-size: 80%;">
Image Contrast (-2 .. 2 - default = "0")
</td>
</tr>
<tr class="expert" id="Saturation_ex3">
<td width="20px" style="padding-left: 40px;">
</td>
<td>
<class id="MakeImage_Saturation_text" style="color:black;">Saturation</class>
</td>
<td>
<input type="number" id="MakeImage_Saturation_value1" size="13" min="-2" max="2">
</td>
<td style="font-size: 80%;">
Image Saturation (-2 .. 2 - default = "0")
</td>
</tr>
-->
<tr class="expert" id="ex4">
<td colspan="4" style="padding-left: 20px;"><h4>Alignment</h4></td>
</tr>
@@ -274,7 +291,8 @@ textarea {
<class id="Digits_Model_text" style="color:black;">Model</class>
</td>
<td>
<input type="text" id="Digits_Model_value1">
<select id="Digits_Model_value1">
</select>
</td>
<td style="font-size: 80%;">
Path to CNN model file for image recognition
@@ -330,7 +348,10 @@ textarea {
<tr>
<td width="20px" style="padding-left: 40px;"> </td>
<td width="200px"> <class id="Analog_Model_text" style="color:black;">Model</class> </td>
<td> <input type="text" id="Analog_Model_value1"> </td>
<td>
<select id="Analog_Model_value1">
</select>
</td>
<td style="font-size: 80%;"> Path to CNN model file for image recognition</td>
</tr>
<tr>
@@ -449,7 +470,7 @@ textarea {
<tr>
<td style="padding-left: 40px;" colspan="4">
<br>
<b>Postprocessing Individual Paramters:
<b>Postprocessing Individual Parameters:
<select id="Numbers_value1" onchange="numberChanged()">
<option value="0" selected>default</option>
<option value="1" >NT</option>
@@ -482,7 +503,24 @@ textarea {
<input type="number" id="PostProcessing_MaxRateValue_value1" size="13" min="0" step="any">
</td>
<td style="font-size: 80%;">
Maximum change of reading per minute
Maximum change of a reading - if threated as absolute or relative change see next parameter.
</td>
</tr>
<tr>
<td width="20px" style="padding-left: 40px;">
<input type="checkbox" id="PostProcessing_MaxRateType_enabled" value="1" onclick = 'InvertEnableItem("PostProcessing", "MaxRateType")' unchecked >
</td>
<td width="200px">
<class id="PostProcessing_MaxRateType_text" style="color:black;">MaxRateType</class>
</td>
<td>
<select id="PostProcessing_MaxRateType_value1">
<option value="AbsoluteChange" >AbsoluteChange</option>
<option value="RateChange" selected>RateChange</option>
</select>
</td>
<td style="font-size: 80%;">
Defines if the change rate compared to the previous value is calculated as absolute change (AbsoluteChange) or as rate normalized to the intervall (RateChange = change/minute).
</td>
</tr>
<tr>
@@ -1676,6 +1714,7 @@ function UpdateInputIndividual()
{
ReadParameter(param, "PostProcessing", "DecimalShift", true, NUNBERSAkt)
ReadParameter(param, "PostProcessing", "MaxRateValue", true, NUNBERSAkt)
ReadParameter(param, "PostProcessing", "MaxRateType", true, NUNBERSAkt)
ReadParameter(param, "PostProcessing", "ExtendedResolution", true, NUNBERSAkt)
ReadParameter(param, "PostProcessing", "IgnoreLeadingNaN", true, NUNBERSAkt)
}
@@ -1684,6 +1723,7 @@ function UpdateInputIndividual()
NUNBERSAkt = sel.selectedIndex;
WriteParameter(param, category, "PostProcessing", "DecimalShift", true, NUNBERSAkt);
WriteParameter(param, category, "PostProcessing", "MaxRateValue", true, NUNBERSAkt);
WriteParameter(param, category, "PostProcessing", "MaxRateType", true, NUNBERSAkt);
WriteParameter(param, category, "PostProcessing", "ExtendedResolution", true, NUNBERSAkt);
WriteParameter(param, category, "PostProcessing", "IgnoreLeadingNaN", true, NUNBERSAkt);
}
@@ -1700,8 +1740,9 @@ function UpdateInput() {
WriteParameter(param, category, "MakeImage", "WaitBeforeTakingPicture", false);
WriteParameter(param, category, "MakeImage", "ImageQuality", false);
WriteParameter(param, category, "MakeImage", "Brightness", false);
// WriteParameter(param, category, "MakeImage", "Contrast", false);
// WriteParameter(param, category, "MakeImage", "Saturation", false);
WriteParameter(param, category, "MakeImage", "Contrast", false);
WriteParameter(param, category, "MakeImage", "Saturation", false);
WriteParameter(param, category, "MakeImage", "LEDIntensity", false);
WriteParameter(param, category, "MakeImage", "ImageSize", false);
WriteParameter(param, category, "MakeImage", "FixedExposure", false);
@@ -1709,12 +1750,12 @@ function UpdateInput() {
WriteParameter(param, category, "Alignment", "SearchFieldY", false);
WriteParameter(param, category, "Alignment", "AlignmentAlgo", true);
WriteParameter(param, category, "Digits", "Model", false);
// WriteParameter(param, category, "Digits", "Model", false);
WriteParameter(param, category, "Digits", "LogImageLocation", true);
WriteParameter(param, category, "Digits", "LogfileRetentionInDays", true);
WriteParameter(param, category, "Digits", "ModelInputSize", false);
WriteParameter(param, category, "Analog", "Model", false);
// WriteParameter(param, category, "Analog", "Model", false);
WriteParameter(param, category, "Analog", "LogImageLocation", true);
WriteParameter(param, category, "Analog", "LogfileRetentionInDays", true);
// WriteParameter(param, category, "Analog", "ExtendedResolution", true);
@@ -1752,6 +1793,34 @@ function UpdateInput() {
WriteParameter(param, category, "System", "TimeZone", true);
WriteParameter(param, category, "System", "Hostname", true);
WriteParameter(param, category, "System", "TimeServer", true);
WriteModelFiles();
}
function WriteModelFiles()
{
list_tflite = getTFLITEList();
var _index1 = document.getElementById("Digits_Model_value1");
var _index2 = document.getElementById("Analog_Model_value1");
while (_index1.length)
_index1.remove(0);
while (_index2.length)
_index2.remove(0);
for (var i = 0; i < list_tflite.length; ++i){
var option1 = document.createElement("option");
var option2 = document.createElement("option");
option1.text = list_tflite[i];
option1.value = list_tflite[i];
option2.text = list_tflite[i];
option2.value = list_tflite[i];
_index1.add(option1);
_index2.add(option2);
}
WriteParameter(param, category, "Analog", "Model", false);
WriteParameter(param, category, "Digits", "Model", false);
}
function ReadParameterAll()
@@ -1766,8 +1835,9 @@ function ReadParameterAll()
ReadParameter(param, "MakeImage", "WaitBeforeTakingPicture", false);
ReadParameter(param, "MakeImage", "ImageQuality", false);
ReadParameter(param, "MakeImage", "Brightness", false);
// ReadParameter(param, "MakeImage", "Contrast", false);
// ReadParameter(param, "MakeImage", "Saturation", false);
ReadParameter(param, "MakeImage", "Contrast", false);
ReadParameter(param, "MakeImage", "Saturation", false);
ReadParameter(param, "MakeImage", "LEDIntensity", false);
ReadParameter(param, "MakeImage", "ImageSize", false);
ReadParameter(param, "MakeImage", "FixedExposure", false);
@@ -1783,13 +1853,11 @@ function ReadParameterAll()
ReadParameter(param, "Analog", "Model", false);
ReadParameter(param, "Analog", "LogImageLocation", true);
ReadParameter(param, "Analog", "LogfileRetentionInDays", true);
// ReadParameter(param, "Analog", "ExtendedResolution", true);
ReadParameter(param, "Analog", "ModelInputSize", false);
ReadParameter(param, "PostProcessing", "PreValueUse", true);
ReadParameter(param, "PostProcessing", "PreValueAgeStartup", true);
ReadParameter(param, "PostProcessing", "AllowNegativeRates", true);
// ReadParameter(param, "PostProcessing", "MaxRateValue", true);
ReadParameter(param, "PostProcessing", "ErrorMessage", true);
ReadParameter(param, "PostProcessing", "CheckDigitIncreaseConsistency", true);

View File

@@ -45,34 +45,37 @@ table {
<tr>
<td style="padding-top: 10px"><label for="mirror" id="labelmirror">Mirror Image:</label></td>
<td style="padding-top: 10px"><input type="checkbox" id="mirror" name="mirror" value="1" onchange="drawRotated()"></td>
<td>
<class id="MakeImage_LEDIntensity_text" style="color:black;">LEDIntensity: </class>
<input type="number" id="MakeImage_LEDIntensity_value1" size="13" value=0 min="0" max="100" style="float: right; clear: both;">
</td>
</tr>
<tr>
<td><label for="flip" id="labelflip">Flip Image Size:</label></td>
<td><input type="checkbox" id="flip" name="flip" value="1" onchange="drawRotated()"></td>
<td>
<class id="MakeImage_Brightness_text" style="color:black;">Brightness: </class>
<input type="number" id="MakeImage_Brightness_value1" size="13" value=0 min="-2" max="2" style="float: right; clear: both;">
</td>
</tr>
<tr>
<td><label for="mirror">Pre-rotate Angle:</label></td>
<td><input type="number" id="prerotateangle" name="prerotateangle" value="0" min="-360" max="360" onchange="drawRotated()">Degrees</td>
<td>
<class id="MakeImage_Brightness_text" style="color:black;">Brightness: </class>
<input type="number" id="MakeImage_Brightness_value1" size="13" value=0 min="-2" max="2" style="float: right; clear: both;">
<class id="MakeImage_Contrast_text" style="color:black;">Contrast</class>
<input type="number" id="MakeImage_Contrast_value1" size="13" value=0 min="-2" max="2" style="float: right; clear: both;">
</td>
</tr>
<tr>
<td><label for="mirror">Fine Alignment:</label></td>
<td><input type="number" id="finerotate" name="finerotate" value=0.0 min="-1" max="1" step="0.2" onchange="drawRotated()">Degrees</td>
<!--
<td>
<class id="MakeImage_Contrast_text" style="color:black;">Contrast</class>
<input type="number" id="MakeImage_Contrast_value1" size="13" value=0 min="-2" max="2" style="float: right; clear: both;">
</td>
<td>
<class id="MakeImage_Saturation_text" style="color:black;">Saturation</class>
<input type="number" id="MakeImage_Saturation_value1" size="13" value=0 min="-2" max="2" style="float: right; clear: both;">
</td>
-->
</tr>
</table>
@@ -104,10 +107,13 @@ table {
var xhttp = new XMLHttpRequest();
if (param["MakeImage"]["Brightness"].found && param["MakeImage"]["Brightness"].enabled)
{
_intensity = document.getElementById("MakeImage_LEDIntensity_value1").value;
if (_intensity == "") _intensity = "50";
_brightness = document.getElementById("MakeImage_Brightness_value1").value;
// _contrast = document.getElementById("MakeImage_Contrast_value1").value;
// _saturation = document.getElementById("MakeImage_Saturation_value1").value;
url = basepath + "/editflow.html?task=test_take&bri=" + _brightness;
_contrast = document.getElementById("MakeImage_Contrast_value1").value;
_saturation = document.getElementById("MakeImage_Saturation_value1").value;
url = basepath + "/editflow.html?task=test_take&bri=" + _brightness;
url = url + "&con=" + _saturation + "&sat=" + _saturation + "&int=" + _intensity;
}
else
{
@@ -116,8 +122,11 @@ table {
if (basepath.length > 0){
url = url + "&host=" + basepath;
}
xhttp.open("GET", url, false);
xhttp.send();
loadRawImage();
}
@@ -142,7 +151,12 @@ table {
}
if (param["MakeImage"]["Brightness"].found && param["MakeImage"]["Brightness"].enabled)
{
document.getElementById("MakeImage_Brightness_value1").disabled = false;
document.getElementById("MakeImage_Contrast_value1").disabled = false;
document.getElementById("MakeImage_Saturation_value1").disabled = false;
document.getElementById("MakeImage_LEDIntensity_value1").disabled = false;
}
else
{
document.getElementById("MakeImage_Brightness_value1").type = "hidden";
@@ -176,8 +190,9 @@ table {
document.getElementById("updatereferenceimage").disabled = true;
document.getElementById("take").disabled = true;
document.getElementById("MakeImage_Brightness_value1").disabled = true;
// document.getElementById("MakeImage_Saturation_value1").disabled = true;
// document.getElementById("MakeImage_Contrast_value1").disabled = true;
document.getElementById("MakeImage_Saturation_value1").disabled = true;
document.getElementById("MakeImage_Contrast_value1").disabled = true;
document.getElementById("MakeImage_LEDIntensity_value1").disabled = true;
document.getElementById("mirror").disabled = false;
document.getElementById("flip").disabled = false;
if (!(param["MakeImage"]["Brightness"].found))
@@ -225,8 +240,9 @@ table {
if (param["MakeImage"]["Brightness"].found && param["MakeImage"]["Brightness"].enabled)
{
ReadParameter(param, "MakeImage", "Brightness", false);
// ReadParameter(param, "MakeImage", "Contrast", false);
// ReadParameter(param, "MakeImage", "Saturation", false);
ReadParameter(param, "MakeImage", "Contrast", false);
ReadParameter(param, "MakeImage", "Saturation", false);
ReadParameter(param, "MakeImage", "LEDIntensity", false);
}
var canvas = document.getElementById("canvas");
@@ -238,6 +254,7 @@ table {
SaveCanvasToImage(canvas, "/config/reference.jpg", true, basepath);
showReference();
UpdatePage();
alert("Reference is updated!");
}
}
@@ -274,14 +291,42 @@ table {
loadConfig(basepath);
ParseConfig();
param = getConfigParameters();
param["MakeImage"]["LEDIntensity"]["enabled"] = true;
param["MakeImage"]["Brightness"]["enabled"] = true;
param["MakeImage"]["Contrast"]["enabled"] = true;
param["MakeImage"]["Saturation"]["enabled"] = true;
if (!param["MakeImage"]["LEDIntensity"]["found"])
{
param["MakeImage"]["LEDIntensity"]["found"] = true;
param["MakeImage"]["LEDIntensity"]["value1"] = "50";
}
if (!param["MakeImage"]["Brightness"]["found"])
{
param["MakeImage"]["Brightness"]["found"] = true;
param["MakeImage"]["Brightness"]["value1"] = "0";
}
if (!param["MakeImage"]["Contrast"]["found"])
{
param["MakeImage"]["Contrast"]["found"] = true;
param["MakeImage"]["Contrast"]["value1"] = "0";
}
if (!param["MakeImage"]["Saturation"]["found"])
{
param["MakeImage"]["Saturation"]["found"] = true;
param["MakeImage"]["Saturation"]["value1"] = "0";
}
UpdateInput();
showReference(param);
}
function UpdateInput() {
WriteParameter(param, category, "MakeImage", "Brightness", false);
// WriteParameter(param, category, "MakeImage", "Contrast", false);
// WriteParameter(param, category, "MakeImage", "Saturation", false);
WriteParameter(param, category, "MakeImage", "Contrast", false);
WriteParameter(param, category, "MakeImage", "Saturation", false);
WriteParameter(param, category, "MakeImage", "LEDIntensity", false);
}

View File

@@ -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.34"; // jomjol interner Real
host = "http://192.168.178.62"; // jomjol interner Real
// host = "http://192.168.43.191";
// host = "."; // jomjol interner localhost

View File

@@ -112,7 +112,7 @@ li.dropdown {
var basepath = "http://192.168.178.22";
function LoadHostname() {
function LoadHostname() {
_basepath = getbasepath();

View File

@@ -8,7 +8,7 @@
<style>
h1 {font-size: 2em;}
h2 {font-size: 1.5em;}
h3 {font-size: 1.2em;}
h3 {font-size: 1.2em;}
p {font-size: 1em;}
input[type=number] {
@@ -114,6 +114,36 @@ input[type=number] {
</td>
</tr>
</table>
<h2>4. Upload neural network definition (tfl/tflite file)</h2>
<table class="fixed" border="0">
<tr>
<td>
<table border="0">
<tr>
<td>
<label for="newfiletfl">Select the tfl/tflite file</label>
</td>
<td colspan="2">
<input id="newfiletfl" type="file" onchange="setpathtfl()" style="width:100%;">
</td>
</tr>
<tr>
<td>
<label for="filepathtfl">Set path on server</label>
</td>
<td>
<input id="filepathtfl" type="text" style="width:100%;" readonly>
</td>
<td>
<button id="uploadtfl" type="button" onclick="uploadtfl()" disabled>Upload</button>
</td>
</tr>
</table>
</td>
</tr>
The file must be activated in the config.ini file.
</table>
<script type="text/javascript" src="./gethost.js"></script>
@@ -126,6 +156,7 @@ function init(){
document.getElementById("uploadhtml").disabled = true;
document.getElementById("doUpdate").disabled = true;
document.getElementById("doUpdatehtml").disabled = true;
document.getElementById("uploadtfl").disabled = true;
}
function doUpdate() {
@@ -203,6 +234,17 @@ function setpathhtml() {
}
function setpathtfl() {
var nameneu = document.getElementById("newfiletfl").value;
nameneu = nameneu.split(/[\\\/]/).pop();
var fileserverpraefix = "/config/" + nameneu;
document.getElementById("filepathtfl").value = fileserverpraefix;
document.getElementById("uploadtfl").disabled = false;
}
function upload() {
var xhttp = new XMLHttpRequest();
@@ -342,6 +384,74 @@ function uploadhtml() {
}
function uploadtfl() {
var xhttp = new XMLHttpRequest();
/* first delete the old firmware */
xhttp.onreadystatechange = function() {
if (xhttp.readyState == 4) {
if (xhttp.status == 200) {
/* keine Reaktion, damit sich das Dokument nicht ändert */
} else if (xhttp.status == 0) {
alert("Server closed the connection abruptly!");
UpdatePage();
} else {
alert(xhttp.status + " Error!\n" + xhttp.responseText);
UpdatePage();
}
}
};
/* ----------------------------- */
var filePath = document.getElementById("filepathtfl").value;
var upload_path = "/upload/" + filePath;
var fileInput = document.getElementById("newfiletfl").files;
/* Max size of an individual file. Make sure this
* value is same as that set in file_server.c */
var MAX_FILE_SIZE = 2000*1024;
var MAX_FILE_SIZE_STR = "2000KB";
if (fileInput.length == 0) {
alert("No file selected!");
} else if (filePath.length == 0) {
alert("File path on server is not set!");
} else if (filePath.indexOf(' ') >= 0) {
alert("File path on server cannot have spaces!");
} else if (filePath[filePath.length-1] == '/') {
alert("File name not specified after path!");
} else if (fileInput[0].size > 2000*1024) {
alert("File size must be less than 2000KB!");
} else {
document.getElementById("newfiletfl").disabled = true;
document.getElementById("filepathtfl").disabled = true;
document.getElementById("uploadtfl").disabled = true;
xhttp.onreadystatechange = function() {
if (xhttp.readyState == 4) {
if (xhttp.status == 200) {
alert("Upload successfull!")
document.getElementById("newfiletfl").disabled = false;
document.getElementById("filepathtfl").disabled = false;
} else if (xhttp.status == 0) {
alert("Server closed the connection abruptly!");
UpdatePage();
} else {
alert(xhttp.status + " Error!\n" + xhttp.responseText);
UpdatePage();
}
}
};
var file = fileInput[0];
xhttp.open("POST", upload_path, true);
xhttp.send(file);
}
}
init();
</script>

View File

@@ -1,339 +0,0 @@
<html>
<head>
<link rel="icon" href="data:,">
<title>jomjol - AI on the edge</title>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<script type="text/javascript">
//<![CDATA[
//]]>
</script>
</head>
<body>
<button id="testupdownload" type="button" onclick="testupdownload()">UpDownload</button>
<h3>It is strongly recommended to update firmware and content of /html directory on SD-card at the same time!</h3>
<h2>1. Firmware Update</h2>
<table class="fixed" border="0">
<tr>
<td>
<table border="0">
<tr>
<td>
<label for="newfile">Select the firmware file</label>
</td>
<td colspan="2">
<input id="newfile" type="file" onchange="setpath()" style="width:100%;">
</td>
</tr>
<tr>
<td>
<label for="filepath">Set path on server</label>
</td>
<td>
<input id="filepath" type="text" style="width:100%;" readonly>
</td>
<td>
<button id="upload" type="button" onclick="upload()">Upload</button>
</td>
</tr>
</table>
</td>
</tr>
<tr>
<td>
<button id="doUpdate" type="button" onclick="doUpdate()">Flash the firmware</button> (Takes about 60s)
</td>
</tr>
</table>
<h2>2. Update /html directory</h2>
<table class="fixed" border="0">
<tr>
<td>
<table border="0">
<tr>
<td>
<label for="newfilehtml">Select the zipped /html content</label>
</td>
<td colspan="2">
<input id="newfilehtml" type="file" onchange="setpathhtml()" style="width:100%;">
</td>
</tr>
<tr>
<td>
<label for="filepathhtml">Set path on server</label>
</td>
<td>
<input id="filepathhtml" type="text" style="width:100%;" readonly>
</td>
<td>
<button id="uploadhtml" type="button" onclick="uploadhtml()">Upload</button>
</td>
</tr>
</table>
</td>
</tr>
<tr>
<td>
<button id="doUpdatehtml" type="button" onclick="doUpdatehtml()">Update "/html" directory</button>
</td>
</tr>
</table>
<h2>3. Reboot</h2>
<table class="fixed" border="0">
<tr>
<td>
<button id="reboot" type="button" onclick="doReboot()">Reboot to activate updates</button>
</td>
</tr>
</table>
<script type="text/javascript" src="./gethost.js"></script>
<script language="JavaScript">
function testupdownload(){
var xhr = new XMLHttpRequest();
xhr.open("get", "https://github.com/jomjol/AI-on-the-edge-device/raw/master/firmware/html.zip", true);
xhr.onload = function () {
xhr.close();
var xhr2 = new XMLHttpRequest();
xhr2.open("post", "/upload/firmware/html2.zip", true);
xhr2.send(xhr.response);
}
xhr.send();
}
function init(){
document.getElementById("reboot").disabled = true;
document.getElementById("upload").disabled = true;
document.getElementById("uploadhtml").disabled = true;
document.getElementById("doUpdate").disabled = true;
document.getElementById("doUpdatehtml").disabled = true;
}
function doUpdate() {
if (confirm("Are you sure to update the firmware?")) {
var stringota = "/ota?file=firmware.bin";
var xhttp = new XMLHttpRequest();
xhttp.onreadystatechange = function() {
if (xhttp.readyState == 4) {
if (xhttp.status == 200) {
document.getElementById("reboot").disabled = false;
alert("Flash successfull - Reboot necessary to make changes active.");
/* keine Reaktion, damit sich das Dokument nicht ändert */
} else if (xhttp.status == 0) {
alert("Server closed the connection abruptly!");
UpdatePage();
} else {
alert(xhttp.status + " Error!\n" + xhttp.responseText);
UpdatePage();
}
}
};
xhttp.open("GET", stringota, true);
xhttp.send();
}
}
function doUpdatehtml() {
if (confirm("Are you sure to update the /html content?")) {
var stringota = "/ota?task=unziphtml";
var xhttp = new XMLHttpRequest();
xhttp.onreadystatechange = function() {
if (xhttp.readyState == 4) {
if (xhttp.status == 200) {
document.getElementById("reboot").disabled = false;
alert("Update /html successful!");
/* keine Reaktion, damit sich das Dokument nicht ändert */
} else if (xhttp.status == 0) {
alert("Server closed the connection abruptly!");
UpdatePage();
} else {
alert(xhttp.status + " Error!\n" + xhttp.responseText);
UpdatePage();
}
}
};
xhttp.open("GET", stringota, true);
xhttp.send();
}
}
function doReboot() {
if (confirm("Are you sure you want to reboot the ESP32?")) {
var stringota = "/reboot";
window.location = stringota;
window.location.href = stringota;
window.location.assign(stringota);
window.location.replace(stringota);
}
}
function setpath() {
var fileserverpraefix = "/firmware/firmware.bin";
document.getElementById("filepath").value = fileserverpraefix;
document.getElementById("upload").disabled = false;
}
function setpathhtml() {
var fileserverpraefix = "/firmware/html.zip";
document.getElementById("filepathhtml").value = fileserverpraefix;
document.getElementById("uploadhtml").disabled = false;
}
function upload() {
var xhttp = new XMLHttpRequest();
/* first delete the old firmware */
xhttp.onreadystatechange = function() {
if (xhttp.readyState == 4) {
if (xhttp.status == 200) {
/* keine Reaktion, damit sich das Dokument nicht ändert */
} else if (xhttp.status == 0) {
alert("Server closed the connection abruptly!");
UpdatePage();
} else {
alert(xhttp.status + " Error!\n" + xhttp.responseText);
UpdatePage();
}
}
};
xhttp.open("GET", "/ota?delete=firmware.bin", false);
xhttp.send();
/* ----------------------------- */
var filePath = document.getElementById("filepath").value;
var upload_path = "/upload/" + filePath;
var fileInput = document.getElementById("newfile").files;
/* Max size of an individual file. Make sure this
* value is same as that set in file_server.c */
var MAX_FILE_SIZE = 2000*1024;
var MAX_FILE_SIZE_STR = "2000KB";
if (fileInput.length == 0) {
alert("No file selected!");
} else if (filePath.length == 0) {
alert("File path on server is not set!");
} else if (filePath.indexOf(' ') >= 0) {
alert("File path on server cannot have spaces!");
} else if (filePath[filePath.length-1] == '/') {
alert("File name not specified after path!");
} else if (fileInput[0].size > 2000*1024) {
alert("File size must be less than 2000KB!");
} else {
document.getElementById("newfile").disabled = true;
document.getElementById("filepath").disabled = true;
document.getElementById("upload").disabled = true;
xhttp.onreadystatechange = function() {
if (xhttp.readyState == 4) {
if (xhttp.status == 200) {
alert("Upload successfull!")
// document.reload();
document.getElementById("reboot").disabled = false;
document.getElementById("doUpdate").disabled = false;
} else if (xhttp.status == 0) {
alert("Server closed the connection abruptly!");
UpdatePage();
} else {
alert(xhttp.status + " Error!\n" + xhttp.responseText);
UpdatePage();
}
}
};
var file = fileInput[0];
xhttp.open("POST", upload_path, true);
xhttp.send(file);
}
}
function uploadhtml() {
var xhttp = new XMLHttpRequest();
/* first delete the old firmware */
xhttp.onreadystatechange = function() {
if (xhttp.readyState == 4) {
if (xhttp.status == 200) {
/* keine Reaktion, damit sich das Dokument nicht ändert */
} else if (xhttp.status == 0) {
alert("Server closed the connection abruptly!");
UpdatePage();
} else {
alert(xhttp.status + " Error!\n" + xhttp.responseText);
UpdatePage();
}
}
};
xhttp.open("GET", "/ota?delete=html.zip", false);
xhttp.send();
/* ----------------------------- */
var filePath = document.getElementById("filepathhtml").value;
var upload_path = "/upload/" + filePath;
var fileInput = document.getElementById("newfilehtml").files;
/* Max size of an individual file. Make sure this
* value is same as that set in file_server.c */
var MAX_FILE_SIZE = 2000*1024;
var MAX_FILE_SIZE_STR = "2000KB";
if (fileInput.length == 0) {
alert("No file selected!");
} else if (filePath.length == 0) {
alert("File path on server is not set!");
} else if (filePath.indexOf(' ') >= 0) {
alert("File path on server cannot have spaces!");
} else if (filePath[filePath.length-1] == '/') {
alert("File name not specified after path!");
} else if (fileInput[0].size > 2000*1024) {
alert("File size must be less than 2000KB!");
} else {
document.getElementById("newfilehtml").disabled = true;
document.getElementById("filepathhtml").disabled = true;
document.getElementById("uploadhtml").disabled = true;
xhttp.onreadystatechange = function() {
if (xhttp.readyState == 4) {
if (xhttp.status == 200) {
alert("Upload successfull!")
// document.reload();
document.getElementById("reboot").disabled = false;
document.getElementById("doUpdatehtml").disabled = false;
} else if (xhttp.status == 0) {
alert("Server closed the connection abruptly!");
UpdatePage();
} else {
alert(xhttp.status + " Error!\n" + xhttp.responseText);
UpdatePage();
}
}
};
var file = fileInput[0];
xhttp.open("POST", upload_path, true);
xhttp.send(file);
}
}
init();
</script>
</body></html>

View File

@@ -10,6 +10,38 @@ var ref = new Array(2);
var NUMBERS = new Array(0);
var REFERENCES = new Array(0);
function getTFLITEList() {
_basepath = getbasepath();
tflitelist = "";
var xhttp = new XMLHttpRequest();
xhttp.addEventListener('load', function(event) {
if (xhttp.status >= 200 && xhttp.status < 300) {
tflitelist = xhttp.responseText;
} else {
console.warn(request.statusText, request.responseText);
}
});
try {
url = _basepath + '/editflow.html?task=tflite';
xhttp.open("GET", url, false);
xhttp.send();
}
catch (error)
{
// alert("Loading Hostname failed");
}
tflitelist = tflitelist.split("\t");
tflitelist.pop();
return tflitelist;
}
function ParseConfig() {
config_split = config_gesamt.split("\n");
var aktline = 0;
@@ -28,6 +60,7 @@ function ParseConfig() {
ParamAddValue(param, catname, "Brightness");
ParamAddValue(param, catname, "Contrast");
ParamAddValue(param, catname, "Saturation");
ParamAddValue(param, catname, "LEDIntensity");
ParamAddValue(param, catname, "ImageQuality");
ParamAddValue(param, catname, "ImageSize");
ParamAddValue(param, catname, "FixedExposure");
@@ -74,6 +107,7 @@ function ParseConfig() {
ParamAddValue(param, catname, "PreValueAgeStartup");
ParamAddValue(param, catname, "AllowNegativeRates");
ParamAddValue(param, catname, "MaxRateValue", 1, true);
ParamAddValue(param, catname, "MaxRateType", 1, true);
ParamAddValue(param, catname, "ExtendedResolution", 1, true);
ParamAddValue(param, catname, "IgnoreLeadingNaN", 1, true);
ParamAddValue(param, catname, "ErrorMessage");

View File

@@ -1 +1 @@
11.4.1
13.1.0