Skip to content

Commit

Permalink
20240330
Browse files Browse the repository at this point in the history
Hardware:
- MDNS changed to _xzg
- MDNS add option "board" for HW indenfication
- Default hostname changed to "XZG"

Web UI:
- Fix min-width for system settings tabs
- Remove auto close side tab on mobile
- Fix logiut button style
- WG page to VPN
- Add Hursanet options to VPN page
- Add Hursenet card to root page
- Wifi page to Network
- Add Ethernet options to Network page
- Made Ethernet and WiFi card to be hide if interface is disabled
- Add sticky navbar on top of page with logo, page name
- Add current DNS server on Ethernet and WiFi cards
- Add status icons to navbar
- Mobile:
  - rework side nav
  - open by any swip or tap on logo
  - close by any tap anywhere

Build and develope:
- Reworked Github Action to suppport multiline desctiption in release notes
- Reworked commit.sh, add clean commit.md at finish

Docs:

Code:
- Full rework configs srtucture
- Change config storage from json files on LittleFS to NVS flash Preferences (support migrating)
- Setup proccess reworked and faster now
- Changed WG library
- Add WG connection state
- Add Ethernet and WiFi custom DNS, while no DHCP
  • Loading branch information
xyzroe committed Mar 30, 2024
1 parent ff36409 commit a8594d0
Show file tree
Hide file tree
Showing 75 changed files with 4,308 additions and 7,341 deletions.
79 changes: 50 additions & 29 deletions .github/workflows/workflow.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: Build, release, update
name: Build, release, push

permissions:
contents: write
Expand All @@ -7,10 +7,10 @@ on:
workflow_dispatch:
push:
tags:
- 'v*' # Push events to matching v*, i.e. v1.0, v20.15.10
- '*' # Push events to matching *, any

jobs:
build_firmware:
build_release_push:
runs-on: ubuntu-latest
steps:
- name: Clone repository
Expand All @@ -20,58 +20,79 @@ jobs:
uses: actions/setup-node@v3
with:
node-version: 18

- uses: actions/cache@v3
with:
path: |
~/.cache/pip
~/.platformio/.cache
key: ${{ runner.os }}-pio

- name: Install Python
uses: actions/setup-python@v4
with:
python-version: '3.9'

- name: Install PlatformIO Core
run: pip install --upgrade platformio==6.1.11

- name: Build PlatformIO Project
run: pio run

- name: Get Release Version
id: get_version
shell: bash
run: |
value=`cat tools/version`
value=$(grep '#define VERSION' src/version.h | awk -F '"' '{print $2}')
echo "version=$value" >> $GITHUB_OUTPUT
- 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}"
echo "commitMessage<<EOF" >> $GITHUB_ENV
echo "$commitMessage" >> $GITHUB_ENV
echo "EOF" >> $GITHUB_ENV
- name: Calculate SHA-256 hash of the firmware
id: sha256_hash
run: |
echo "sha256=$(sha256sum bin/XZG_${{ steps.get_version.outputs.version }}.full.bin | awk '{print $1}')" >> $GITHUB_OUTPUT
- name: Get size of the firmware
id: firmware_size
run: |
echo "size=$(stat -c %s bin/XZG_${{ steps.get_version.outputs.version }}.full.bin)" >> $GITHUB_OUTPUT
- name: Create manifest.json for ESP Web Tools
run: |
cat << EOF > manifest.json
{
"name": "XZG Firmware",
"version": "${{ steps.get_version.outputs.version }}",
"files": [
{
"path": "XZG_${{ steps.get_version.outputs.version }}.full.bin",
"type": "app",
"lzma": false,
"address": "0x0",
"sha256": "${{ steps.sha256_hash.outputs.sha256 }}",
"size": ${{ steps.firmware_size.outputs.size }},
"url": "https://github.com/${{ github.repository }}/releases/download/${{ steps.get_version.outputs.version }}/XZG_${{ steps.get_version.outputs.version }}.full.bin"
}
],
"chipFamily": "ESP32"
}
EOF
echo "Manifest file created."
- name: Release
uses: softprops/action-gh-release@v1
with:
generate_release_notes: false
name: "v${{ steps.get_version.outputs.version }} (${{ steps.date.outputs.date }})"
body: ${{ steps.get_commit_message.outputs.message }}
name: "${{ steps.get_version.outputs.version }}"
body: ${{ env.commitMessage }}
files: |
bin/XZG.bin
bin/XZG_v${{ steps.get_version.outputs.version }}.full.bin
- name: Updare version in manifest.json
run: |
sed -r 's/v[0-9]{1,4}\.[0-9]{1,4}\.[0-9]{1,4}/v${{ steps.get_version.outputs.version }}/g' manifest.json > new.manifest.json
- name: Move file
shell: bash
run: |
echo "old"
cat manifest.json
mv -f new.manifest.json manifest.json
echo "new"
cat manifest.json
- name: Commit & Push changes
uses: actions-js/push@master
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
message: 'Release v${{ steps.get_version.outputs.version }} (${{ steps.date.outputs.date }})'
bin/XZG_${{ steps.get_version.outputs.version }}.ota.bin
bin/XZG_${{ steps.get_version.outputs.version }}.full.bin
manifest.json
4 changes: 4 additions & 0 deletions .gitmodules
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
[submodule "lib/WireGuard"]
path = lib/WireGuard
url = https://github.com/Tinkerforge/WireGuard-ESP32-Arduino
branch = main
8 changes: 4 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,15 +15,15 @@ Firmware is opensource, so feel free to improve it <br> by making a commit to th


