Skip to content

Commit

Permalink
v1.0.1
Browse files Browse the repository at this point in the history
Hardware:
 - Multi board support

Web UI:
- Add Dark & Light themes
- Add dinamic render cards on root page
- Add MQTT stats card to root page
- Mobile version: Fix header color
- Multi board support (finish 10%)
- New logo and favico (SVG)

Build and develope:
- Add purgecss to clean CSS
- Add nanocss to mini CSS
- Rework tools dir
- Update CircularBuffer
- Add auto release notes from last commit
- Add verison number to commit message

Docs
- Readme basic modifications
- Contributing and code of conduct updated
  • Loading branch information
xyzroe committed Mar 25, 2024
1 parent d68f7a6 commit c78985c
Show file tree
Hide file tree
Showing 52 changed files with 3,644 additions and 12,320 deletions.
13 changes: 9 additions & 4 deletions .github/workflows/workflow.yml
Original file line number Diff line number Diff line change
Expand Up @@ -44,14 +44,20 @@ jobs:
- name: Get current date
id: date
run: echo "date=$(date +'%d%m%y')" >> $GITHUB_OUTPUT
- name: Get last commit message
id: get_commit_message
run: |
commitMessage=$(git log -1 --pretty=%B | tail -n +3)
echo "::set-output name=message::${commitMessage}"
- name: Release
uses: softprops/action-gh-release@v1
with:
generate_release_notes: true
generate_release_notes: false
name: "v${{ steps.get_version.outputs.version }} (${{ steps.date.outputs.date }})"
body: ${{ steps.get_commit_message.outputs.message }}
files: |
bin/UZG-01.bin
bin/UZG-01_v${{ steps.get_version.outputs.version }}.full.bin
bin/XZG.bin
bin/XZG_v${{ steps.get_version.outputs.version }}.full.bin
- name: Updare version in manifest.json
run: |
Expand All @@ -64,7 +70,6 @@ jobs:
mv -f new.manifest.json manifest.json
echo "new"
cat manifest.json
- name: Commit & Push changes
uses: actions-js/push@master
with:
Expand Down
6 changes: 4 additions & 2 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,8 @@ gzipped
webh
*.code-workspace
logs
todo
todo*
!lib
!platformio.ini
!platformio.ini
**/__pycache__
tools/.no_web_update*
17 changes: 0 additions & 17 deletions CHANGELOG.md

This file was deleted.

2 changes: 1 addition & 1 deletion CODE_OF_CONDUCT.md
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ This Code of Conduct applies both within project spaces and in public spaces whe

## Enforcement

Instances of abusive, harassing, or otherwise unacceptable behavior may be reported by contacting the project team at [email protected]. The project team will review and investigate all complaints, and will respond in a way that it deems appropriate to the circumstances. The project team is obligated to maintain confidentiality with regard to the reporter of an incident. Further details of specific enforcement policies may be posted separately.
Instances of abusive, harassing, or otherwise unacceptable behavior may be reported by contacting the project team. The project team will review and investigate all complaints, and will respond in a way that it deems appropriate to the circumstances. The project team is obligated to maintain confidentiality with regard to the reporter of an incident. Further details of specific enforcement policies may be posted separately.

Project maintainers who do not follow or enforce the Code of Conduct in good faith may face temporary or permanent repercussions as determined by other members of the project's leadership.

Expand Down
15 changes: 8 additions & 7 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
# Contributing

**Any contribution helps our team and makes ZigStar UZG better for the entire community!**
**Any contribution helps our team and makes XZG Firmware better for the entire community!**

Everybody is welcome and invited to contribute to UZG Project by:
Everybody is welcome and invited to contribute to XZG Firmware project by:

