Compare commits
12 Commits
web
...
ae9860aec7
| Author | SHA1 | Date | |
|---|---|---|---|
| ae9860aec7 | |||
| 724fda0889 | |||
| 1cfde391c1 | |||
| 79766040ca | |||
| 81e5f0209f | |||
| ab7d74a3f5 | |||
| eaa3604b23 | |||
| b18da6ed34 | |||
| c4eb5ff35d | |||
| 6699e2e6bf | |||
| 1fa8b9382d | |||
| 25cd8e5364 |
4
.gitignore
vendored
4
.gitignore
vendored
@@ -1,6 +1,4 @@
|
||||
build
|
||||
.vscode
|
||||
.DS_Store
|
||||
build
|
||||
sdkconfig.old
|
||||
desktop.ini
|
||||
.PVS-Studio
|
||||
7
.gitmodules
vendored
7
.gitmodules
vendored
@@ -1,9 +1,6 @@
|
||||
[submodule "components/zh_pcf8574"]
|
||||
path = components/zh_pcf8574
|
||||
url = http://git.zh.com.ru/esp_components/zh_pcf8574
|
||||
url = http://git.zh.com.ru/alexey.zholtikov/zh_pcf8574
|
||||
[submodule "components/zh_vector"]
|
||||
path = components/zh_vector
|
||||
url = http://git.zh.com.ru/esp_components/zh_vector
|
||||
[submodule "components/zh_ota_server"]
|
||||
path = components/zh_ota_server
|
||||
url = http://git.zh.com.ru/esp_components/zh_ota_server
|
||||
url = http://git.zh.com.ru/alexey.zholtikov/zh_vector
|
||||
|
||||
0
CMakeLists.txt
Normal file → Executable file
0
CMakeLists.txt
Normal file → Executable file
22
README.md
22
README.md
@@ -1,21 +1,3 @@
|
||||
# Honeywell Retractable Landing Light CMM 33-42-07 P/N 45-0351-X Motor Test Box
|
||||
# ate0004.000.000
|
||||
|
||||
## Tested on
|
||||
|
||||
1. [ESP32 ESP-IDF v5.5.1](https://docs.espressif.com/projects/esp-idf/en/v5.5.1/esp32/index.html)
|
||||
|
||||
## SAST Tools
|
||||
|
||||
[PVS-Studio](https://pvs-studio.com/pvs-studio/?utm_source=website&utm_medium=github&utm_campaign=open_source) - static analyzer for C, C++, C#, and Java code.
|
||||
|
||||
## Build and flash
|
||||
|
||||
Run the following command to firmware build and flash module:
|
||||
|
||||
```text
|
||||
cd your_projects_folder
|
||||
git clone --recurse-submodules http://git.zh.com.ru/aerotech/ate0004
|
||||
cd ate0004
|
||||
idf.py build
|
||||
idf.py flash
|
||||
```
|
||||
Honeywell Retractable Landing Light CMM 33-42-07 P/N 45-0351-X Motor Test Box.
|
||||
Binary file not shown.
Binary file not shown.
BIN
cad/ATE0004.000.001 _ Низ.stl
Normal file
BIN
cad/ATE0004.000.001 _ Низ.stl
Normal file
Binary file not shown.
BIN
cad/ATE0004.000.002 _ Перед.cdw
Normal file
BIN
cad/ATE0004.000.002 _ Перед.cdw
Normal file
Binary file not shown.
Binary file not shown.
BIN
cad/ATE0004.000.002 _ Перед.pdf
Normal file
BIN
cad/ATE0004.000.002 _ Перед.pdf
Normal file
Binary file not shown.
BIN
cad/ATE0004.000.002 _ Перед.stl
Normal file
BIN
cad/ATE0004.000.002 _ Перед.stl
Normal file
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Submodule components/zh_ota_server deleted from c61e1eec45
Submodule components/zh_pcf8574 updated: de9ece9c0d...c9365e40ba
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
BIN
ds/ADP3338.pdf
Normal file
BIN
ds/ADP3338.pdf
Normal file
Binary file not shown.
BIN
ds/ESP32-WROOM-32E.pdf
Normal file
BIN
ds/ESP32-WROOM-32E.pdf
Normal file
Binary file not shown.
BIN
ds/PCA9306.pdf
Normal file
BIN
ds/PCA9306.pdf
Normal file
Binary file not shown.
BIN
ds/T491.pdf
Normal file
BIN
ds/T491.pdf
Normal file
Binary file not shown.
BIN
html/favicon.ico
BIN
html/favicon.ico
Binary file not shown.
|
Before Width: | Height: | Size: 6.3 KiB |
@@ -1,93 +0,0 @@
|
||||
<!DOCTYPE html>
|
||||
<html>
|
||||
|
||||
<head>
|
||||
<meta charset="utf-8">
|
||||
<meta http-equiv="X-UA-Compatible" content="IE=edge">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1">
|
||||
<title>be1.ru</title>
|
||||
<link rel="stylesheet" href="index_style.css">
|
||||
<link rel="icon" href="favicon.ico" />
|
||||
<script src="index_script.js"></script>
|
||||
</head>
|
||||
|
||||
<body>
|
||||
<input type="checkbox" id="nav-toggle" hidden>
|
||||
<nav class="nav">
|
||||
<label for="nav-toggle" class="nav-toggle" onclick></label>
|
||||
<!-- <h2 class="logo"> -->
|
||||
<p style="text-align:center"> ATE0004
|
||||
<!-- </h2> -->
|
||||
<ul>
|
||||
<li><a href="#1">About</a>
|
||||
<li><a href="#2">Statistics</a>
|
||||
<li><a href="#3">Update</a>
|
||||
<li><a href="#3">Manual</a>
|
||||
<!-- <li><a href="#4">Четыре</a>
|
||||
<li><a href="#5">Пять</a>
|
||||
<li><a href="#6">Шесть</a>
|
||||
<li><a href="#7">Семь</a> -->
|
||||
</ul>
|
||||
</nav>
|
||||
|
||||
<!-- Маска (затемнение) основного контента при включенной панели
|
||||
по-умолчанию данная фишка не используется, если оно вам надо,
|
||||
просто расккоментируйте div-контейнер ниже -->
|
||||
|
||||
<div class="mask-content"></div>
|
||||
|
||||
<p class="aligncenter"><img alt="logo" src="logo.png" style="height:120px; width:300px" /></p>
|
||||
<p style="text-align:center"><span style="font-size:24px">ATE0004</span></p>
|
||||
<p style="text-align:center">Honeywell Retractable Landing Light CMM 33-42-07 P/N 45-0351-X Motor Test Box by
|
||||
@rick_professor</p>
|
||||
|
||||
</div>
|
||||
<div class="content">
|
||||
<div class="card">
|
||||
<h2>ONBOARD LED GPIO2</h2>
|
||||
<p style="text-align:center" class="no-select"> <button id="button" class="button">Toggle LED</button></p>
|
||||
<p class="state">State: <span id="state">%s</span></p>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<main role="main">
|
||||
<div class="content">
|
||||
<div class="card">
|
||||
<!-- <h2>ONBOARD LED GPIO2</h2> -->
|
||||
<p style="text-align:center" class="no-select"> <button id="button" class="button">Thermostat</button>
|
||||
<p style="text-align:center" class="no-select"> <button id="button" class="button">Retract</button>
|
||||
<p style="text-align:center" class="no-select"> <button id="button" class="button">Extend</button>
|
||||
<!-- </p> -->
|
||||
<!-- <p class="state">State: <span id="state">%s</span></p> -->
|
||||
</div>
|
||||
</div>
|
||||
<!-- <article>
|
||||
<header>
|
||||
<h1 class="header__title">Просто Демо:</h1>
|
||||
<h2>Выдвигающееся боковое меню на чистом CSS</h2>
|
||||
</header>
|
||||
<section>
|
||||
<p style="text-align: center;">
|
||||
<a href="index.html" class="btn btn-primary">Меню Слева</a>
|
||||
<a href="right-slide-panel.html" class="btn btn-secondary">Меню Справа</a>
|
||||
<p>Нажмите на "гамбургер-иконку" в левом или правом верхнем углу, в зависимости от выбранного вами
|
||||
варианта, и вы увидите выдвигающуюся боковую панель в действии. Чаще всего в таких панельках
|
||||
размещают меню навигации по сайту, что собственно мы и сделали. Вы же можете использовать боковую
|
||||
панель, для любого другого элемента, который по вашему разумению, должен быть изначально скрыт,
|
||||
например, форму подписки, блок кнопок социальных сетей, и т.д. и т.п...
|
||||
<p>Работа данного меню построена на чистом CSS, без подключения javascript. Переключение осуществляется
|
||||
с помощью скрытого флажка (checkbox) с использованием псевдокласса :checked из обоймы CSS3</p>
|
||||
<p>С переклюателем панели особо не стал заморачиваться и использовал символ Unicode 'TRIGRAM FOR HEAVEN'
|
||||
(U+2630), с простейшей заменой символа на 'Знак Умножения' (U+2715), когда панель раскрыта. Вам
|
||||
ничего не мешает испльзовать любой другой значок, иконку или просто текст.
|
||||
</section>
|
||||
<hr>
|
||||
<footer>
|
||||
<p><a href="http://dbmast.ru/vydvigayushheesya-bokovoe-menyu-na-chistom-css">← Изучить Детали</a>
|
||||
<p>сделано с любовью - <a href="https://twitter.com/dobrovoi">@dobrovoi</a>
|
||||
</footer>
|
||||
</article> -->
|
||||
</main>
|
||||
</body>
|
||||
|
||||
</html>
|
||||
@@ -1,40 +0,0 @@
|
||||
var gateway = `ws://${window.location.hostname}/ws`;
|
||||
var websocket;
|
||||
window.addEventListener('load', onLoad);
|
||||
function initWebSocket() {
|
||||
console.log('Trying to open a WebSocket connection...');
|
||||
websocket = new WebSocket(gateway);
|
||||
websocket.onopen = onOpen;
|
||||
websocket.onclose = onClose;
|
||||
websocket.onmessage = onMessage; // <-- add this line
|
||||
}
|
||||
function onOpen(event) {
|
||||
console.log('Connection opened');
|
||||
}
|
||||
function onClose(event) {
|
||||
console.log('Connection closed');
|
||||
setTimeout(initWebSocket, 2000);
|
||||
}
|
||||
function onMessage(event) {
|
||||
var state;
|
||||
console.log(event.data);
|
||||
if (event.data == "1") {
|
||||
state = "ON";
|
||||
}
|
||||
else {
|
||||
state = "OFF";
|
||||
}
|
||||
document.getElementById('state').innerHTML = state;
|
||||
}
|
||||
function onLoad(event) {
|
||||
initWebSocket();
|
||||
initButton();
|
||||
}
|
||||
|
||||
function initButton() {
|
||||
document.getElementById('button').addEventListener('click', toggle);
|
||||
}
|
||||
function toggle() {
|
||||
console.log('Click');
|
||||
websocket.send('toggle');
|
||||
}
|
||||
@@ -1,456 +0,0 @@
|
||||
.aligncenter {
|
||||
text-align: center;
|
||||
}
|
||||
|
||||
* {
|
||||
box-sizing: border-box;
|
||||
}
|
||||
|
||||
body {
|
||||
/* max-width: 320px; */
|
||||
/* background: #bcc5c3; */
|
||||
background: #16a085;
|
||||
/* Максимальная ширина страницы в пикселах */
|
||||
}
|
||||
|
||||
.no-select {
|
||||
-webkit-touch-callout: none;
|
||||
-moz-user-select: none;
|
||||
-o-user-select: none;
|
||||
-khtml-user-select: none;
|
||||
-webkit-user-select: none;
|
||||
-ms-user-select: none;
|
||||
user-select: none;
|
||||
}
|
||||
|
||||
.button {
|
||||
width: 250px;
|
||||
height: 70px;
|
||||
padding: 15px 50px;
|
||||
font-size: 24px;
|
||||
text-align: center;
|
||||
outline: 1px solid #666;
|
||||
color: #fff;
|
||||
background-color: #0ffa6d;
|
||||
border: #0ffa6d;
|
||||
border-radius: 5px;
|
||||
-webkit-touch-callout: none;
|
||||
-webkit-user-select: none;
|
||||
-khtml-user-select: none;
|
||||
-moz-user-select: none;
|
||||
-ms-user-select: none;
|
||||
user-select: none;
|
||||
-webkit-tap-highlight-color: rgba(0, 0, 0, 0);
|
||||
}
|
||||
|
||||
.button:active {
|
||||
background-color: #fa0f0f;
|
||||
transform: translateY(2px);
|
||||
}
|
||||
|
||||
.nav {
|
||||
/* ширна произвольная, не стесняйтесь экспериментировать */
|
||||
width: 320px;
|
||||
min-width: 320px;
|
||||
/* фиксируем и выставляем высоту панели на максимум */
|
||||
height: 100%;
|
||||
position: fixed;
|
||||
top: 0;
|
||||
bottom: 0;
|
||||
margin: 0;
|
||||
/* сдвигаем (прячем) панель относительно левого края страницы */
|
||||
left: -320px;
|
||||
/* внутренние отступы */
|
||||
padding: 15px 20px;
|
||||
/* плавный переход смещения панели */
|
||||
-webkit-transition: left 0.3s;
|
||||
-moz-transition: left 0.3s;
|
||||
transition: left 0.3s;
|
||||
/* определяем цвет фона панели */
|
||||
background: #16a085;
|
||||
/* background: #bcc5c3; */
|
||||
/* поверх других элементов */
|
||||
z-index: 2000;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Кнопка переключения панели
|
||||
* тег <label>
|
||||
*/
|
||||
|
||||
.nav-toggle {
|
||||
/* абсолютно позиционируем */
|
||||
position: absolute;
|
||||
/* относительно левого края панели */
|
||||
left: 320px;
|
||||
/* отступ от верхнего края панели */
|
||||
top: 1em;
|
||||
/* внутренние отступы */
|
||||
padding: 0.5em;
|
||||
/* определяем цвет фона переключателя
|
||||
* чаще вчего в соответствии с цветом фона панели
|
||||
*/
|
||||
background: inherit;
|
||||
/* цвет текста */
|
||||
color: #dadada;
|
||||
/* вид курсора */
|
||||
cursor: pointer;
|
||||
/* размер шрифта */
|
||||
font-size: 1.2em;
|
||||
line-height: 1;
|
||||
/* всегда поверх других элементов страницы */
|
||||
z-index: 2001;
|
||||
/* анимируем цвет текста при наведении */
|
||||
-webkit-transition: color .25s ease-in-out;
|
||||
-moz-transition: color .25s ease-in-out;
|
||||
transition: color .25s ease-in-out;
|
||||
}
|
||||
|
||||
|
||||
/* определяем текст кнопки
|
||||
* символ Unicode (TRIGRAM FOR HEAVEN)
|
||||
*/
|
||||
|
||||
.nav-toggle:after {
|
||||
content: '\2630';
|
||||
text-decoration: none;
|
||||
}
|
||||
|
||||
|
||||
/* цвет текста при наведении */
|
||||
|
||||
.nav-toggle:hover {
|
||||
color: #f4f4f4;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Скрытый чекбокс (флажок)
|
||||
* невидим и недоступен :)
|
||||
* имя селектора атрибут флажка
|
||||
*/
|
||||
|
||||
[id='nav-toggle'] {
|
||||
position: absolute;
|
||||
display: none;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* изменение положения переключателя
|
||||
* при просмотре на мобильных устройствах
|
||||
* когда навигация раскрыта, распологаем внутри панели
|
||||
*/
|
||||
|
||||
[id='nav-toggle']:checked~.nav>.nav-toggle {
|
||||
left: auto;
|
||||
right: 2px;
|
||||
top: 1em;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Когда флажок установлен, открывается панель
|
||||
* используем псевдокласс:checked
|
||||
*/
|
||||
|
||||
[id='nav-toggle']:checked~.nav {
|
||||
left: 0;
|
||||
box-shadow: 4px 0px 20px 0px rgba(0, 0, 0, 0.5);
|
||||
-moz-box-shadow: 4px 0px 20px 0px rgba(0, 0, 0, 0.5);
|
||||
-webkit-box-shadow: 4px 0px 20px 0px rgba(0, 0, 0, 0.5);
|
||||
overflow-y: auto;
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
* смещение контента страницы
|
||||
* на размер ширины панели,
|
||||
* фишка необязательная, на любителя
|
||||
*/
|
||||
|
||||
[id='nav-toggle']:checked~main>article {
|
||||
-webkit-transform: translateX(320px);
|
||||
-moz-transform: translateX(320px);
|
||||
transform: translateX(320px);
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
* изменение символа переключателя,
|
||||
* привычный крестик (MULTIPLICATION X),
|
||||
* вы можете испльзовать любой другой значок
|
||||
*/
|
||||
|
||||
[id='nav-toggle']:checked~.nav>.nav-toggle:after {
|
||||
content: '\2715';
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* профиксим баг в Android <= 4.1.2
|
||||
* см: http://timpietrusky.com/advanced-checkbox-hack
|
||||
*/
|
||||
|
||||
/* body {
|
||||
-webkit-animation: bugfix infinite 1s;
|
||||
}
|
||||
|
||||
@-webkit-keyframes bugfix {
|
||||
to {
|
||||
padding: 0;
|
||||
}
|
||||
} */
|
||||
|
||||
|
||||
/**
|
||||
* позаботьтимся о средних и маленьких экранах
|
||||
* мобильных устройств
|
||||
*/
|
||||
|
||||
@media screen and (min-width: 320px) {
|
||||
|
||||
html,
|
||||
body {
|
||||
margin: 0;
|
||||
overflow-x: hidden;
|
||||
}
|
||||
}
|
||||
|
||||
@media screen and (max-width: 320px) {
|
||||
|
||||
html,
|
||||
body {
|
||||
margin: 0;
|
||||
overflow-x: hidden;
|
||||
}
|
||||
|
||||
.nav {
|
||||
width: 100%;
|
||||
box-shadow: none
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Формируем стиль заголовка (логотип) панели
|
||||
*/
|
||||
|
||||
.nav h2 {
|
||||
width: 90%;
|
||||
padding: 0;
|
||||
margin: 10px 0;
|
||||
text-align: center;
|
||||
text-shadow: rgba(255, 255, 255, .1) -1px -1px 1px, rgba(0, 0, 0, .5) 1px 1px 1px;
|
||||
font-size: 1.3em;
|
||||
line-height: 1.3em;
|
||||
opacity: 0;
|
||||
transform: scale(0.1, 0.1);
|
||||
-ms-transform: scale(0.1, 0.1);
|
||||
-moz-transform: scale(0.1, 0.1);
|
||||
-webkit-transform: scale(0.1, 0.1);
|
||||
transform-origin: 0% 0%;
|
||||
-ms-transform-origin: 0% 0%;
|
||||
-moz-transform-origin: 0% 0%;
|
||||
-webkit-transform-origin: 0% 0%;
|
||||
transition: opacity 0.8s, transform 0.8s;
|
||||
-ms-transition: opacity 0.8s, -ms-transform 0.8s;
|
||||
-moz-transition: opacity 0.8s, -moz-transform 0.8s;
|
||||
-webkit-transition: opacity 0.8s, -webkit-transform 0.8s;
|
||||
}
|
||||
|
||||
.nav h2 a {
|
||||
color: #dadada;
|
||||
text-decoration: none;
|
||||
text-transform: uppercase;
|
||||
}
|
||||
|
||||
|
||||
/*плавное появление заголовка (логотипа) при раскрытии панели */
|
||||
|
||||
[id='nav-toggle']:checked~.nav h2 {
|
||||
opacity: 1;
|
||||
transform: scale(1, 1);
|
||||
-ms-transform: scale(1, 1);
|
||||
-moz-transform: scale(1, 1);
|
||||
-webkit-transform: scale(1, 1);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* формируем непосредственно само меню
|
||||
* используем неупорядоченный список для пунктов меню
|
||||
* прикрутим трансфомации и плавные переходы
|
||||
*/
|
||||
|
||||
.nav>ul {
|
||||
display: block;
|
||||
margin: 0;
|
||||
padding: 0;
|
||||
list-style: none;
|
||||
}
|
||||
|
||||
.nav>ul>li {
|
||||
line-height: 2.5;
|
||||
opacity: 0;
|
||||
-webkit-transform: translateX(-50%);
|
||||
-moz-transform: translateX(-50%);
|
||||
-ms-transform: translateX(-50%);
|
||||
transform: translateX(-50%);
|
||||
-webkit-transition: opacity .5s .1s, -webkit-transform .5s .1s;
|
||||
-moz-transition: opacity .5s .1s, -moz-transform .5s .1s;
|
||||
-ms-transition: opacity .5s .1s, -ms-transform .5s .1s;
|
||||
transition: opacity .5s .1s, transform .5s .1s;
|
||||
}
|
||||
|
||||
[id='nav-toggle']:checked~.nav>ul>li {
|
||||
opacity: 1;
|
||||
-webkit-transform: translateX(0);
|
||||
-moz-transform: translateX(0);
|
||||
-ms-transform: translateX(0);
|
||||
transform: translateX(0);
|
||||
}
|
||||
|
||||
|
||||
/* определяем интервалы появления пунктов меню */
|
||||
|
||||
.nav>ul>li:nth-child(2) {
|
||||
-webkit-transition: opacity .5s .2s, -webkit-transform .5s .2s;
|
||||
transition: opacity .5s .2s, transform .5s .2s;
|
||||
}
|
||||
|
||||
.nav>ul>li:nth-child(3) {
|
||||
-webkit-transition: opacity .5s .3s, -webkit-transform .5s .3s;
|
||||
transition: opacity .5s .3s, transform .5s .3s;
|
||||
}
|
||||
|
||||
.nav>ul>li:nth-child(4) {
|
||||
-webkit-transition: opacity .5s .4s, -webkit-transform .5s .4s;
|
||||
transition: opacity .5s .4s, transform .5s .4s;
|
||||
}
|
||||
|
||||
.nav>ul>li:nth-child(5) {
|
||||
-webkit-transition: opacity .5s .5s, -webkit-transform .5s .5s;
|
||||
transition: opacity .5s .5s, transform .5s .5s;
|
||||
}
|
||||
|
||||
.nav>ul>li:nth-child(6) {
|
||||
-webkit-transition: opacity .5s .6s, -webkit-transform .5s .6s;
|
||||
transition: opacity .5s .6s, transform .5s .6s;
|
||||
}
|
||||
|
||||
.nav>ul>li:nth-child(7) {
|
||||
-webkit-transition: opacity .5s .7s, -webkit-transform .5s .7s;
|
||||
transition: opacity .5s .7s, transform .5s .7s;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* оформление ссылок пунктов меню
|
||||
*/
|
||||
|
||||
.nav>ul>li>a {
|
||||
display: inline-block;
|
||||
position: relative;
|
||||
padding: 0;
|
||||
font-family: 'Open Sans', sans-serif;
|
||||
font-weight: 300;
|
||||
font-size: 1.2em;
|
||||
color: #dadada;
|
||||
width: 100%;
|
||||
text-decoration: none;
|
||||
/* плавный переход */
|
||||
-webkit-transition: color .5s ease, padding .5s ease;
|
||||
-moz-transition: color .5s ease, padding .5s ease;
|
||||
transition: color .5s ease, padding .5s ease;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* состояние ссылок меню при наведении
|
||||
*/
|
||||
|
||||
.nav>ul>li>a:hover,
|
||||
.nav>ul>li>a:focus {
|
||||
color: white;
|
||||
padding-left: 15px;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* линия подчеркивания ссылок меню
|
||||
*/
|
||||
|
||||
.nav>ul>li>a:before {
|
||||
content: '';
|
||||
display: block;
|
||||
position: absolute;
|
||||
right: 0;
|
||||
bottom: 0;
|
||||
height: 1px;
|
||||
width: 100%;
|
||||
-webkit-transition: width 0s ease;
|
||||
transition: width 0s ease;
|
||||
}
|
||||
|
||||
.nav>ul>li>a:after {
|
||||
content: '';
|
||||
display: block;
|
||||
position: absolute;
|
||||
left: 0;
|
||||
bottom: 0;
|
||||
height: 1px;
|
||||
width: 100%;
|
||||
background: #3bc1a0;
|
||||
-webkit-transition: width .5s ease;
|
||||
transition: width .5s ease;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* анимируем линию подчеркивания
|
||||
* ссылок при наведении
|
||||
*/
|
||||
|
||||
.nav>ul>li>a:hover:before {
|
||||
width: 0%;
|
||||
/* background: #3bc1a0; */
|
||||
-webkit-transition: width .5s ease;
|
||||
transition: width .5s ease;
|
||||
}
|
||||
|
||||
.nav>ul>li>a:hover:after {
|
||||
width: 0%;
|
||||
background: transparent;
|
||||
-webkit-transition: width 0s ease;
|
||||
transition: width 0s ease;
|
||||
}
|
||||
|
||||
|
||||
/* фон затемнения на основной контент
|
||||
* при этом элементы блокируютя
|
||||
* спорная такая фича, если оно вам надо
|
||||
* просто раскомментируйте
|
||||
*/
|
||||
|
||||
|
||||
.mask-content {
|
||||
display: block;
|
||||
position: fixed;
|
||||
top: 0;
|
||||
left: 0;
|
||||
z-index: 1000;
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
background-color: rgba(0, 0, 0, 0.4);
|
||||
visibility: hidden;
|
||||
opacity: 0;
|
||||
}
|
||||
|
||||
[id='nav-toggle']:checked~.mask-content {
|
||||
visibility: visible;
|
||||
opacity: 1;
|
||||
-webkit-transition: opacity .5s, visibility .5s;
|
||||
transition: opacity .5s, visibility .5s;
|
||||
}
|
||||
BIN
html/logo.png
BIN
html/logo.png
Binary file not shown.
|
Before Width: | Height: | Size: 95 KiB |
6
main/CMakeLists.txt
Normal file → Executable file
6
main/CMakeLists.txt
Normal file → Executable file
@@ -1,5 +1 @@
|
||||
idf_component_register(SRCS "web_server.c" "ate0004.c" INCLUDE_DIRS "" REQUIRES zh_pcf8574 esp_wifi nvs_flash zh_ota_server EMBED_FILES "../html/index/index.html"
|
||||
"../html/index/index_style.css"
|
||||
"../html/index/index_script.js"
|
||||
"../html/favicon.ico"
|
||||
"../html/logo.png")
|
||||
idf_component_register(SRCS "main.c" INCLUDE_DIRS "" REQUIRES zh_pcf8574)
|
||||
176
main/ate0004.c
176
main/ate0004.c
@@ -1,176 +0,0 @@
|
||||
#include "ate0004.h"
|
||||
|
||||
static i2c_master_bus_handle_t _i2c_bus_handle = NULL;
|
||||
// static httpd_handle_t _webserver_handle = NULL;
|
||||
|
||||
static zh_pcf8574_handle_t _button_handle = {0};
|
||||
static zh_pcf8574_handle_t _led_handle = {0};
|
||||
static zh_pcf8574_handle_t _relay_handle = {0};
|
||||
|
||||
static bool _is_ts_enabled = true;
|
||||
static bool _is_ret_enabled = false;
|
||||
static bool _is_ext_enabled = false;
|
||||
|
||||
static void _zh_wifi_softap_init(void);
|
||||
static void _zh_gpio_init(void);
|
||||
static void _zh_pcf8574_init(void);
|
||||
static void _zh_pcf8574_event_handler(void *arg, esp_event_base_t event_base, int32_t event_id, void *event_data);
|
||||
|
||||
extern void _zh_webserver_init(void);
|
||||
|
||||
void app_main(void)
|
||||
{
|
||||
nvs_flash_init();
|
||||
esp_event_loop_create_default();
|
||||
_zh_wifi_softap_init();
|
||||
_zh_webserver_init();
|
||||
_zh_gpio_init();
|
||||
gpio_set_level(TRIAC_GPIO, LOW);
|
||||
_zh_pcf8574_init();
|
||||
zh_pcf8574_write_gpio(&_led_handle, TS_LED_GREEN, LED_ON);
|
||||
zh_pcf8574_write_gpio(&_led_handle, RET_LED_BLUE, LED_ON);
|
||||
zh_pcf8574_write_gpio(&_led_handle, EXT_LED_BLUE, LED_ON);
|
||||
}
|
||||
|
||||
static void _zh_wifi_softap_init(void)
|
||||
{
|
||||
esp_netif_init();
|
||||
esp_netif_create_default_wifi_ap();
|
||||
wifi_init_config_t wifi_config = WIFI_INIT_CONFIG_DEFAULT();
|
||||
esp_wifi_init(&wifi_config);
|
||||
wifi_config_t ap_config = {
|
||||
.ap = {
|
||||
.ssid = WIFI_SSID,
|
||||
.password = WIFI_PASS,
|
||||
.max_connection = MAX_STA_CONNECTION,
|
||||
.authmode = WIFI_AUTH_WPA2_PSK,
|
||||
},
|
||||
};
|
||||
esp_wifi_set_mode(WIFI_MODE_AP);
|
||||
esp_wifi_set_config(WIFI_IF_AP, &ap_config);
|
||||
esp_wifi_start();
|
||||
}
|
||||
|
||||
// static void _zh_webserver_init(void)
|
||||
// {
|
||||
// httpd_config_t config = HTTPD_DEFAULT_CONFIG();
|
||||
// httpd_start(&_webserver_handle, &config);
|
||||
// zh_ota_server_init(_webserver_handle);
|
||||
// }
|
||||
|
||||
static void _zh_gpio_init(void)
|
||||
{
|
||||
gpio_config_t triac_pin_config = {
|
||||
.intr_type = GPIO_INTR_DISABLE,
|
||||
.mode = GPIO_MODE_OUTPUT,
|
||||
.pin_bit_mask = (1ULL << TRIAC_GPIO),
|
||||
.pull_down_en = GPIO_PULLDOWN_DISABLE,
|
||||
.pull_up_en = GPIO_PULLUP_DISABLE,
|
||||
};
|
||||
gpio_config(&triac_pin_config);
|
||||
}
|
||||
|
||||
static void _zh_pcf8574_init(void)
|
||||
{
|
||||
i2c_master_bus_config_t i2c_bus_config = {
|
||||
.clk_source = I2C_CLK_SRC_DEFAULT,
|
||||
.scl_io_num = GPIO_NUM_22,
|
||||
.sda_io_num = GPIO_NUM_21,
|
||||
.glitch_ignore_cnt = 7,
|
||||
};
|
||||
i2c_new_master_bus(&i2c_bus_config, &_i2c_bus_handle);
|
||||
esp_event_handler_instance_register(ZH_PCF8574, ESP_EVENT_ANY_ID, &_zh_pcf8574_event_handler, NULL, NULL);
|
||||
zh_pcf8574_init_config_t config = ZH_PCF8574_INIT_CONFIG_DEFAULT();
|
||||
config.i2c_handle = _i2c_bus_handle;
|
||||
config.i2c_address = LED_I2C_ADDRESS;
|
||||
zh_pcf8574_init(&config, &_led_handle);
|
||||
config.i2c_address = RELAY_I2C_ADDRESS;
|
||||
zh_pcf8574_init(&config, &_relay_handle);
|
||||
config.i2c_address = BUTTON_I2C_ADDRESS;
|
||||
config.p0_gpio_work_mode = true;
|
||||
config.p1_gpio_work_mode = true;
|
||||
config.p2_gpio_work_mode = true;
|
||||
config.interrupt_gpio = GPIO_NUM_17;
|
||||
zh_pcf8574_init(&config, &_button_handle);
|
||||
}
|
||||
|
||||
static void _zh_pcf8574_event_handler(void *arg, esp_event_base_t event_base, int32_t event_id, void *event_data)
|
||||
{
|
||||
zh_pcf8574_event_on_isr_t *event = event_data;
|
||||
switch (event->gpio_number)
|
||||
{
|
||||
case TS_BUTTON:
|
||||
if (event->gpio_level == LOW && _is_ret_enabled == false && _is_ext_enabled == false)
|
||||
{
|
||||
if (_is_ts_enabled == true)
|
||||
{
|
||||
zh_pcf8574_write_gpio(&_led_handle, TS_LED_RED, LED_ON);
|
||||
zh_pcf8574_write_gpio(&_led_handle, TS_LED_GREEN, LED_OFF);
|
||||
zh_pcf8574_write_gpio(&_relay_handle, TS_RELAY, RELAY_ON);
|
||||
_is_ts_enabled = false;
|
||||
}
|
||||
else
|
||||
{
|
||||
zh_pcf8574_write_gpio(&_led_handle, TS_LED_RED, LED_OFF);
|
||||
zh_pcf8574_write_gpio(&_led_handle, TS_LED_GREEN, LED_ON);
|
||||
zh_pcf8574_write_gpio(&_relay_handle, TS_RELAY, RELAY_OFF);
|
||||
_is_ts_enabled = true;
|
||||
}
|
||||
}
|
||||
break;
|
||||
case RET_BUTTON:
|
||||
if (_is_ext_enabled == true)
|
||||
{
|
||||
break;
|
||||
}
|
||||
if (event->gpio_level == LOW)
|
||||
{
|
||||
_is_ret_enabled = true;
|
||||
zh_pcf8574_write_gpio(&_led_handle, RET_LED_BLUE, LED_OFF);
|
||||
zh_pcf8574_write_gpio(&_led_handle, RET_LED_GREEN, LED_ON);
|
||||
zh_pcf8574_write_gpio(&_relay_handle, RET_RELAY, RELAY_ON);
|
||||
zh_pcf8574_write_gpio(&_relay_handle, GROUND_RELAY, RELAY_ON);
|
||||
vTaskDelay(20 / portTICK_PERIOD_MS);
|
||||
gpio_set_level(TRIAC_GPIO, HIGH);
|
||||
}
|
||||
else
|
||||
{
|
||||
gpio_set_level(TRIAC_GPIO, LOW);
|
||||
vTaskDelay(5 / portTICK_PERIOD_MS);
|
||||
zh_pcf8574_write_gpio(&_led_handle, RET_LED_BLUE, LED_ON);
|
||||
zh_pcf8574_write_gpio(&_led_handle, RET_LED_GREEN, LED_OFF);
|
||||
zh_pcf8574_write_gpio(&_relay_handle, RET_RELAY, RELAY_OFF);
|
||||
zh_pcf8574_write_gpio(&_relay_handle, GROUND_RELAY, RELAY_OFF);
|
||||
_is_ret_enabled = false;
|
||||
}
|
||||
break;
|
||||
case EXT_BUTTON:
|
||||
if (_is_ret_enabled == true)
|
||||
{
|
||||
break;
|
||||
}
|
||||
if (event->gpio_level == LOW)
|
||||
{
|
||||
_is_ext_enabled = true;
|
||||
zh_pcf8574_write_gpio(&_led_handle, EXT_LED_BLUE, LED_OFF);
|
||||
zh_pcf8574_write_gpio(&_led_handle, EXT_LED_GREEN, LED_ON);
|
||||
zh_pcf8574_write_gpio(&_relay_handle, EXT_RELAY, RELAY_ON);
|
||||
zh_pcf8574_write_gpio(&_relay_handle, GROUND_RELAY, RELAY_ON);
|
||||
vTaskDelay(20 / portTICK_PERIOD_MS);
|
||||
gpio_set_level(TRIAC_GPIO, HIGH);
|
||||
}
|
||||
else
|
||||
{
|
||||
gpio_set_level(TRIAC_GPIO, LOW);
|
||||
vTaskDelay(5 / portTICK_PERIOD_MS);
|
||||
zh_pcf8574_write_gpio(&_led_handle, EXT_LED_BLUE, LED_ON);
|
||||
zh_pcf8574_write_gpio(&_led_handle, EXT_LED_GREEN, LED_OFF);
|
||||
zh_pcf8574_write_gpio(&_relay_handle, EXT_RELAY, RELAY_OFF);
|
||||
zh_pcf8574_write_gpio(&_relay_handle, GROUND_RELAY, RELAY_OFF);
|
||||
_is_ext_enabled = false;
|
||||
}
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
}
|
||||
@@ -1,55 +0,0 @@
|
||||
/**
|
||||
* @file ate0004.h
|
||||
*/
|
||||
|
||||
#pragma once
|
||||
|
||||
#include "zh_pcf8574.h"
|
||||
#include "nvs_flash.h"
|
||||
#include "esp_wifi.h"
|
||||
#include "zh_ota_server.h"
|
||||
|
||||
#define HIGH true
|
||||
#define LOW false
|
||||
|
||||
#define LED_OFF LOW
|
||||
#define LED_ON HIGH
|
||||
|
||||
#define RELAY_OFF LOW
|
||||
#define RELAY_ON HIGH
|
||||
|
||||
#define TRIAC_GPIO GPIO_NUM_4
|
||||
|
||||
#define WIFI_SSID "ATE0004"
|
||||
#define WIFI_PASS "repairlab"
|
||||
#define WIFI_CHANNEL 1
|
||||
#define MAX_STA_CONNECTION 4
|
||||
|
||||
#define BUTTON_I2C_ADDRESS 0x22 /*!< U7. */
|
||||
#define LED_I2C_ADDRESS 0x21 /*!< U6. */
|
||||
#define RELAY_I2C_ADDRESS 0x20 /*!< U5. */
|
||||
|
||||
#define GROUND_RELAY 0x00 /*!< Relay K1. RL1 pin on U5. */
|
||||
#define TS_RELAY 0x03 /*!< Relay K4. RL4 pin on U5. */
|
||||
#define RET_RELAY 0x02 /*!< Relay K3. RL3 pin on U5. */
|
||||
#define EXT_RELAY 0x01 /*!< Relay K2. RL2 pin on U5. */
|
||||
|
||||
#define TS_BUTTON 0x00 /*!< Connector BT1. B1-0 on U7. */
|
||||
#define RET_BUTTON 0x01 /*!< Connector BT2. B2-1 on U7. */
|
||||
#define EXT_BUTTON 0x02 /*!< Connector BT3. B3-2 on U7. */
|
||||
|
||||
#define TS_LED_RED 0x00 /*!< Connector LE1. 2 PIN. L1-0 pin on U6. */
|
||||
#define TS_LED_GREEN 0x01 /*!< Connector LE1. 1 PIN. L1-1 pin on U6. */
|
||||
#define RET_LED_BLUE 0x02 /*!< Connector LE2. 2 PIN. L2-2 pin on U6. */
|
||||
#define RET_LED_GREEN 0x03 /*!< Connector LE2. 1 PIN. L2-3 pin on U6. */
|
||||
#define EXT_LED_BLUE 0x04 /*!< Connector LE3. 2 PIN. L3-4 pin on U6. */
|
||||
#define EXT_LED_GREEN 0x05 /*!< Connector LE3. 1 PIN. L3-5 pin on U6. */
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C"
|
||||
{
|
||||
#endif
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
93
main/main.c
Executable file
93
main/main.c
Executable file
@@ -0,0 +1,93 @@
|
||||
#include "zh_pcf8574.h"
|
||||
|
||||
#define I2C_PORT (I2C_NUM_MAX - 1)
|
||||
|
||||
#ifndef CONFIG_IDF_TARGET_ESP8266
|
||||
i2c_master_bus_handle_t i2c_bus_handle = NULL;
|
||||
#endif
|
||||
|
||||
zh_pcf8574_handle_t pcf8574_handle = {0};
|
||||
|
||||
void zh_pcf8574_event_handler(void *arg, esp_event_base_t event_base, int32_t event_id, void *event_data); // Required only if used input GPIO interrupts.
|
||||
|
||||
void print_gpio_status(const char *message, uint8_t reg)
|
||||
{
|
||||
printf("%s", message);
|
||||
for (uint8_t i = 0; i < 8; ++i)
|
||||
{
|
||||
printf("%c", (reg & 0x80) ? '1' : '0');
|
||||
reg <<= 1;
|
||||
}
|
||||
printf(".\n");
|
||||
}
|
||||
|
||||
void app_main(void)
|
||||
{
|
||||
esp_log_level_set("zh_pcf8574", ESP_LOG_NONE); // For ESP8266 first enable "Component config -> Log output -> Enable log set level" via menuconfig.
|
||||
esp_log_level_set("zh_vector", ESP_LOG_NONE); // For ESP8266 first enable "Component config -> Log output -> Enable log set level" via menuconfig.
|
||||
#ifdef CONFIG_IDF_TARGET_ESP8266
|
||||
i2c_config_t i2c_config = {
|
||||
.mode = I2C_MODE_MASTER,
|
||||
.sda_io_num = GPIO_NUM_4, // In accordance with used chip.
|
||||
.sda_pullup_en = GPIO_PULLUP_ENABLE,
|
||||
.scl_io_num = GPIO_NUM_5, // In accordance with used chip.
|
||||
.scl_pullup_en = GPIO_PULLUP_ENABLE,
|
||||
};
|
||||
i2c_driver_install(I2C_PORT, i2c_config.mode);
|
||||
i2c_param_config(I2C_PORT, &i2c_config);
|
||||
#else
|
||||
i2c_master_bus_config_t i2c_bus_config = {
|
||||
.clk_source = I2C_CLK_SRC_DEFAULT,
|
||||
.i2c_port = I2C_PORT,
|
||||
.scl_io_num = GPIO_NUM_22, // In accordance with used chip.
|
||||
.sda_io_num = GPIO_NUM_21, // In accordance with used chip.
|
||||
.glitch_ignore_cnt = 7,
|
||||
.flags.enable_internal_pullup = true,
|
||||
};
|
||||
i2c_new_master_bus(&i2c_bus_config, &i2c_bus_handle);
|
||||
#endif
|
||||
esp_event_loop_create_default(); // Required only if used input GPIO interrupts.
|
||||
#ifdef CONFIG_IDF_TARGET_ESP8266
|
||||
esp_event_handler_register(ZH_PCF8574, ESP_EVENT_ANY_ID, &zh_pcf8574_event_handler, NULL); // Required only if used input GPIO interrupts.
|
||||
#else
|
||||
esp_event_handler_instance_register(ZH_PCF8574, ESP_EVENT_ANY_ID, &zh_pcf8574_event_handler, NULL, NULL); // Required only if used input GPIO interrupts.
|
||||
#endif
|
||||
zh_pcf8574_init_config_t pcf8574_init_config = ZH_PCF8574_INIT_CONFIG_DEFAULT();
|
||||
#ifdef CONFIG_IDF_TARGET_ESP8266
|
||||
pcf8574_init_config.i2c_port = I2C_PORT;
|
||||
#else
|
||||
pcf8574_init_config.i2c_handle = i2c_bus_handle;
|
||||
#endif
|
||||
pcf8574_init_config.i2c_address = 0x38;
|
||||
pcf8574_init_config.p0_gpio_work_mode = true; // Required only for input GPIO.
|
||||
pcf8574_init_config.interrupt_gpio = GPIO_NUM_14; // Required only if used input GPIO interrupts.
|
||||
zh_pcf8574_init(&pcf8574_init_config, &pcf8574_handle);
|
||||
uint8_t reg = 0;
|
||||
zh_pcf8574_read(&pcf8574_handle, ®);
|
||||
print_gpio_status("GPIO status: ", reg);
|
||||
printf("Set P7 to 1, P1 to 1 and P0 to 0.\n");
|
||||
zh_pcf8574_write(&pcf8574_handle, 0b10000010); // GPIO P0 will not be changed because it is operating in input mode.
|
||||
zh_pcf8574_read(&pcf8574_handle, ®);
|
||||
print_gpio_status("GPIO status: ", reg);
|
||||
printf("Sets P0 to 0.\n");
|
||||
zh_pcf8574_write_gpio(&pcf8574_handle, 0, false); // GPIO P0 will not be changed because it is operating in input mode.
|
||||
bool gpio = 0;
|
||||
zh_pcf8574_read_gpio(&pcf8574_handle, 0, &gpio);
|
||||
printf("P0 status: %d.\n", gpio);
|
||||
printf("Set P1 to 0.\n");
|
||||
zh_pcf8574_write_gpio(&pcf8574_handle, 1, false);
|
||||
zh_pcf8574_read_gpio(&pcf8574_handle, 1, &gpio);
|
||||
printf("P1 status: %d.\n", gpio);
|
||||
zh_pcf8574_read(&pcf8574_handle, ®);
|
||||
print_gpio_status("GPIO status: ", reg);
|
||||
printf("Reset all GPIO.\n");
|
||||
zh_pcf8574_reset(&pcf8574_handle);
|
||||
zh_pcf8574_read(&pcf8574_handle, ®);
|
||||
print_gpio_status("GPIO status: ", reg);
|
||||
}
|
||||
|
||||
void zh_pcf8574_event_handler(void *arg, esp_event_base_t event_base, int32_t event_id, void *event_data) // Required only if used input GPIO interrupts.
|
||||
{
|
||||
zh_pcf8574_event_on_isr_t *event = event_data;
|
||||
printf("Interrupt happened on device address 0x%02X on GPIO number %d at level %d.\n", event->i2c_address, event->gpio_number, event->gpio_level);
|
||||
}
|
||||
@@ -1,202 +0,0 @@
|
||||
#include "esp_wifi.h"
|
||||
#include "esp_http_server.h"
|
||||
|
||||
static httpd_handle_t _webserver_handle = NULL;
|
||||
|
||||
static void _ws_async_send(void *arg);
|
||||
|
||||
static esp_err_t _fav_handler(httpd_req_t *req);
|
||||
static esp_err_t _logo_handler(httpd_req_t *req);
|
||||
|
||||
static esp_err_t _index_page_handler(httpd_req_t *req);
|
||||
static esp_err_t _index_page_css_handler(httpd_req_t *req);
|
||||
static esp_err_t _index_page_js_handler(httpd_req_t *req);
|
||||
static esp_err_t _index_page_ws_handler(httpd_req_t *req);
|
||||
|
||||
// static esp_err_t _ws_send(httpd_handle_t *handle, char *payload);
|
||||
|
||||
static const httpd_uri_t _fav = {
|
||||
.uri = "/favicon.ico",
|
||||
.method = HTTP_GET,
|
||||
.handler = _fav_handler,
|
||||
.user_ctx = NULL};
|
||||
|
||||
static const httpd_uri_t _logo = {
|
||||
.uri = "/logo.png",
|
||||
.method = HTTP_GET,
|
||||
.handler = _logo_handler,
|
||||
.user_ctx = NULL};
|
||||
|
||||
static const httpd_uri_t _index_page = {
|
||||
.uri = "/",
|
||||
.method = HTTP_GET,
|
||||
.handler = _index_page_handler,
|
||||
.user_ctx = NULL};
|
||||
|
||||
static const httpd_uri_t _index_page_css = {
|
||||
.uri = "/index_style.css",
|
||||
.method = HTTP_GET,
|
||||
.handler = _index_page_css_handler,
|
||||
.user_ctx = NULL};
|
||||
|
||||
static const httpd_uri_t _index_page_js = {
|
||||
.uri = "/index_script.js",
|
||||
.method = HTTP_GET,
|
||||
.handler = _index_page_js_handler,
|
||||
.user_ctx = NULL};
|
||||
|
||||
static const httpd_uri_t _index_page_ws = {
|
||||
.uri = "/ws",
|
||||
.method = HTTP_GET,
|
||||
.handler = _index_page_ws_handler,
|
||||
.user_ctx = NULL,
|
||||
.is_websocket = true};
|
||||
|
||||
void _zh_webserver_init(void)
|
||||
{
|
||||
httpd_config_t config = HTTPD_DEFAULT_CONFIG();
|
||||
httpd_start(&_webserver_handle, &config);
|
||||
httpd_register_uri_handler(_webserver_handle, &_fav);
|
||||
httpd_register_uri_handler(_webserver_handle, &_logo);
|
||||
httpd_register_uri_handler(_webserver_handle, &_index_page);
|
||||
httpd_register_uri_handler(_webserver_handle, &_index_page_css);
|
||||
httpd_register_uri_handler(_webserver_handle, &_index_page_js);
|
||||
httpd_register_uri_handler(_webserver_handle, &_index_page_ws);
|
||||
// httpd_config_t config = HTTPD_DEFAULT_CONFIG();
|
||||
// httpd_start(&_webserver_handle, &config);
|
||||
// zh_ota_server_init(_webserver_handle);
|
||||
}
|
||||
|
||||
void _zh_webserver_send(char *payload)
|
||||
{
|
||||
httpd_queue_work(_webserver_handle, _ws_async_send, payload);
|
||||
}
|
||||
|
||||
static void _ws_async_send(void *arg)
|
||||
{
|
||||
httpd_ws_frame_t ws_package = {0};
|
||||
// struct async_resp_arg *resp_arg = arg;
|
||||
// httpd_handle_t hd = resp_arg->hd;
|
||||
// int fd = resp_arg->fd;
|
||||
|
||||
// led_state = !led_state;
|
||||
// // gpio_set_level(LED_PIN, led_state);
|
||||
|
||||
// char buff[4];
|
||||
// memset(buff, 0, sizeof(buff));
|
||||
// sprintf(buff, "%d", led_state);
|
||||
|
||||
// memset(&ws_package, 0, sizeof(httpd_ws_frame_t));
|
||||
ws_package.payload = (uint8_t *)arg;
|
||||
ws_package.len = strlen(arg);
|
||||
ws_package.type = HTTPD_WS_TYPE_TEXT;
|
||||
|
||||
static size_t max_clients = CONFIG_LWIP_MAX_LISTENING_TCP;
|
||||
size_t fds = max_clients;
|
||||
int client_fds[max_clients];
|
||||
|
||||
esp_err_t ret = httpd_get_client_list(_webserver_handle, &fds, client_fds);
|
||||
|
||||
// if (ret != ESP_OK)
|
||||
// {
|
||||
// return ESP_OK;
|
||||
// }
|
||||
|
||||
for (uint8_t i = 0; i <= fds; ++i)
|
||||
{
|
||||
int client_info = httpd_ws_get_fd_info(_webserver_handle, client_fds[i]);
|
||||
if (client_info == HTTPD_WS_CLIENT_WEBSOCKET)
|
||||
{
|
||||
httpd_ws_send_frame_async(_webserver_handle, client_fds[i], &ws_package);
|
||||
}
|
||||
}
|
||||
// free(resp_arg);
|
||||
}
|
||||
|
||||
static esp_err_t _fav_handler(httpd_req_t *req)
|
||||
{
|
||||
extern const unsigned char favicon_ico_start[] asm("_binary_favicon_ico_start");
|
||||
extern const unsigned char favicon_ico_end[] asm("_binary_favicon_ico_end");
|
||||
const size_t favicon_ico_size = (favicon_ico_end - favicon_ico_start);
|
||||
httpd_resp_set_type(req, "image/x-icon");
|
||||
httpd_resp_send_chunk(req, (const char *)favicon_ico_start, favicon_ico_size);
|
||||
httpd_resp_sendstr_chunk(req, NULL);
|
||||
return ESP_OK;
|
||||
}
|
||||
|
||||
static esp_err_t _logo_handler(httpd_req_t *req)
|
||||
{
|
||||
extern const unsigned char logo_png_start[] asm("_binary_logo_png_start");
|
||||
extern const unsigned char logo_png_end[] asm("_binary_logo_png_end");
|
||||
const size_t logo_png_size = (logo_png_end - logo_png_start);
|
||||
httpd_resp_set_type(req, "image/png");
|
||||
httpd_resp_send_chunk(req, (const char *)logo_png_start, logo_png_size);
|
||||
httpd_resp_sendstr_chunk(req, NULL);
|
||||
return ESP_OK;
|
||||
}
|
||||
|
||||
static esp_err_t _index_page_handler(httpd_req_t *req)
|
||||
{
|
||||
extern const unsigned char index_html_start[] asm("_binary_index_html_start");
|
||||
extern const unsigned char index_html_end[] asm("_binary_index_html_end");
|
||||
const size_t index_html_size = (index_html_end - index_html_start);
|
||||
httpd_resp_set_type(req, "text/html");
|
||||
httpd_resp_send_chunk(req, (const char *)index_html_start, index_html_size);
|
||||
httpd_resp_sendstr_chunk(req, NULL);
|
||||
return ESP_OK;
|
||||
}
|
||||
|
||||
static esp_err_t _index_page_css_handler(httpd_req_t *req)
|
||||
{
|
||||
extern const unsigned char index_style_css_start[] asm("_binary_index_style_css_start");
|
||||
extern const unsigned char index_style_css_end[] asm("_binary_index_style_css_end");
|
||||
const size_t index_style_css_size = (index_style_css_end - index_style_css_start);
|
||||
httpd_resp_set_type(req, "text/css");
|
||||
httpd_resp_send_chunk(req, (const char *)index_style_css_start, index_style_css_size);
|
||||
httpd_resp_sendstr_chunk(req, NULL);
|
||||
return ESP_OK;
|
||||
}
|
||||
|
||||
static esp_err_t _index_page_js_handler(httpd_req_t *req)
|
||||
{
|
||||
extern const unsigned char index_script_js_start[] asm("_binary_index_script_js_start");
|
||||
extern const unsigned char index_script_js_end[] asm("_binary_index_script_js_end");
|
||||
const size_t index_script_js_size = (index_script_js_end - index_script_js_start);
|
||||
httpd_resp_set_type(req, "text/javascript");
|
||||
httpd_resp_send_chunk(req, (const char *)index_script_js_start, index_script_js_size);
|
||||
httpd_resp_sendstr_chunk(req, NULL);
|
||||
return ESP_OK;
|
||||
}
|
||||
|
||||
static esp_err_t _index_page_ws_handler(httpd_req_t *req)
|
||||
{
|
||||
if (req->method == HTTP_GET)
|
||||
{
|
||||
// ESP_LOGI(TAG, "Handshake done, the new connection was opened");
|
||||
// httpd_queue_work(_webserver_handle, ws_async_snd, NULL);
|
||||
return ESP_OK;
|
||||
}
|
||||
|
||||
httpd_ws_frame_t ws_package = {0};
|
||||
uint8_t *buf = NULL;
|
||||
ws_package.type = HTTPD_WS_TYPE_TEXT;
|
||||
httpd_ws_recv_frame(req, &ws_package, 0);
|
||||
// ZH_ERROR_CHECK(err == ESP_OK, err, NULL, "Main page ws handler error.");
|
||||
if (ws_package.len > 0)
|
||||
{
|
||||
buf = heap_caps_calloc(1, ws_package.len + 1, MALLOC_CAP_8BIT);
|
||||
// ZH_ERROR_CHECK(buf != NULL, ESP_ERR_NO_MEM, NULL, "Main page ws handler error.");
|
||||
ws_package.payload = buf;
|
||||
httpd_ws_recv_frame(req, &ws_package, ws_package.len);
|
||||
// ZH_ERROR_CHECK(buf != NULL, err, heap_caps_free(buf), "Main page ws handler error.");
|
||||
}
|
||||
if (ws_package.type == HTTPD_WS_TYPE_TEXT)
|
||||
{
|
||||
if (strcmp((char *)ws_package.payload, "toggle") == 0)
|
||||
{
|
||||
heap_caps_free(buf);
|
||||
// return trigger_async_send(req->handle, req);
|
||||
}
|
||||
}
|
||||
return ESP_OK;
|
||||
}
|
||||
BIN
pcb/BOM_ATE0004.000.001.xlsx
Normal file
BIN
pcb/BOM_ATE0004.000.001.xlsx
Normal file
Binary file not shown.
BIN
pcb/BOM_ATE0004.000.001_ATE0004.000.001_2025-10-21.xlsx
Normal file
BIN
pcb/BOM_ATE0004.000.001_ATE0004.000.001_2025-10-21.xlsx
Normal file
Binary file not shown.
Binary file not shown.
BIN
pcb/Gerber_ATE0003.000.001_v.1.zip
Normal file
BIN
pcb/Gerber_ATE0003.000.001_v.1.zip
Normal file
Binary file not shown.
BIN
pcb/Gerber_ATE0004.000.001_2025-10-21.zip
Normal file
BIN
pcb/Gerber_ATE0004.000.001_2025-10-21.zip
Normal file
Binary file not shown.
Binary file not shown.
BIN
pcb/PCB.jpeg
BIN
pcb/PCB.jpeg
Binary file not shown.
|
Before Width: | Height: | Size: 3.0 MiB |
File diff suppressed because it is too large
Load Diff
BIN
pcb/Информационная_карта_ООО_АЭРОТЭЧ.pdf
Normal file
BIN
pcb/Информационная_карта_ООО_АЭРОТЭЧ.pdf
Normal file
Binary file not shown.
BIN
pcb/бланк заказа филиал ЭК Мск.xlsx
Normal file
BIN
pcb/бланк заказа филиал ЭК Мск.xlsx
Normal file
Binary file not shown.
64
sdkconfig
64
sdkconfig
@@ -254,7 +254,7 @@ CONFIG_IDF_TOOLCHAIN_GCC=y
|
||||
CONFIG_IDF_TARGET_ARCH_XTENSA=y
|
||||
CONFIG_IDF_TARGET_ARCH="xtensa"
|
||||
CONFIG_IDF_TARGET="esp32"
|
||||
CONFIG_IDF_INIT_VERSION="5.5.1"
|
||||
CONFIG_IDF_INIT_VERSION="$IDF_INIT_VERSION"
|
||||
CONFIG_IDF_TARGET_ESP32=y
|
||||
CONFIG_IDF_FIRMWARE_CHIP_ID=0x0000
|
||||
|
||||
@@ -286,8 +286,7 @@ CONFIG_BOOTLOADER_PROJECT_VER=1
|
||||
#
|
||||
# Application Rollback
|
||||
#
|
||||
CONFIG_BOOTLOADER_APP_ROLLBACK_ENABLE=y
|
||||
# CONFIG_BOOTLOADER_APP_ANTI_ROLLBACK is not set
|
||||
# CONFIG_BOOTLOADER_APP_ROLLBACK_ENABLE is not set
|
||||
# end of Application Rollback
|
||||
|
||||
#
|
||||
@@ -296,9 +295,9 @@ CONFIG_BOOTLOADER_APP_ROLLBACK_ENABLE=y
|
||||
# end of Recovery Bootloader and Rollback
|
||||
|
||||
CONFIG_BOOTLOADER_OFFSET_IN_FLASH=0x1000
|
||||
# CONFIG_BOOTLOADER_COMPILER_OPTIMIZATION_SIZE is not set
|
||||
CONFIG_BOOTLOADER_COMPILER_OPTIMIZATION_SIZE=y
|
||||
# CONFIG_BOOTLOADER_COMPILER_OPTIMIZATION_DEBUG is not set
|
||||
CONFIG_BOOTLOADER_COMPILER_OPTIMIZATION_PERF=y
|
||||
# CONFIG_BOOTLOADER_COMPILER_OPTIMIZATION_PERF is not set
|
||||
# CONFIG_BOOTLOADER_COMPILER_OPTIMIZATION_NONE is not set
|
||||
|
||||
#
|
||||
@@ -307,12 +306,12 @@ CONFIG_BOOTLOADER_COMPILER_OPTIMIZATION_PERF=y
|
||||
CONFIG_BOOTLOADER_LOG_VERSION_1=y
|
||||
CONFIG_BOOTLOADER_LOG_VERSION=1
|
||||
# CONFIG_BOOTLOADER_LOG_LEVEL_NONE is not set
|
||||
CONFIG_BOOTLOADER_LOG_LEVEL_ERROR=y
|
||||
# CONFIG_BOOTLOADER_LOG_LEVEL_ERROR is not set
|
||||
# CONFIG_BOOTLOADER_LOG_LEVEL_WARN is not set
|
||||
# CONFIG_BOOTLOADER_LOG_LEVEL_INFO is not set
|
||||
CONFIG_BOOTLOADER_LOG_LEVEL_INFO=y
|
||||
# CONFIG_BOOTLOADER_LOG_LEVEL_DEBUG is not set
|
||||
# CONFIG_BOOTLOADER_LOG_LEVEL_VERBOSE is not set
|
||||
CONFIG_BOOTLOADER_LOG_LEVEL=1
|
||||
CONFIG_BOOTLOADER_LOG_LEVEL=3
|
||||
|
||||
#
|
||||
# Format
|
||||
@@ -402,13 +401,13 @@ CONFIG_ESPTOOLPY_FLASHFREQ_40M=y
|
||||
CONFIG_ESPTOOLPY_FLASHFREQ="40m"
|
||||
# CONFIG_ESPTOOLPY_FLASHSIZE_1MB is not set
|
||||
# CONFIG_ESPTOOLPY_FLASHSIZE_2MB is not set
|
||||
# CONFIG_ESPTOOLPY_FLASHSIZE_4MB is not set
|
||||
CONFIG_ESPTOOLPY_FLASHSIZE_8MB=y
|
||||
CONFIG_ESPTOOLPY_FLASHSIZE_4MB=y
|
||||
# CONFIG_ESPTOOLPY_FLASHSIZE_8MB is not set
|
||||
# CONFIG_ESPTOOLPY_FLASHSIZE_16MB is not set
|
||||
# CONFIG_ESPTOOLPY_FLASHSIZE_32MB is not set
|
||||
# CONFIG_ESPTOOLPY_FLASHSIZE_64MB is not set
|
||||
# CONFIG_ESPTOOLPY_FLASHSIZE_128MB is not set
|
||||
CONFIG_ESPTOOLPY_FLASHSIZE="8MB"
|
||||
CONFIG_ESPTOOLPY_FLASHSIZE="4MB"
|
||||
# CONFIG_ESPTOOLPY_HEADER_FLASHSIZE_UPDATE is not set
|
||||
CONFIG_ESPTOOLPY_BEFORE_RESET=y
|
||||
# CONFIG_ESPTOOLPY_BEFORE_NORESET is not set
|
||||
@@ -433,21 +432,12 @@ CONFIG_PARTITION_TABLE_OFFSET=0x8000
|
||||
CONFIG_PARTITION_TABLE_MD5=y
|
||||
# end of Partition Table
|
||||
|
||||
#
|
||||
# OTA websocket update
|
||||
#
|
||||
CONFIG_OTA_DEFAULT_URI="/ota"
|
||||
CONFIG_OTA_DEFAULT_WS_URI="/ota/ws"
|
||||
CONFIG_OTA_CHUNK_SIZE=8192
|
||||
# CONFIG_OTA_PRE_ENCRYPTED_MODE is not set
|
||||
# end of OTA websocket update
|
||||
|
||||
#
|
||||
# Compiler options
|
||||
#
|
||||
# CONFIG_COMPILER_OPTIMIZATION_DEBUG is not set
|
||||
CONFIG_COMPILER_OPTIMIZATION_DEBUG=y
|
||||
# CONFIG_COMPILER_OPTIMIZATION_SIZE is not set
|
||||
CONFIG_COMPILER_OPTIMIZATION_PERF=y
|
||||
# CONFIG_COMPILER_OPTIMIZATION_PERF is not set
|
||||
# CONFIG_COMPILER_OPTIMIZATION_NONE is not set
|
||||
CONFIG_COMPILER_OPTIMIZATION_ASSERTIONS_ENABLE=y
|
||||
# CONFIG_COMPILER_OPTIMIZATION_ASSERTIONS_SILENT is not set
|
||||
@@ -676,7 +666,7 @@ CONFIG_DAC_DMA_AUTO_16BIT_ALIGN=y
|
||||
# ESP-Driver:GPIO Configurations
|
||||
#
|
||||
# CONFIG_GPIO_ESP32_SUPPORT_SWITCH_SLP_PULL is not set
|
||||
CONFIG_GPIO_CTRL_FUNC_IN_IRAM=y
|
||||
# CONFIG_GPIO_CTRL_FUNC_IN_IRAM is not set
|
||||
# end of ESP-Driver:GPIO Configurations
|
||||
|
||||
#
|
||||
@@ -853,7 +843,7 @@ CONFIG_HTTPD_MAX_URI_LEN=512
|
||||
CONFIG_HTTPD_ERR_RESP_NO_DELAY=y
|
||||
CONFIG_HTTPD_PURGE_BUF_LEN=32
|
||||
# CONFIG_HTTPD_LOG_PURGE_DATA is not set
|
||||
CONFIG_HTTPD_WS_SUPPORT=y
|
||||
# CONFIG_HTTPD_WS_SUPPORT is not set
|
||||
# CONFIG_HTTPD_QUEUE_WORK_BLOCKING is not set
|
||||
CONFIG_HTTPD_SERVER_EVENT_POST_TIMEOUT=2000
|
||||
# end of HTTP Server
|
||||
@@ -1331,6 +1321,7 @@ CONFIG_FREERTOS_TASK_NOTIFICATION_ARRAY_ENTRIES=1
|
||||
#
|
||||
# Port
|
||||
#
|
||||
CONFIG_FREERTOS_TASK_FUNCTION_WRAPPER=y
|
||||
# CONFIG_FREERTOS_WATCHPOINT_END_OF_STACK is not set
|
||||
CONFIG_FREERTOS_TLSP_DELETION_CALLBACKS=y
|
||||
# CONFIG_FREERTOS_TASK_PRE_DELETION_HOOK is not set
|
||||
@@ -1398,18 +1389,16 @@ CONFIG_LOG_VERSION=1
|
||||
# Log Level
|
||||
#
|
||||
# CONFIG_LOG_DEFAULT_LEVEL_NONE is not set
|
||||
CONFIG_LOG_DEFAULT_LEVEL_ERROR=y
|
||||
# CONFIG_LOG_DEFAULT_LEVEL_ERROR is not set
|
||||
# CONFIG_LOG_DEFAULT_LEVEL_WARN is not set
|
||||
# CONFIG_LOG_DEFAULT_LEVEL_INFO is not set
|
||||
CONFIG_LOG_DEFAULT_LEVEL_INFO=y
|
||||
# CONFIG_LOG_DEFAULT_LEVEL_DEBUG is not set
|
||||
# CONFIG_LOG_DEFAULT_LEVEL_VERBOSE is not set
|
||||
CONFIG_LOG_DEFAULT_LEVEL=1
|
||||
CONFIG_LOG_DEFAULT_LEVEL=3
|
||||
CONFIG_LOG_MAXIMUM_EQUALS_DEFAULT=y
|
||||
# CONFIG_LOG_MAXIMUM_LEVEL_WARN is not set
|
||||
# CONFIG_LOG_MAXIMUM_LEVEL_INFO is not set
|
||||
# CONFIG_LOG_MAXIMUM_LEVEL_DEBUG is not set
|
||||
# CONFIG_LOG_MAXIMUM_LEVEL_VERBOSE is not set
|
||||
CONFIG_LOG_MAXIMUM_LEVEL=1
|
||||
CONFIG_LOG_MAXIMUM_LEVEL=3
|
||||
|
||||
#
|
||||
# Level Settings
|
||||
@@ -2031,24 +2020,23 @@ CONFIG_WIFI_PROV_STA_ALL_CHANNEL_SCAN=y
|
||||
# CONFIG_ESP32_NO_BLOBS is not set
|
||||
# CONFIG_ESP32_COMPATIBLE_PRE_V2_1_BOOTLOADERS is not set
|
||||
# CONFIG_ESP32_COMPATIBLE_PRE_V3_1_BOOTLOADERS is not set
|
||||
CONFIG_APP_ROLLBACK_ENABLE=y
|
||||
# CONFIG_APP_ANTI_ROLLBACK is not set
|
||||
# CONFIG_APP_ROLLBACK_ENABLE is not set
|
||||
# CONFIG_LOG_BOOTLOADER_LEVEL_NONE is not set
|
||||
CONFIG_LOG_BOOTLOADER_LEVEL_ERROR=y
|
||||
# CONFIG_LOG_BOOTLOADER_LEVEL_ERROR is not set
|
||||
# CONFIG_LOG_BOOTLOADER_LEVEL_WARN is not set
|
||||
# CONFIG_LOG_BOOTLOADER_LEVEL_INFO 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=1
|
||||
CONFIG_LOG_BOOTLOADER_LEVEL=3
|
||||
# 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=115200
|
||||
# CONFIG_OPTIMIZATION_LEVEL_DEBUG is not set
|
||||
# CONFIG_COMPILER_OPTIMIZATION_LEVEL_DEBUG is not set
|
||||
# CONFIG_COMPILER_OPTIMIZATION_DEFAULT is not set
|
||||
CONFIG_OPTIMIZATION_LEVEL_DEBUG=y
|
||||
CONFIG_COMPILER_OPTIMIZATION_LEVEL_DEBUG=y
|
||||
CONFIG_COMPILER_OPTIMIZATION_DEFAULT=y
|
||||
# CONFIG_OPTIMIZATION_LEVEL_RELEASE is not set
|
||||
# CONFIG_COMPILER_OPTIMIZATION_LEVEL_RELEASE is not set
|
||||
CONFIG_OPTIMIZATION_ASSERTIONS_ENABLED=y
|
||||
|
||||
Reference in New Issue
Block a user