Skip to content

Commit cea0ce3

Browse files
authored
Merge pull request #13 from xyzroe/main
v0.1.9
2 parents 5b9609c + c9dfe4e commit cea0ce3

32 files changed

+4044
-1270
lines changed

.github/workflows/workflow.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ jobs:
3131
with:
3232
python-version: '3.9'
3333
- name: Install PlatformIO Core
34-
run: pip install --upgrade platformio
34+
run: pip install --upgrade platformio==6.1.11
3535

3636
- name: Build PlatformIO Project
3737
run: pio run

.gitignore

+4-1
Original file line numberDiff line numberDiff line change
@@ -6,4 +6,7 @@
66
commit
77
test.html
88
gzipped
9-
webh
9+
webh
10+
*.code-workspace
11+
logs
12+
todo

bin/UZG-01.bin

180 KB
Binary file not shown.

bin/UZG-01_v0.1.5.full.bin

-837 KB
Binary file not shown.

bin/UZG-01_v0.1.9.full.bin

1020 KB
Binary file not shown.

manifest.json

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
11
{
22
"name": "UZG-FW",
3-
"version": "v0.1.5",
3+
"version": "v0.1.9",
44
"builds": [
55
{
66
"chipFamily": "ESP32",
77
"improv": false,
88
"parts": [
9-
{ "path": "bin/UZG-01_v0.1.5.full.bin", "offset": 0 }
9+
{ "path": "bin/UZG-01_v0.1.9.full.bin", "offset": 0 }
1010
]
1111
}
1212
]

platformio.ini

+51-20
Original file line numberDiff line numberDiff line change
@@ -8,47 +8,78 @@
88
; Please visit documentation for the other options and examples
99
; https://docs.platformio.org/page/projectconf.html
1010

11+
;It was difficult to find working platform for https get function on solo board. Here are some logs:
12+
;https://github.com/tasmota/platform-espressif32/releases/download/v2.0.5/platform-espressif32-2.0.5.zip ;- old build. - unkown board
13+
;https://github.com/tasmota/platform-espressif32/releases/download/2023.01.00/platform-espressif32.zip ; fuck yeaar. it works on solo
14+
;https://github.com/tasmota/platform-espressif32/releases/download/2023.07.00/platform-espressif32.zip ; fuck yeaar. it also works on solo
15+
;https://github.com/tasmota/platform-espressif32/releases/download/2023.08.00/platform-espressif32.zip ; bitch. did't work -1
16+
;https://github.com/tasmota/platform-espressif32/releases/download/2023.10.01/platform-espressif32.zip ;- build but -1
17+
;https://github.com/tasmota/platform-espressif32/releases/download/2023.10.03/platform-espressif32.zip ;- last builds version but -1
18+
;https://github.com/tasmota/platform-espressif32/releases/download/2023.10.05/platform-espressif32.zip ;- WiFiClientSecure.h: No such file or directory
19+
;https://github.com/tasmota/platform-espressif32/releases/download/2023.10.10/platform-espressif32.zip ; - logs2.txt
20+
;espressif32 @ ^6.4.0 ;- unkown board
21+
;espressif32 @ 5.1.0 ; - works but no solo
22+
1123
[platformio]
12-
default_envs = prod-v01
24+
default_envs = prod-solo
1325

1426
[env]
15-
platform = https://github.com/tasmota/platform-espressif32/releases/download/2023.08.00/platform-espressif32.zip
1627
framework = arduino
1728
lib_deps =
18-
bblanchon/ArduinoJson@>=6.21.3
29+
1930
rlogiacco/CircularBuffer@>=1.3.3
20-
plerup/EspSoftwareSerial@>=8.1.0
31+
2132
marian-craciunescu/ESP32Ping@>=1.7
2233
sstaub/Ticker@>=4.4.0
23-
board = esp32dev
24-
monitor_filters = esp32_exception_decoder
34+
knolleary/PubSubClient@^2.8
35+
monitor_filters = esp32_exception_decoder, default, log2file
2536
monitor_speed = 115200
2637
upload_speed = 460800
27-
28-
[env:prod-v01]
29-
board = esp32-solo1
30-
build_flags = -DFRAMEWORK_ARDUINO_SOLO1
31-
board_build.f_cpu = 160000000L
3238
extra_scripts =
3339
pre:tools/version_increment_pre.py
3440
pre:tools/webfilesbuilder/build_html.py
3541
post:tools/build.py
42+
build_flags =
43+
-DBUILD_ENV_NAME=$PIOENV
44+
45+
46+
[env:prod-solo]
47+
platform = https://github.com/tasmota/platform-espressif32/releases/download/2023.07.00/platform-espressif32.zip
48+
board = esp32-solo1
49+
build_flags =
50+
${env.build_flags}
51+
-DFRAMEWORK_ARDUINO_SOLO1
52+
board_build.f_cpu = 160000000L
53+
extra_scripts =
54+
${env.extra_scripts}
55+
56+
[env:debug-solo]
57+
platform = https://github.com/tasmota/platform-espressif32/releases/download/2023.07.00/platform-espressif32.zip
58+
board = esp32-solo1
59+
build_flags =
60+
-DDEBUG
61+
${env.build_flags}
62+
-DFRAMEWORK_ARDUINO_SOLO1
63+
board_build.f_cpu = 160000000L
64+
extra_scripts =
65+
${env.extra_scripts}
66+
3667

3768
[env:prod]
69+
platform = espressif32 @ 6.4.0
70+
board = esp32dev
3871
build_flags =
3972
${env.build_flags}
40-
-D=${PIOENV}
4173
extra_scripts =
42-
pre:tools/version_increment_pre.py
43-
pre:tools/webfilesbuilder/build_html.py
44-
post:tools/build.py
74+
${env.extra_scripts}
75+
4576

4677
[env:debug]
78+
platform = espressif32 @ 6.4.0
79+
board = esp32dev
4780
build_flags =
48-
${env.build_flags}
49-
-D=${PIOENV}
5081
-DDEBUG
82+
${env.build_flags}
5183
extra_scripts =
52-
pre:tools/version_increment_pre.py
53-
pre:tools/webfilesbuilder/build_html.py
54-
post:tools/debug_build.py
84+
${env.extra_scripts}
85+

src/config.h

+52-16
Original file line numberDiff line numberDiff line change
@@ -5,16 +5,16 @@
55
#include <CircularBuffer.h>
66
#include "version.h"
77

8-
#define DEBUG
9-
//ESP32 PINS TO CONTROL LAN8720
8+
// #define DEBUG
9+
// ESP32 PINS TO CONTROL LAN8720
1010
#define ETH_CLK_MODE_1 ETH_CLOCK_GPIO17_OUT
1111
#define ETH_POWER_PIN_ALTERNATIVE_1 5
1212
#define ETH_POWER_PIN_1 -1
1313
#define ETH_TYPE_1 ETH_PHY_LAN8720
1414
#define ETH_ADDR_1 0
1515
#define ETH_MDC_PIN_1 23
1616
#define ETH_MDIO_PIN_1 18
17-
//ESP32 PINS TO CONTROL CC2652P
17+
// ESP32 PINS TO CONTROL CC2652P
1818
#define CC2652P_RST 16
1919
#define CC2652P_FLSH 32
2020
#define CC2652P_RXD 36
@@ -26,13 +26,24 @@
2626
#define TCP_LISTEN_PORT 9999
2727
#define FORMAT_LITTLEFS_IF_FAILED true
2828

29-
const int16_t overseerInterval = 10 * 1000; //check lan or wifi connection every 5sec
30-
const uint8_t overseerMaxRetry = 3; //5x12 = 60sec delay for AP start
31-
const uint8_t LED_RED = 12;
32-
const uint8_t LED_BLUE = 14;
29+
30+
// CC2652 settings
31+
#define BSL_PIN 15 // CC2652 pin number
32+
#define BSL_LEVEL 0 //0-LOW 1-HIGH
33+
34+
35+
const int16_t overseerInterval = 10 * 1000; // check lan or wifi connection every 5sec
36+
const uint8_t overseerMaxRetry = 3; // 5x12 = 60sec delay for AP start
37+
const uint8_t LED_USB = 12; // RED
38+
const uint8_t LED_PWR = 14; // BLUE
3339
const uint8_t MAX_SOCKET_CLIENTS = 5;
3440

35-
enum COORDINATOR_MODE_t : uint8_t {COORDINATOR_MODE_LAN, COORDINATOR_MODE_WIFI, COORDINATOR_MODE_USB};
41+
enum COORDINATOR_MODE_t : uint8_t
42+
{
43+
COORDINATOR_MODE_LAN,
44+
COORDINATOR_MODE_WIFI,
45+
COORDINATOR_MODE_USB
46+
};
3647

3748
// struct JsonConsts_t{
3849
// char* str;
@@ -41,7 +52,8 @@ enum COORDINATOR_MODE_t : uint8_t {COORDINATOR_MODE_LAN, COORDINATOR_MODE_WIFI,
4152
// "sadasd"
4253
// };
4354

44-
struct ConfigSettingsStruct{
55+
struct ConfigSettingsStruct
56+
{
4557
char ssid[50];
4658
char password[50];
4759
char ipAddressWiFi[18];
@@ -65,17 +77,31 @@ struct ConfigSettingsStruct{
6577
bool webAuth;
6678
char webUser[50];
6779
char webPass[50];
68-
bool disableLedBlue;
69-
bool disableLedYellow;
70-
//bool disablePingCtrl;
80+
bool disableLedUSB;
81+
bool disableLedPwr;
82+
// bool disablePingCtrl;
7183
bool disableLeds;
7284
COORDINATOR_MODE_t coordinator_mode;
73-
COORDINATOR_MODE_t prevCoordinator_mode;//for button
85+
COORDINATOR_MODE_t prevCoordinator_mode; // for button
7486
bool keepWeb;
7587
bool apStarted;
7688
bool wifiWebSetupInProgress;
7789
bool fwEnabled;
7890
IPAddress fwIp;
91+
bool mqttEnable;
92+
char mqttServer[50];
93+
IPAddress mqttServerIP;
94+
int mqttPort;
95+
char mqttUser[50];
96+
char mqttPass[50];
97+
char mqttTopic[50];
98+
// bool mqttRetain;
99+
int mqttInterval;
100+
bool mqttDiscovery;
101+
unsigned long mqttReconnectTime;
102+
unsigned long mqttHeartbeatTime;
103+
bool zbLedState;
104+
bool zbFlashing;
79105
};
80106

81107
struct InfosStruct
@@ -85,13 +111,23 @@ struct InfosStruct
85111
char flash[8];
86112
};
87113

114+
struct zbVerStruct
115+
{
116+
uint32_t zbRev;
117+
uint8_t maintrel;
118+
uint8_t minorrel;
119+
uint8_t majorrel;
120+
uint8_t product;
121+
uint8_t transportrev;
122+
};
123+
88124
typedef CircularBuffer<char, 8024> LogConsoleType;
89125

90-
//#define WL_MAC_ADDR_LENGTH 6
126+
// #define WL_MAC_ADDR_LENGTH 6
91127

92128
#ifdef DEBUG
93-
#define DEBUG_PRINT(x) Serial.print(x)
94-
#define DEBUG_PRINTLN(x) Serial.println(x)
129+
#define DEBUG_PRINT(x) Serial.print(String(x))
130+
#define DEBUG_PRINTLN(x) Serial.println(String(x))
95131
#else
96132
#define DEBUG_PRINT(x)
97133
#define DEBUG_PRINTLN(x)

0 commit comments

Comments
 (0)