* Testing newly released features and reporting issues.
* Providing Pull Requests (Features, Proof of Concepts, Language files or Fixes)
* Contributing missing documentation for features and devices in our [documentation](https://uzg.zig-star.com)
* Providing Pull Requests (Features, Proof of Concepts, Language files or Fixes).
* Contributing missing documentation for features.

This document describes rules that are in effect for this repository, meant for handling issues by contributors in the issue tracker and PRs.

Expand Down Expand Up @@ -42,10 +42,11 @@ A Pull Request (PR) is the process where code modifications are managed in GitHu
The process is straight-forward.

- Read [How to get faster PR reviews](https://github.com/kubernetes/community/blob/master/contributors/guide/pull-requests.md#best-practices-for-faster-reviews) by Kubernetes (but skip step 0)
- Fork the [Git repository](https://github.com/mercenaruss/uzg-firmware).
- Write/Change the code in your Fork for a new feature, bug fix, new sensor, optimization, etc.
- Fork the [XZG repository](https://github.com/xyzroe/XZG).
- Create new branch for your modifications.
- Write/Change the code in your fork for a new feature, bug fix, new sensor, optimization, etc.
- Ensure tests work.
- Create a Pull Request against the [**development**](https://github.com/mercenaruss/uzg-firmware/tree/dev) branch of uzg-firmware.
- Create a Pull Request against the your branch to [XZG repository](https://github.com/xyzroe/XZG).

1. All pull requests must be done against the development branch.
2. Only relevant files should be touched (Also beware if your editor has auto-formatting feature enabled).
Expand Down
73 changes: 53 additions & 20 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,14 +1,26 @@
# ZigStar UZG-01 Zigbee 3.0 PoE Ethernet USB Adapter's Firmware
# XZG Firmware
<div align="center"><img src="src/websrc/img/logo.svg" width="128" height="128" alt="XZG logo">

This repository contains the firmware for various, ESP32 based, Zigbee gateways.

Firmware is opensource, so feel free to improve it <br> by making a commit to this repository.
</div>

[![GitHub version](https://img.shields.io/github/release/xyzroe/xzg.svg)](https://github.com/xyzroe/xzg/releases)
[![GitHub download](https://img.shields.io/github/downloads/xyzroe/xzg/total.svg)](https://github.com/xyzroe/xzg/releases/latest)
[![License](https://img.shields.io/github/license/xyzroe/xzg.svg)](LICENSE)

This repository contains the latest firmware for the ESP32 peripheral module of [UZG-01 Zigbee Ethernet PoE USB Adapter](https://uzg.zig-star.com/product). Firmware is opensource, so feel free to improve it by making a commit to this repository.

[![GitHub version](https://img.shields.io/github/release/mercenaruss/uzg-firmware.svg)](https://github.com/mercenaruss/uzg-firmware/releases)
[![GitHub download](https://img.shields.io/github/downloads/mercenaruss/uzg-firmware/total.svg)](https://github.com/mercenaruss/uzg-firmware/releases/latest)
[![License](https://img.shields.io/github/license/mercenaruss/uzg-firmware.svg)](LICENSE.txt)
[![Gitpod Ready-to-Code](https://img.shields.io/badge/Gitpod-Ready--to--Code-blue?logo=gitpod)](https://github.com/mercenaruss/uzg-firmware)



### Previous versions:
| [ZigStarGW-FW](https://github.com/xyzroe/ZigStarGW-FW/releases/latest) | [UZG-01](https://github.com/mercenaruss/uzg-firmware/releases/latest) | [SLZB-06](https://github.com/smlight-dev/slzb-06-firmware/releases/) |
| ----------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| [![ZigStarGW-FW's download](https://img.shields.io/github/downloads/xyzroe/ZigStarGW-FW/total.svg)](https://github.com/xyzroe/ZigStarGW-FW/releases/latest) | [![UZG-01 Firmware's download](https://img.shields.io/github/downloads/mercenaruss/uzg-firmware/total.svg)](https://github.com/mercenaruss/uzg-firmware/releases/latest) | [![UZG-01 Firmware's download](https://img.shields.io/github/downloads/smlight-dev/slzb-06-firmware/total.svg)](https://github.com/smlight-dev/slzb-06-firmware/releases/latest) |



## KEY FIRMWARE FEATURES
- Change Ethernet/USB adapter mode through firmware or by physical button short press (Red LED On = USB mode, RED LED Off = Ethernet mode);
- Adapter mode selector through web-interface: `Zigbee-to-Ethernet`, `Zigbee-to-USB` and `Zigbee-to-WiFI`;
Expand All @@ -26,32 +38,49 @@ This repository contains the latest firmware for the ESP32 peripheral module of
- MQTT client for gateway monitoring and control

## Installation and Configuration
Please refer to the installation and configuration articles in our [documentation](https://uzg.zig-star.com).
Please follow this link for web-flasher - just plug-and-flash: [ZigStar WebFlasher](https://uzg.zig-star.com/webinstall/).
Please refer to the installation and configuration articles based on your hardware.

Please follow this link for web-flasher - just plug-and-flash: [XZG Web flasher 🚀](https://xzg.xyzroe.cc/)

## Compiling from source

If you made changes to the code and want to compile you own firmware, please do the following:
### Local

- You need npm and Python installed;
- Download this repository;
- Install Visual Studio Code (VSC);
- Install PlatformIO extension to VSC;
- Press "PlatformIO: Build" and wait until XZG*.bin is generated;

### Github
- Fork this repository;
- Made your changes;
- Push a new tag in format "vX.X.X" to run workflow;
- Just wait and get new release;

### Gitpod
[![Gitpod Ready-to-Code](https://img.shields.io/badge/Gitpod-Ready--to--Code-blue?logo=gitpod)](https://github.com/xyzroe/xzg)



- Download repository;
- Install Microsoft Visual Code (MVC);
- Install PlatformIO extension to MVC;
- Press "PlatformIO: Build" and wait until firmware.bin is generated;

## Contribute

You can contribute to UZG-01 Firmware by
- Providing Pull Requests (Features, Proof of Concepts or Fixes) - please read UZG-01 Firmware's contributing approach [here](CONTRIBUTING.md)
You can contribute to XZG Firmware by
- Providing Pull Requests - please read contributing approach [here](CONTRIBUTING.md)
- Testing newly released features and reporting issues
- Contributing missing [documentation](https://uzg.zig-star.com);
- Contributing missing documentation

## Credits

People helping to keep the show on the road - **developers and contributors**:

- [@xyzroe](https://github.com/xyzroe/) for initial firmware released for ZigStar devices and all work being doing till now
- [@mercenaruss](https://github.com/mercenaruss/) for **Zig Star devices development**, for initial firmware release of UZG-01 version and giving me motivation and energy to implement new functions.

- [@Tarik2142](https://github.com/Tarik2142) for refactoring, code optimizations done under [smlight-dev](https://github.com/smlight-dev/)

- **TO-DO** - add all contributors automatic **HERE**!


Special thanks goes also to all authors of 3rd party libraries which are used in this project:

Expand All @@ -70,9 +99,13 @@ Special thanks goes also to all authors of 3rd party libraries which are used in
- [ESP Async WebServer](https://github.com/me-no-dev/ESPAsyncWebServer),
- [Martin-Laclaustra / CronAlarms](https://github.com/Martin-Laclaustra/CronAlarms)


## License and attribution

UZG-01-Firmware is licensed under GNU General Public License v3.
3rd party libraries that are used by this project are licensed under different license schemes, please check them out as well.
Copyright (c) 2023 ZigStar.
**XZG Firmware** is licensed under **GNU General Public License v3**.

3rd party libraries that are used by this project are licensed under different license schemes, please check them out as well.

Copyright (c) 2024 xyzroe

The GNU General Public License v3 ensures that if you use any part of this software in any way, your software must be released under the same license.
Binary file added bin/XZG.bin
Binary file not shown.
Binary file added bin/XZG_v1.0.1.full.bin
Binary file not shown.
3 changes: 2 additions & 1 deletion lib/WireGuard-ESP32/src/wireguardif.c
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,8 @@
#include "wireguard.h"
#include "crypto.h"
#include "esp_log.h"
#include "tcpip_adapter.h"
//#include "tcpip_adapter.h"
#include "esp_netif.h"

#include "esp32-hal-log.h"

Expand Down
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",
"name": "XZG",
"version": "v0.2.5",
"builds": [
{
"chipFamily": "ESP32",
"improv": false,
"parts": [
{ "path": "bin/UZG-01_v0.2.5.full.bin", "offset": 0 }
{ "path": "bin/XZG_v0.2.5.full.bin", "offset": 0 }
]
}
]
Expand Down
12 changes: 6 additions & 6 deletions platformio.ini
Original file line number Diff line number Diff line change
Expand Up @@ -27,20 +27,20 @@ default_envs = prod-solo
framework = arduino
lib_deps =
bblanchon/[email protected]
rlogiacco/CircularBuffer@>=1.3.3
plerup/[email protected]
marian-craciunescu/ESP32Ping@>=1.7
rlogiacco/CircularBuffer@>=1.4.0
sstaub/Ticker@>=4.4.0
knolleary/PubSubClient@^2.8
ESP Async WebServer
Martin-Laclaustra/CronAlarms
;plerup/[email protected]
;marian-craciunescu/ESP32Ping@>=1.7
;me-no-dev/[email protected]
monitor_filters = esp32_exception_decoder, default ;, log2file
monitor_speed = 115200
upload_speed = 460800
extra_scripts =
pre:tools/version_increment_pre.py
pre:tools/build/version_increment_pre.py
pre:tools/webfilesbuilder/build_html.py
post:tools/build.py
post:tools/build/build.py
build_flags =
-DBUILD_ENV_NAME=$PIOENV

Expand Down
49 changes: 36 additions & 13 deletions src/config.h
Original file line number Diff line number Diff line change
Expand Up @@ -17,15 +17,18 @@
#define ETH_MDIO_PIN_1 18
*/
// ESP32 PINS TO CONTROL CC2652P
#define CC2652P_RST 16
#define CC2652P_FLASH 32
#define CC2652P_RXD 36
#define CC2652P_TXD 4
#define BTN 35
#define MODE_SWITCH 33
// #define CC2652P_RST 16
// #define CC2652P_FLASH 32
// #define CC2652P_RXD 36
// #define CC2652P_TXD 4
// #define BTN 35
// #define MODE_SWITCH 33

#define DEBOUNCE_TIME 70

#define TCP_LISTEN_PORT 9999
#define TCP_LISTEN_PORT 9999 // any port ever. later setup from config file
#define MAX_SOCKET_CLIENTS 5

#define FORMAT_LITTLEFS_IF_FAILED true

// CC2652 settings (FOR BSL VALIDATION!)
Expand All @@ -34,9 +37,8 @@

const int16_t overseerInterval = 5 * 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;
// const uint8_t LED_USB = 12; // RED
// const uint8_t LED_PWR = 14; // BLUE

enum COORDINATOR_MODE_t : uint8_t
{
Expand All @@ -45,8 +47,8 @@ enum COORDINATOR_MODE_t : uint8_t
COORDINATOR_MODE_USB
};

extern const char *coordMode;// coordMode node name
extern const char *prevCoordMode;// prevCoordMode node name
extern const char *coordMode; // coordMode node name
extern const char *prevCoordMode; // prevCoordMode node name
extern const char *configFileSystem;
extern const char *configFileWifi;
extern const char *configFileEther;
Expand All @@ -56,7 +58,7 @@ extern const char *configFileSerial;
extern const char *configFileMqtt;
extern const char *configFileWg;
extern const char *configFileHw;
extern const char *deviceModel;
// extern const char *deviceModel;

struct ConfigSettingsStruct
{
Expand Down Expand Up @@ -103,6 +105,7 @@ struct ConfigSettingsStruct
struct MqttSettingsStruct
{
bool enable;
bool connect = 0;
char server[50];
IPAddress serverIP;
int port;
Expand Down Expand Up @@ -155,8 +158,28 @@ typedef CircularBuffer<char, 8024> LogConsoleType;
#ifdef DEBUG
#define DEBUG_PRINT(x) Serial.print(String(x))
#define DEBUG_PRINTLN(x) Serial.println(String(x))


#define LOGE(tag, format, ...) Serial.printf("[%s] " format " (%s:%d)\n", tag, ##__VA_ARGS__, __FILE__, __LINE__)
#define LOGI(tag, format, ...) Serial.printf("[%s] " format "\n", tag, ##__VA_ARGS__)

/*
LOGE("ZB", "%u - %s", 1, "test");
LOGI("ZB", "%u - %s", 1, "test");
[ZB] 1 - test (src/main.cpp:1374)
[ZB] 1 - test
*/

#else
#define DEBUG_PRINT(x)
#define DEBUG_PRINTLN(x)
#define LOGE(f_, ...)
#define LOGI(f_, ...)
#endif
#endif




Loading

0 comments on commit c78985c

Please sign in to comment.