Cleaning README.md
This commit is contained in:
parent
69acac038d
commit
1e80645293
1 changed files with 43 additions and 39 deletions
82
README.md
82
README.md
|
|
@ -13,7 +13,7 @@ All firmware supports any of these sensors: CHT8215 (CHT8310), CHT8305, AHT20..3
|
|||
**Software for setting up and making BLE OTA: [PHY62x2BTHome.html](https://pvvx.github.io/THB2/web/PHY62x2BTHome.html).**
|
||||
> Uploading OTA files to [PHY62x2BTHome.html](https://pvvx.github.io/THB2/web/PHY62x2BTHome.html) is automatic. You don't need to download files from this repository for OTA.
|
||||
|
||||
> To run [PHY62x2BTHome.html](https://pvvx.github.io/THB2/web/PHY62x2BTHome.html) offline, just copy the [html](https://github.com/pvvx/THB2/blob/master/bthome_phy6222/web/PHY62x2BTHome.html) file to a local folder.
|
||||
> To run [PHY62x2BTHome.html](https://pvvx.github.io/THB2/web/PHY62x2BTHome.html) offline, just copy the [html](bthome_phy6222/web/PHY62x2BTHome.html) file to a local folder.
|
||||
|
||||
## Boot and App firmware
|
||||
|
||||
|
|
@ -30,24 +30,25 @@ The [Boot](#fw-boot-and-ota) firmware has minimal functions. Boot is only used f
|
|||
| [TH05_V1.3](https://pvvx.github.io/TH05-v1.3) | BOOT_TH05D_v17.hex | TH05D_v17.bin | RSH-TH05-V1.3 (chip: BL55072) |
|
||||
| [TH05F](https://pvvx.github.io/TH05F) | BOOT_TH05F_v17.hex | TH05F_v17.bin | TH05Y_V1.1, TH05Y_V1.2 (chip: QD01 2332 NT) |
|
||||
|
||||
The main firmware files, BOOT_XXX_vXX.hex for programming via USB-COM adapter and XXX_vXX.bin for OTA, are located in the [bin](https://github.com/pvvx/THB2/tree/master/bin) directory.
|
||||
The main firmware files, BOOT_XXX_vXX.hex (for programming via USB-COM adapter) and XXX_vXX.bin (for OTA), are located in the [bin](bin) directory.
|
||||
|
||||
Files for updating boot via OTA are located in the [update_boot](https://github.com/pvvx/THB2/tree/master/update_boot) directory. **The process of updating boot via OTA is not safe. Please check the battery level before doing this. If boot is working fine, there is no need to update to the new version. The need to replace boot with a new version will be announced later.**
|
||||
Files for updating boot via OTA are located in the [update_boot](update_boot) directory. **The process of updating boot via OTA is not safe. Please check the battery level before doing this. If boot is working fine, there is no need to update to the new version. The need to replace boot with a new version will be announced later.**
|
||||
|
||||
The current boot version is **v1.7** for devices with CHT8305 sensor. For other variants, boot is not required from version **v1.4**.
|
||||
> The current boot version is **v1.7** for devices with CHT8305 sensor. For other variants, boot is not required from version **v1.4**.
|
||||
|
||||
## Main Features
|
||||
## Main features
|
||||
|
||||
! _With default settings_ !
|
||||
**With default settings**:
|
||||
|
||||
* BLE advertisement interval in [BTHome v2](https://bthome.io) format is 5 seconds.
|
||||
* Humidity and temperature sensor is polled every second BLE advertisement interval - period of 10 seconds.
|
||||
* Battery voltage measurement is done every minute.
|
||||
* Recording of history every 30 minutes.
|
||||
* The button is used for quick connection to old BT adapters. Pressing the button switches the BLE advertising interval to a shorter period (1562.5ms). The action will continue for 60 seconds, then the interval will be restored to the one set in the settings.
|
||||
* The measured average consumption from a 3.3V source when scanning THB2 and BTH01 thermometers in passive mode is up to 8 µA. For TH05_V1.4 the average consumption is about 23 µA - [this is the current of the installed components](https://github.com/pvvx/THB2/issues/8#issuecomment-1908982171). Other versions with screen: with LCD on - 12 to 14 µA, with LCD off - 7 to 12 µA.
|
||||
* Recording of history every 30 minutes
|
||||
* Connection interval with Connect Latency - 900ms
|
||||
* Supported temperature and humidity sensors: AHT30, CHT8305, CHT8215, CHT8310.
|
||||
* The measured average consumption from a 3.3V source when scanning THB2 and BTH01 thermometers in passive mode is up to 8 µA.
|
||||
For TH05_V1.4 the average consumption is about 23 µA ([this is the current of the installed components](https://github.com/pvvx/THB2/issues/8#issuecomment-1908982171)).
|
||||
Other versions with screen: 12 to 14 µA with LCD on and 7 to 12 µA with LCD off.
|
||||
* Connection interval with Connect Latency (900ms).
|
||||
* Handling of input counter contact for transmitted [Open/Close events](https://github.com/pvvx/THB2/issues/10#issuecomment-1935169274)
|
||||
* Processing of output contact switchable by set temperature and/or humidity with hysteresis.
|
||||
* Support low-cost [BLE to Zigbee advertising repeater](https://github.com/pvvx/TLB2Z)
|
||||
|
|
@ -56,20 +57,20 @@ The current boot version is **v1.7** for devices with CHT8305 sensor. For other
|
|||
|
||||
| Version | Description |
|
||||
|---|--- |
|
||||
| 1.0 | First release version |
|
||||
| 1.1 | Added trigger - TX2 output triggered by set temperature and/or humidity values with hysteresis. Transmission of the state of the RX2 output when connected. For thermometers with screen added display of smiley face with "comfort". Added: change of device name and MAC. |
|
||||
| 1.2 | Processing and transmission of open/close events with counter from the output labelled "RX2" (for THB2 - "RX1"). |
|
||||
| 1.3 | Added THB1 and TH05V1.3. Next step to reduce consumption for versions with LCD display and option to switch off the display. | 1.4 | Added THB1 and TH05V1.3.
|
||||
| 1.4 | Connection stabilisation for all device variants. Added [TH05F](https://pvvx.github.io/TH05F). Correction of RTC progress. Changed BLE name for TH05_V1.3 to "TH05D". Added files for OTA Boot update. |
|
||||
| 1.5 | Added option to encrypt BLE ads with BindKey. |
|
||||
| 1.6 | Added averaging of battery voltage calculation, duplication of open/close contact and counter status 12..20 sec (multiple of ad interval) after triggering and then every 30 min. |
|
||||
| 1.7 | Error correction (> 42 C) for sensor CHT8305 |
|
||||
| 1.0 | <ul><li>First release version.</li></ul> |
|
||||
| 1.1 | <ul><li>Added trigger - TX2 output triggered by set temperature and/or humidity values with hysteresis. Transmission of the state of the RX2 output when connected.</li><li>Added display of smiley face with "comfort" for thermometers with screen.</li><li>Changed device name and MAC.</li></ul> |
|
||||
| 1.2 | <ul><li>Processing and transmission of open/close events with counter from the output labelled "RX2" (for THB2 - "RX1").</li></ul> |
|
||||
| 1.3 | <ul><li>Added THB1 and TH05_V1.3.</li><li>Next step is to reduce consumption for versions with LCD display by adding an option to switch off the display.</li></ul>
|
||||
| 1.4 | <ul><li>Stabilized connection for all device variants.</li><li>Added [TH05F](https://pvvx.github.io/TH05F).</li><li>Fixed RTC progress.</li><li>Changed BLE name for TH05_V1.3 to "TH05D".</li><li>Added files for OTA Boot update.</li></ul> |
|
||||
| 1.5 | <ul><li>Added option to encrypt BLE ads with BindKey.</li></ul> |
|
||||
| 1.6 | <ul><li>Added averaging of battery voltage calculation</li><li>Added duplication of open/close contact</li><li>Added counter status 12..20 sec (multiple of ad interval) after triggering and then every 30 min. |
|
||||
| 1.7 | <ul><li>Fixed en error (> 42 C) for sensor CHT8305</li></ul> |
|
||||
|
||||
## Firmware
|
||||
|
||||
It is possible to flash the device with the Boot program via USB-COM adapter with 3.3V outputs.
|
||||
|
||||
1. Connect GND, TX, RX, RTS-RESET, VCC (+3.3B).
|
||||
1. Connect GND, TX, RX, RTS-RESET, VCC (+3.3B):
|
||||
|
||||
| Adapter | Device |
|
||||
|---|---|
|
||||
|
|
@ -81,9 +82,15 @@ It is possible to flash the device with the Boot program via USB-COM adapter wit
|
|||
|
||||
If there is no RST pin on the adapter, then short the RESET pin to GND (-Vbat) and quickly open it when the script starts (it may take a few tries).
|
||||
|
||||
The name of the pins on the device can be found in the description at the links: [THB1](https://pvvx.github.io/THB1), [THB2](https://pvvx.github.io/THB2), [THB3](https://pvvx.github.io/THB3), [BTH01](https://pvvx.github.io/BTH01/), [TH05_V1.3](https://pvvx.github.io/TH05-v1.3), [TH05_V1.4](https://pvvx.github.io/TH-05)
|
||||
The name of the pins on the device can be found in the description at the links:
|
||||
* [THB1](https://pvvx.github.io/THB1)
|
||||
* [THB2](https://pvvx.github.io/THB2)
|
||||
* [THB3](https://pvvx.github.io/THB3)
|
||||
* [BTH01](https://pvvx.github.io/BTH01/)
|
||||
* [TH05_V1.3](https://pvvx.github.io/TH05-v1.3)
|
||||
* [TH05_V1.4](https://pvvx.github.io/TH-05)
|
||||
|
||||
2. Install python3 and the necessary libraries
|
||||
2. Install python3 and the necessary libraries:
|
||||
|
||||
```
|
||||
pip3 install -r requirements.txt
|
||||
|
|
@ -94,10 +101,10 @@ pip3 install -r requirements.txt
|
|||
4. Run:
|
||||
|
||||
```
|
||||
python3 rdwr_phy62x2.py -p COM11 -e -r wh BOOT_xxx_vxx.hex
|
||||
python3 rdwr_phy62x2.py -p COM11 -e -r wh BOOT_XXX_vXX.hex
|
||||
```
|
||||
|
||||
5. Boot flashing is complete. The device is operational. The adapter can be disconnected.
|
||||
5. Boot flashing is complete. The device is operational and the adapter can be disconnected.
|
||||
|
||||
6. Download the full version of the firmware via OTA. To do this:
|
||||
1. Apply power to the sensor.
|
||||
|
|
@ -108,8 +115,8 @@ python3 rdwr_phy62x2.py -p COM11 -e -r wh BOOT_xxx_vxx.hex
|
|||
7. The device should reboot and be ready for use.
|
||||
|
||||
> Optional:
|
||||
> * To pre-wipe the entire Flash, use the `-a` option.
|
||||
> * To pre-wipe the Flash workspace, use the `-e` option.
|
||||
> * To pre-wipe the entire flash, use the `-a` option.
|
||||
> * To pre-wipe the flash workspace, use the `-e` option.
|
||||
> * With the USB-COM adapter it is possible to write the main firmware (APP) immediately:
|
||||
> ```
|
||||
> python3 rdwr_phy62x2.py -p COM11 -r we 0x10000 XXX_vXX.bin
|
||||
|
|
@ -128,7 +135,7 @@ python3 rdwr_phy62x2.py -p COM11 -r rc 0x11000000 0x80000 ff_thb2.bin
|
|||
|
||||
## Restoring the original firmware
|
||||
|
||||
> Original Tuya firmware for a specific device type can be obtained from the links in the table at the beginning of this README.
|
||||
> Original Tuya firmware for a specific device type can be obtained from [the links in the table at the beginning of this README](#boot-and-app-firmware).
|
||||
|
||||
1. Take the saved ff_thb2.bin file of the original firmware.
|
||||
2. Connect GND, TX, RX, RTS-RESET, VCC (+3.3B).
|
||||
|
|
@ -140,9 +147,9 @@ python3 rdwr_phy62x2.py -p COM11 -b 1000000 -r we 0 ff_thb2.bin
|
|||
|
||||
> Not all USB-COM adapters support 1Mbit. Then remove the `-b 1000000` option or select a different baud rate.
|
||||
|
||||
4. The firmware has been flashed. The device works.
|
||||
4. The firmware has been flashed and the device should work.
|
||||
|
||||
## 512 kilobyte flash allocation
|
||||
## Flash allocation (512 kilobytes)
|
||||
|
||||
| Address | Description | Size |
|
||||
|---|---|---|
|
||||
|
|
@ -165,8 +172,8 @@ Supported features and services are described by the enabled bits in the 32-bit
|
|||
|
||||
When connected, it specifies:
|
||||
|
||||
_Software:_ **V**x.x - means `FW APP` is running.
|
||||
_Software:_ **B**x.x means `FW Boot` is running.
|
||||
* _Software:_ **V**x.x - means `FW APP` is running.
|
||||
* _Software:_ **B**x.x means `FW Boot` is running.
|
||||
|
||||
On screen thermometers, if time display is not enabled, the first startup shows:
|
||||
|
||||
|
|
@ -176,9 +183,9 @@ On screen thermometers, if time display is not enabled, the first startup shows:
|
|||
There are two ways to force a reboot to `FW Boot` from `FW APP`:
|
||||
|
||||
1. Switch off the power and hold down the button to switch on the power.
|
||||
2. Issue the `7233` command in the `Service` menu of the PHY62x2BTHome.html program and disconnect the connection.
|
||||
2. Enter the `7233` command in the `Service` menu of the [PHY62x2BTHome.html program](https://pvvx.github.io/THB2/web/PHY62x2BTHome.html).
|
||||
|
||||
Complete reboot - Issue the `7201` command in the `Service` menu of the PHY62x2BTHome.html program and disconnect the connection.
|
||||
> Complete reboot: Enter the `7201` command in the `Service` menu of the [PHY62x2BTHome.html program](https://pvvx.github.io/THB2/web/PHY62x2BTHome.html).
|
||||
|
||||
Through USB-UART adapter, APP can be written immediately after boot. For example:
|
||||
```
|
||||
|
|
@ -218,13 +225,13 @@ Input contact on the thermometer board:
|
|||
The contact on the printed circuit board labelled "TX" or "TX2" is controlled with hysteresis setpoints for temperature and humidity.
|
||||
It is possible to switch to inverse output control.
|
||||
|
||||
The setting is made in PHY62x2BTHome.html.
|
||||
The setting is made in [PHY62x2BTHome.html program](https://pvvx.github.io/THB2/web/PHY62x2BTHome.html).
|
||||
|
||||
Output operation is assigned by setting the hysteresis value:
|
||||
|
||||
* If the hysteresis value is zero, there will be no switching.
|
||||
* If the hysteresis value is greater than zero - switching (switching on) will occur at a value lower than the setpoint + hysteresis.
|
||||
* If the hysteresis value is less than zero - switching (switching on) will take place at a value higher than setpoint + hysteresis.
|
||||
* If the hysteresis value is greater than zero, switching (switching on) will occur at a value lower than the setpoint + hysteresis.
|
||||
* If the hysteresis value is less than zero, switching (switching on) will take place at a value higher than setpoint + hysteresis.
|
||||
|
||||
## Reset basic settings
|
||||
|
||||
|
|
@ -235,11 +242,8 @@ Connect to the device and in the service `0xFCD2` with characteristic `0xFFF4` w
|
|||
|
||||
* Pressing/releasing the button temporarily changes the connection interval for connection. Press the button briefly and connect in 60 sec. If you don't have time, press the button more often...
|
||||
* The firmware checks all settings for compliance with Bluetooth SIG standards.
|
||||
If the interval is more than 10 sec, it will set 10 sec is the maximum in the standard. So do other settings.
|
||||
But not all BT adapters can work with 10 sec interval for connection.
|
||||
> If the interval is more than 10 sec, it will set 10 sec as it is the maximum in the standard. So do other settings. However, not all BT adapters can work with 10 sec interval for connection.
|
||||
* **When working with BLE in Linux it is mandatory to change Bluez options and/or kernel patches!**
|
||||
|
||||
---
|
||||
|
||||
## Build Firmware
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue