Skip to content

Commit

Permalink
Merge pull request #13 from xyzroe/main
Browse files Browse the repository at this point in the history
v0.1.9
  • Loading branch information
xyzroe authored Jan 13, 2024
2 parents 5b9609c + c9dfe4e commit cea0ce3
Show file tree
Hide file tree
Showing 32 changed files with 4,044 additions and 1,270 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/workflow.yml
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ jobs:
with:
python-version: '3.9'
- name: Install PlatformIO Core
run: pip install --upgrade platformio
run: pip install --upgrade platformio==6.1.11

- name: Build PlatformIO Project
run: pio run
Expand Down
5 changes: 4 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -6,4 +6,7 @@
commit
test.html
gzipped
webh
webh
*.code-workspace
logs
todo
Binary file modified bin/UZG-01.bin
Binary file not shown.
Binary file removed bin/UZG-01_v0.1.5.full.bin
Binary file not shown.
Binary file added bin/UZG-01_v0.1.9.full.bin
Binary file not shown.
4 changes: 2 additions & 2 deletions manifest.json
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
{
"name": "UZG-FW",
"version": "v0.1.5",
"version": "v0.1.9",
"builds": [
{
"chipFamily": "ESP32",
"improv": false,
"parts": [
{ "path": "bin/UZG-01_v0.1.5.full.bin", "offset": 0 }
{ "path": "bin/UZG-01_v0.1.9.full.bin", "offset": 0 }
]
}
]
Expand Down
71 changes: 51 additions & 20 deletions platformio.ini
Original file line number Diff line number Diff line change
Expand Up @@ -8,47 +8,78 @@
; Please visit documentation for the other options and examples
; https://docs.platformio.org/page/projectconf.html

;It was difficult to find working platform for https get function on solo board. Here are some logs:
;https://github.com/tasmota/platform-espressif32/releases/download/v2.0.5/platform-espressif32-2.0.5.zip ;- old build. - unkown board
;https://github.com/tasmota/platform-espressif32/releases/download/2023.01.00/platform-espressif32.zip ; fuck yeaar. it works on solo
;https://github.com/tasmota/platform-espressif32/releases/download/2023.07.00/platform-espressif32.zip ; fuck yeaar. it also works on solo
;https://github.com/tasmota/platform-espressif32/releases/download/2023.08.00/platform-espressif32.zip ; bitch. did't work -1
;https://github.com/tasmota/platform-espressif32/releases/download/2023.10.01/platform-espressif32.zip ;- build but -1
;https://github.com/tasmota/platform-espressif32/releases/download/2023.10.03/platform-espressif32.zip ;- last builds version but -1
;https://github.com/tasmota/platform-espressif32/releases/download/2023.10.05/platform-espressif32.zip ;- WiFiClientSecure.h: No such file or directory
;https://github.com/tasmota/platform-espressif32/releases/download/2023.10.10/platform-espressif32.zip ; - logs2.txt
;espressif32 @ ^6.4.0 ;- unkown board
;espressif32 @ 5.1.0 ; - works but no solo

[platformio]
default_envs = prod-v01
default_envs = prod-solo

[env]
platform = https://github.com/tasmota/platform-espressif32/releases/download/2023.08.00/platform-espressif32.zip
framework = arduino
lib_deps =
bblanchon/ArduinoJson@>=6.21.3
bblanchon/[email protected]
rlogiacco/CircularBuffer@>=1.3.3
plerup/EspSoftwareSerial@>=8.1.0
plerup/[email protected]
marian-craciunescu/ESP32Ping@>=1.7
sstaub/Ticker@>=4.4.0
board = esp32dev
monitor_filters = esp32_exception_decoder
knolleary/PubSubClient@^2.8
monitor_filters = esp32_exception_decoder, default, log2file
monitor_speed = 115200
upload_speed = 460800

[env:prod-v01]
board = esp32-solo1
build_flags = -DFRAMEWORK_ARDUINO_SOLO1
board_build.f_cpu = 160000000L
extra_scripts =
pre:tools/version_increment_pre.py
pre:tools/webfilesbuilder/build_html.py
post:tools/build.py
build_flags =
-DBUILD_ENV_NAME=$PIOENV


[env:prod-solo]
platform = https://github.com/tasmota/platform-espressif32/releases/download/2023.07.00/platform-espressif32.zip
board = esp32-solo1
build_flags =
${env.build_flags}
-DFRAMEWORK_ARDUINO_SOLO1
board_build.f_cpu = 160000000L
extra_scripts =
${env.extra_scripts}

[env:debug-solo]
platform = https://github.com/tasmota/platform-espressif32/releases/download/2023.07.00/platform-espressif32.zip
board = esp32-solo1
build_flags =
-DDEBUG
${env.build_flags}
-DFRAMEWORK_ARDUINO_SOLO1
board_build.f_cpu = 160000000L
extra_scripts =
${env.extra_scripts}


[env:prod]
platform = espressif32 @ 6.4.0
board = esp32dev
build_flags =
${env.build_flags}
-D=${PIOENV}
extra_scripts =
pre:tools/version_increment_pre.py
pre:tools/webfilesbuilder/build_html.py
post:tools/build.py
${env.extra_scripts}


[env:debug]
platform = espressif32 @ 6.4.0
board = esp32dev
build_flags =
${env.build_flags}
-D=${PIOENV}
-DDEBUG
${env.build_flags}
extra_scripts =
pre:tools/version_increment_pre.py
pre:tools/webfilesbuilder/build_html.py
post:tools/debug_build.py
${env.extra_scripts}

68 changes: 52 additions & 16 deletions src/config.h
Original file line number Diff line number Diff line change
Expand Up @@ -5,16 +5,16 @@
#include <CircularBuffer.h>
#include "version.h"

#define DEBUG
//ESP32 PINS TO CONTROL LAN8720
// #define DEBUG
// ESP32 PINS TO CONTROL LAN8720
#define ETH_CLK_MODE_1 ETH_CLOCK_GPIO17_OUT
#define ETH_POWER_PIN_ALTERNATIVE_1 5
#define ETH_POWER_PIN_1 -1
#define ETH_TYPE_1 ETH_PHY_LAN8720
#define ETH_ADDR_1 0
#define ETH_MDC_PIN_1 23
#define ETH_MDIO_PIN_1 18
//ESP32 PINS TO CONTROL CC2652P
// ESP32 PINS TO CONTROL CC2652P
#define CC2652P_RST 16
#define CC2652P_FLSH 32
#define CC2652P_RXD 36
Expand All @@ -26,13 +26,24 @@
#define TCP_LISTEN_PORT 9999
#define FORMAT_LITTLEFS_IF_FAILED true

const int16_t overseerInterval = 10 * 1000; //check lan or wifi connection every 5sec
const uint8_t overseerMaxRetry = 3; //5x12 = 60sec delay for AP start
const uint8_t LED_RED = 12;
const uint8_t LED_BLUE = 14;

// CC2652 settings
#define BSL_PIN 15 // CC2652 pin number
#define BSL_LEVEL 0 //0-LOW 1-HIGH


const int16_t overseerInterval = 10 * 1000; // check lan or wifi connection every 5sec
const uint8_t overseerMaxRetry = 3; // 5x12 = 60sec delay for AP start
const uint8_t LED_USB = 12; // RED
const uint8_t LED_PWR = 14; // BLUE
const uint8_t MAX_SOCKET_CLIENTS = 5;

enum COORDINATOR_MODE_t : uint8_t {COORDINATOR_MODE_LAN, COORDINATOR_MODE_WIFI, COORDINATOR_MODE_USB};
enum COORDINATOR_MODE_t : uint8_t
{
COORDINATOR_MODE_LAN,
COORDINATOR_MODE_WIFI,
COORDINATOR_MODE_USB
};

// struct JsonConsts_t{
// char* str;
Expand All @@ -41,7 +52,8 @@ enum COORDINATOR_MODE_t : uint8_t {COORDINATOR_MODE_LAN, COORDINATOR_MODE_WIFI,
// "sadasd"
// };

struct ConfigSettingsStruct{
struct ConfigSettingsStruct
{
char ssid[50];
char password[50];
char ipAddressWiFi[18];
Expand All @@ -65,17 +77,31 @@ struct ConfigSettingsStruct{
bool webAuth;
char webUser[50];
char webPass[50];
bool disableLedBlue;
bool disableLedYellow;
//bool disablePingCtrl;
bool disableLedUSB;
bool disableLedPwr;
// bool disablePingCtrl;
bool disableLeds;
COORDINATOR_MODE_t coordinator_mode;
COORDINATOR_MODE_t prevCoordinator_mode;//for button
COORDINATOR_MODE_t prevCoordinator_mode; // for button
bool keepWeb;
bool apStarted;
bool wifiWebSetupInProgress;
bool fwEnabled;
IPAddress fwIp;
bool mqttEnable;
char mqttServer[50];
IPAddress mqttServerIP;
int mqttPort;
char mqttUser[50];
char mqttPass[50];
char mqttTopic[50];
// bool mqttRetain;
int mqttInterval;
bool mqttDiscovery;
unsigned long mqttReconnectTime;
unsigned long mqttHeartbeatTime;
bool zbLedState;
bool zbFlashing;
};

struct InfosStruct
Expand All @@ -85,13 +111,23 @@ struct InfosStruct
char flash[8];
};

struct zbVerStruct
{
uint32_t zbRev;
uint8_t maintrel;
uint8_t minorrel;
uint8_t majorrel;
uint8_t product;
uint8_t transportrev;
};

typedef CircularBuffer<char, 8024> LogConsoleType;

//#define WL_MAC_ADDR_LENGTH 6
// #define WL_MAC_ADDR_LENGTH 6

#ifdef DEBUG
#define DEBUG_PRINT(x) Serial.print(x)
#define DEBUG_PRINTLN(x) Serial.println(x)
#define DEBUG_PRINT(x) Serial.print(String(x))
#define DEBUG_PRINTLN(x) Serial.println(String(x))
#else
#define DEBUG_PRINT(x)
#define DEBUG_PRINTLN(x)
Expand Down
Loading

0 comments on commit cea0ce3

Please sign in to comment.