### 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](https://github.com/xyzroe/ZigStarGW-FW/releases/latest) | [XZG](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) |
| [![ZigStarGW-FW's download](https://img.shields.io/github/downloads/xyzroe/ZigStarGW-FW/total.svg)](https://github.com/xyzroe/ZigStarGW-FW/releases/latest) | [![XZG Firmware's download](https://img.shields.io/github/downloads/mercenaruss/uzg-firmware/total.svg)](https://github.com/mercenaruss/uzg-firmware/releases/latest) | [![XZG 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`;
- Adapter mode selector through web-interface: `Zigbee-to-Network` or `Zigbee-to-USB`;
- Support mDNS autodiscovery in your network (go in the browser to `uzg-01.local`), in Zigbee2MQTT (set `port: mdns://uzg-01`), and in ZHA;
- Secure login through username and password;
- Zigbee2MQTT and ZHA config helper;
Expand Down Expand Up @@ -75,7 +75,7 @@ You can contribute to XZG Firmware by

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

- [@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.
- [@mercenaruss](https://github.com/mercenaruss/) for **Zig Star devices development**, for initial firmware release of XZG 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/)

Expand Down
Binary file added bin/XZG_20240330.full.bin
Binary file not shown.
Binary file added bin/XZG_20240330.ota.bin
Binary file not shown.
16 changes: 8 additions & 8 deletions lib/CCTools/src/CCTools.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -310,14 +310,14 @@ void CCTools::enterBSL()
{
digitalWrite(_CC_RST_PIN, LOW);
digitalWrite(_CC_BSL_PIN, LOW);
DEBUG_PRINTLN(F("Zigbee RST pin ON"));
DEBUG_PRINTLN(F("Zigbee BSL pin ON"));
//DEBUG_PRINTLN(F("Zigbee RST pin ON"));
//DEBUG_PRINTLN(F("Zigbee BSL pin ON"));
delay(250);
digitalWrite(_CC_RST_PIN, HIGH);
DEBUG_PRINTLN(F("Zigbee RST pin OFF"));
//DEBUG_PRINTLN(F("Zigbee RST pin OFF"));
delay(1000);
digitalWrite(_CC_BSL_PIN, HIGH);
DEBUG_PRINTLN(F("Zigbee BSL pin OFF"));
//DEBUG_PRINTLN(F("Zigbee BSL pin OFF"));
delay(1000);
}
// Other modes BSL_MODE can be added later
Expand All @@ -326,20 +326,20 @@ void CCTools::enterBSL()
void CCTools::restart()
{
digitalWrite(_CC_RST_PIN, LOW);
DEBUG_PRINTLN(F("Zigbee RST pin ON"));
//DEBUG_PRINTLN(F("Zigbee RST pin ON"));
delay(250);
digitalWrite(_CC_RST_PIN, HIGH);
DEBUG_PRINTLN(F("Zigbee RST pin OFF"));
//DEBUG_PRINTLN(F("Zigbee RST pin OFF"));
delay(1000);
}

void CCTools::routerRejoin()
{
digitalWrite(_CC_BSL_PIN, LOW);
DEBUG_PRINTLN(F("ZB BSL pin ON"));
//DEBUG_PRINTLN(F("ZB BSL pin ON"));
delay(250);
digitalWrite(_CC_BSL_PIN, HIGH);
DEBUG_PRINTLN(F("ZB BSL pin OFF"));
//DEBUG_PRINTLN(F("ZB BSL pin OFF"));
delay(500);
}
String CCTools::detectChipInfo()
Expand Down
1 change: 1 addition & 0 deletions lib/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
git submodule update --recursive --remote
1 change: 1 addition & 0 deletions lib/WireGuard
Submodule WireGuard added at 58de5d
1 change: 0 additions & 1 deletion lib/WireGuard-ESP32/.gitignore

This file was deleted.

1 change: 0 additions & 1 deletion lib/WireGuard-ESP32/.piopm

This file was deleted.

28 changes: 0 additions & 28 deletions lib/WireGuard-ESP32/LICENSE

This file was deleted.

57 changes: 0 additions & 57 deletions lib/WireGuard-ESP32/README.md

This file was deleted.

Loading

0 comments on commit a8594d0

Please sign in to comment.