Skip to content
This repository has been archived by the owner on May 10, 2024. It is now read-only.

Commit

Permalink
0.6.5
Browse files Browse the repository at this point in the history
- MQTT Discovery for OneWire (DSB18B20) fixed

- Add pop up at main page if any ESP32 firware update available

- Add ability to update directly from GitHub without downloading file to PC

0.6.4

- Fix version number

- Fix web interface rendering error
  • Loading branch information
xyzroe committed May 23, 2022
1 parent d32f09b commit cc3157b
Show file tree
Hide file tree
Showing 16 changed files with 378 additions and 212 deletions.
43 changes: 36 additions & 7 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -23,23 +23,23 @@ This firmware delevoped to use with [ZigStar LAN Gateway](https://github.com/mer
### ZigStarGW-XXXX/**avty**
Contains the current state of the gateway connection to the MQTT broker.
When a connection is established, the payload ```online``` is published.

Using the Last Will and Testament (LWT) mechanism, if the connection is broken,
the MQTT broker will publish ```offline``` payload within 30 seconds.

### ZigStarGW-XXXX/**state**
Contains information about the gateway.
Contains information about the gateway.
Publish every N seconds. It is set in the MQTT setting - "Update interval".
Payload example:
```{"uptime":"0 d 00:00:08","temperature":"45.67","ip":"10.0.10.130","emergencyMode":"ON","hostname":"ZigStarGW"}```

### ZigStarGW-XXXX/**cmd**
Publishing messages to this topic allows you to control your gateway via MQTT.
Publishing messages to this topic allows you to control your gateway via MQTT.
Possible commands:
```{cmd:"rst_zig"}``` - restart Zigbee module
```{cmd:"rst_esp"}``` - restart ESP32
```{cmd:"enbl_bsl"}``` - enable BSL in Zigbee module

### ZigStarGW-XXXX/io/**rst_zig**, **rst_esp**, **enbl_bsl**, **emrgncMd**

Status topics contain the current state of various operating modes of the gateway.
Expand All @@ -48,11 +48,11 @@ Possible states: ```ON``` or ```OFF```
<br><br>

<table>
<tr>
<tr>
<td width="70%">

## Auto Discovery
There is also a MQTT AutoDiscovery function.
There is also a MQTT AutoDiscovery function.
The following entities are available:
- homeassistant/sensor/*
- Uptime
Expand All @@ -66,7 +66,7 @@ The following entities are available:
- Restart ESP
- Restart Zigbee
- Enable BSL


In the Home Assistant, in the device information section, the board model and software version will also be available.
</td>
Expand All @@ -85,6 +85,35 @@ In the Home Assistant, in the device information section, the board model and so
![](https://github.com/xyzroe/ZigStarGW-FW/raw/main/images/update.png)


### Development

Project's build environment is based on [PlatformIO](http://platformio.org).
So just open platformio.ini using it.

After build PlatformIO will generate 2 file in bin folder:
ZigStarGW_v*.*.*.full.bin - with integrated bootloader and partitions table
bin/ZigStarGW.bin - just firmware.

Version increment made automatically by using version_increment_pre.py calling from PlatformIO and version_increment_post.py calling while Git pre commit.
Use make_git_hook.sh to made it automatically.


You can not simply edit Web UI files because you will need to convert them to C arrays, which can be done automatically by a gulp script that can be found in ```tools/webfilesbuilder``` directory.

If you want to edit Web UI you will need:
* NodeJS
* npm (comes with NodeJS installer)
* Gulp (can be installed with npm)

Gulp script also minifies CSS and JS files and compresses (gzip) them.

To minify and compress the frontend, enter the folder ```tools/webfilesbuilder``` and:
* Run ```npm install``` to install dependencies
* Run ```npx gulp``` to compress the web UI to make it ready for the ESP



#### Thanks

Base code was taken from [ZiGate-Ethernet](https://github.com/fairecasoimeme/ZiGate-Ethernet)

Expand Down
1 change: 0 additions & 1 deletion TASK-LIST.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@
- auto recoonect to wifi if no wifi at start. not run AP first.
- -0.06 celsion with no onewire, add right init and checks

- Add configuartions for Ebyte revisions ?
- mDNS auto window opener?


Expand Down
4 changes: 2 additions & 2 deletions src/Version.h
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@

// AUTO GENERATED FILE, DO NOT EDIT
#ifndef VERSION
#define VERSION "0.6.4"
#define VERSION "0.6.5"
#endif
#ifndef BUILD_TIMESTAMP
#define BUILD_TIMESTAMP "2022-01-31 02:16:42.845206"
#define BUILD_TIMESTAMP "2022-01-31 16:35:26.112890"
#endif

10 changes: 5 additions & 5 deletions src/etc.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -26,20 +26,20 @@ void oneWireBegin()
sensor.begin();
}

void oneWireRead(String &DStemp)
float oneWireRead()//String &DStemp)
{
sensor.requestTemperatures();
float tempC = sensor.getTempC();
DEBUG_PRINTLN(tempC);
if(tempC != DEVICE_DISCONNECTED_C)
if(tempC != DEVICE_DISCONNECTED_C && tempC != 0.0)
{
DEBUG_PRINTLN(F("oneWire OK"));
DStemp = tempC;
return tempC;
}
else
{
DEBUG_PRINTLN(F("oneWire error"));
DStemp = 255;
DEBUG_PRINTLN(F("oneWire not found"));
return false;
}
}

Expand Down
2 changes: 1 addition & 1 deletion src/etc.h
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ uint8_t temprature_sens_read();
uint8_t temprature_sens_read();

void oneWireBegin();
void oneWireRead(String &DStemp);
float oneWireRead();//String &DStemp);

void getCPUtemp(String &CPUtemp);
void getBlankCPUtemp(String &CPUtemp);
Expand Down
14 changes: 12 additions & 2 deletions src/html.h
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ const char HTTP_HEADER[] PROGMEM =
"<script type='text/javascript' src='/js/jquery-min.js'></script>"
"<script type='text/javascript' src='/js/bootstrap.min.js'></script>"
"<script type='text/javascript' src='/js/functions.js'></script>"
"<script type='text/javascript' src='/js/toast.js'></script>"
"<script>function logoutButton() {"
"var xhr = new XMLHttpRequest();"
"xhr.open('GET', '/logout', true);"
Expand Down Expand Up @@ -217,6 +218,7 @@ const char HTTP_GENERAL[] PROGMEM =

const char HTTP_ROOT[] PROGMEM =
"<h2>{{pageName}}</h2>"
"<script language='javascript'>checkLatestRelease();</script>"
"<div id='main' class='col-sm-12'>"
"<div id='main' class='col-sm-6'>"
"<div class='card'>"
Expand All @@ -227,7 +229,7 @@ const char HTTP_ROOT[] PROGMEM =
"<br><strong>Uptime : </strong>{{uptime}}"
"<br><strong>ESP temperature : </strong>{{deviceTemp}} &deg;C"
"{{dsTemp}}"
"<br><strong>FW version : </strong>" VERSION
"<br><strong id='ver' v=" VERSION ">FW version : </strong>" VERSION
"<br><strong>Hardware : </strong>{{hwRev}}"
"<br><strong>ESP32 model : </strong>{{espModel}}"
"<br><strong>CPU : </strong>{{espCores}} cores @ {{espFreq}} MHz"
Expand Down Expand Up @@ -280,12 +282,20 @@ const char HTTP_UPDATE[] PROGMEM =
"</div>"
"<pre id=releasebody>Getting update information from GitHub...</pre>"
"<div class='pull-right' style='text-align: center;'>"
"<a class='pull-right' id='downloadupdate'>"
"<a class='pull-right' id='webupdate' href='/web_update'>"
"<button type='button' class='btn btn-warning'>Online update</button>"
"</a>"
"<a style='margin-left: 40px;' class='pull-right' id='downloadupdate'>"
"<button type='button' class='btn btn-success'>Download</button>"
"</a>"
"</div>"
"</div>"
"</div>"
"<div id='update_info'>"
"<h5>Clicking the Online update button will start the update process directly from GitHub.</h5>"
"<h6>At the moment, the progress of the online update is not displayed - you need to wait until the device restarts."
"</h6>"
"</div>"
"<div style='clear:both;'>"
"<br>"
"</div>"
Expand Down
Loading

0 comments on commit cc3157b

Please sign in to comment.