Commit Graph

595 Commits

Author SHA1 Message Date
Jaco Malan
fa2064b957 [realtek-ambz] Temporarily workaround CHANGE interrupts not supported (#282)
* fix change interruptsnot supported on rtl8710b

* Update cores/realtek-amb/arduino/src/wiring_irq.c

---------

Co-authored-by: Kuba Szczodrzyński <kuba@szczodrzynski.pl>
2024-05-31 14:59:46 +02:00
Kuba Szczodrzyński
21a194f43d [core] Fix lwIP debugging support 2024-05-31 14:58:38 +02:00
devgs
b255402659 [beken-72xx] Fix race condition when checking Wi-Fi SSID (#274)
* Fix for a race condition in WiFi connection loop

There seems to be the race between the event RW_EVT_STA_CONNECTED
and an actual valid SSID value returned by BDK. If even a small delay
is injected immediately after the event reception the valid value
becomes available. Without this fix, due to a polling nature of ESPHome
WiFiComponent::check_connecting_finished function may observe the
WiFiSTAConnectStatus::CONNECTED status but with an empty SSID value,
leading to `Incomplete connection.` warning and immediate attempt to
start another connection, while the current one was actually established.

* Fixed clang format conformance

* Apply suggestions from code review

* Update cores/beken-72xx/arduino/libraries/WiFi/WiFiEvents.cpp

Co-authored-by: Cossid <83468485+Cossid@users.noreply.github.com>

---------

Co-authored-by: Kuba Szczodrzyński <kuba@szczodrzynski.pl>
Co-authored-by: Cossid <83468485+Cossid@users.noreply.github.com>
2024-05-31 14:54:41 +02:00
Kuba Szczodrzyński
dfabfbb921 [beken-72xx] Increase MBEDTLS_ENTROPY_MAX_SOURCES 2024-05-18 13:50:25 +02:00
Kuba Szczodrzyński
3b36a70c9a [core] Fix ESP_LOG#() macro syntax 2024-05-18 13:50:10 +02:00
Piotr Szulc
d1386a8e9d [libs] Fix mDNS string memory corruption, print error on record add failure (#260)
* Fixed unsafe conversion to underscore string

* Fixed formatting

* Save one byte if underscore not needed

* Don't allocate new string if already underscored

* Fix missing first character while copying

* Renamed function and made it inline

* Don't use signed index variable when searching for service

* Add proper cleanup of LwIPmDNS

- Free allocated memory both on end() and in the destructor
- Unregister callback from netif

* Don't free const pointer

* Removed unneeded casting

* Don't break the loop if failed to add txt record

* Fixed code formatting
2024-03-08 12:21:14 +01:00
Kuba Szczodrzyński
67b92b7f56 [release] v1.5.1
Some checks failed
Release / Run Clang lint (push) Has been cancelled
Release / Publish PlatformIO platform (push) Has been cancelled
Release / Publish GitHub release (push) Has been cancelled
v1.5.1
2024-02-29 14:14:01 +01:00
Hajo Noerenberg
a1f8516e60 [realtek-ambz] Fix crash after WiFi scan (#258) 2024-02-26 21:35:35 +01:00
cap9qd
cf52021d38 [core] Split reboot reasons due to wakeup (#254)
* Updates to break out wakeup reasons.

Per https://github.com/libretiny-eu/libretiny/issues/234

* Update cores/common/base/api/lt_device.h

Co-authored-by: Kuba Szczodrzyński <kuba@szczodrzynski.pl>

* fix clang-format

* Fix formatting of python files.

* Update lt_device.h

---------

Co-authored-by: Kuba Szczodrzyński <kuba@szczodrzynski.pl>
2024-02-25 18:45:22 +01:00
cap9qd
b78c9387a6 [beken-72xx] Fix duration rollover in deep sleep (#253) 2024-02-22 20:24:40 +01:00
Kuba Szczodrzyński
b748d99437 [release] v1.5.0
Some checks failed
Release / Run Clang lint (push) Has been cancelled
Release / Publish PlatformIO platform (push) Has been cancelled
Release / Publish GitHub release (push) Has been cancelled
v1.5.0
2024-02-20 17:16:15 +01:00
Anna
9a33fc0a69 [docs] Improve getting started guide (#252)
* Update Readme & improve md layout

- ESPHome now supports LibreTiny natively
- Added extra PIO docs references
- Reworded some sections slightly, to accomodate proper grammar
- PIO deprecated the `platformio platform install` command, replaced this with the official recommendation/replacement

* Use backslash for line break, revert changing indent

---------

Co-authored-by: Kuba Szczodrzyński <kuba@szczodrzynski.pl>
2024-02-20 17:14:12 +01:00
Hajo Noerenberg
4cddc01f22 [libs] Fix MD5 calculation during OTA update (#240) 2024-01-17 22:49:33 +01:00
Piotr Szulc
1d80b5fff7 [beken-72xx] Free list returned by wlan_sta_scan_result() (#226)
* Free list returned by wlan_sta_scan_result()

* scanAlloc improvements

There were a few things I didn't like about this function:
1) realloc() was called a bit too often.
2) if realloc() failed, the previous memory was not freed.
3) scanAlloc returned previous count or 255 on error. But there was no real check for error and 255 could've been used as index to null. I think it's better to simple return boolean.
4) scanAlloc was clearing memory only up to (and excluding) the new entries.

* Corrected clearing new entries in scanAlloc

* scanAlloc() now returns number of allocated items

* Fixed compilation issues related to goto.
2024-01-06 19:41:01 +01:00
Cossid
140cf07173 [docs] Use official ESPHome version, add LT dev version guide (#223)
* Update ESPHome documentation

* Update note format

* Switch to https github format, give manual PR checkout instructions until a better method is found.

* Fix yaml sample spacing

* Fix indent

* Add addon migration info

* Replace spaces with tabs

---------

Co-authored-by: Kuba Szczodrzyński <kuba@szczodrzynski.pl>
2024-01-06 19:40:44 +01:00
Piotr Szulc
1e3a82f439 [beken-72xx] Improve ddev ADC support (#220) 2024-01-06 19:40:33 +01:00
Cossid
c90794e9f5 [beken-72xx] Allow connecting to specific BSSID if provided (#209)
* Switch to bk_wlan_start_sta_adv for specific bssid control.

* Allow split sta/adv_sta configs.

* Add wifi_mode back for regular STA mode.

* Fix apparent bug of setting null/empty wifi key.
Reset STA_ADV_CFG.dhcp_mode in reconnect, as it seems to not survive for some reason.
Do les _CFG setting in reconnect()

* Move all _CFG setting to begin()

* Fix dhcp_mode in STA_ADV_CFG.

* Remove no longer necessary dhcp_mode re-set.

* Formatting cleanups.

* Formatting.

* Update cores/beken-72xx/arduino/libraries/WiFi/WiFiSTA.cpp

* Apply suggestions from code review

---------

Co-authored-by: Kuba Szczodrzyński <kuba@szczodrzynski.pl>
2024-01-06 19:40:08 +01:00
Kuba Szczodrzyński
03c723c73d [docs] Add draft Beken key extraction docs 2024-01-06 19:20:03 +01:00
Gerard Du Pre
bad2ffdd07 [docs] Update docker compose image name (#225)
The docs about using docker  compose for libre tuya had an error.
When setting what image to use in compose you dont have to put docker pull, just the image you are going to use
2023-12-25 19:42:53 +01:00
Piotr Szulc
eed39c9cfb [beken-72xx] Pause PWM instead of stopping, track PWM state (#222)
* Pause PWM instead of stopping on duty cycle 0.

* Merged paused and stopped conditions
2023-12-16 13:57:47 +01:00
Piotr Szulc
7bd6d1d815 [beken-72xx] Fix stopping PWM, use pin-scoped PWM struct (#215)
* Fixed stopping PWM

* Clang-formatted as required

* Use separate memory block for each pwm pin
2023-12-08 19:20:41 +01:00
Piotr Szulc
bb7fcd5c4d [docs] Add more UPK key descriptions (#219)
* Added description of some UPK keys

* More keys described.

This time by experimenting on my PIR-enabled lamp.
Motion is reported correctly via GPIO defined as pirin_pin.
I am also trying to set the PIR sensitivity by applying PWM to the pirsense_pin, and I _think_ it works. More experiments are needed.

* Add UPK2ESPHome link, reformat table

* Add descriptions from BK7231N SDK

* Update docs/resources/tuya-pin-config.md

* Corrected description of cwmaxp

* Description of ambient light sensor values

---------

Co-authored-by: Kuba Szczodrzyński <kuba@szczodrzynski.pl>
2023-12-08 19:13:15 +01:00
Kuba Szczodrzyński
9b8e00c7fa [boards] Support and validate MCU name aliases 2023-11-14 22:38:22 +01:00
Kuba Szczodrzyński
b97825d552 [boards] Add T112_V1.1 board, change scaling of small boards 2023-11-14 22:30:13 +01:00
Kuba Szczodrzyński
085b5aed16 [boards] Update boardgen to v0.10.1 2023-10-28 14:58:52 +02:00
protectivedad
7f43624824 [builder] Fix printing flash layout in env.py (#191)
Pointed to the proper item.
2023-10-27 13:34:09 +02:00
Kuba Szczodrzyński
1ed0000819 [release] v1.4.1
Some checks failed
Release / Run Clang lint (push) Has been cancelled
Release / Publish PlatformIO platform (push) Has been cancelled
Release / Publish GitHub release (push) Has been cancelled
v1.4.1
2023-09-22 17:54:18 +02:00
Mike La Spina
3b79636d00 [libs] Fix SerialClass available() return value (#173)
Co-authored-by: descipher <120155735+GelidusResearch@users.noreply.github.com>
2023-09-21 17:19:51 +02:00
Kuba Szczodrzyński
5a4b932a37 [release] v1.4.0
Some checks failed
Release / Run Clang lint (push) Has been cancelled
Release / Publish PlatformIO platform (push) Has been cancelled
Release / Publish GitHub release (push) Has been cancelled
v1.4.0
2023-09-10 19:37:52 +02:00
Kuba Szczodrzyński
dd2ae149ad [github] Move repository to libretiny-eu organization 2023-09-10 19:31:57 +02:00
Kuba Szczodrzyński
0f5d0a8889 [platform] Install ltchiptool in separate virtual environment (#166)
* [platform] Install ltchiptool in separate virtual environment

* [platform] Fix f-string syntax, set LibreTiny path in ltchiptool

* [platform] Fix venv site-packages path

* [platform] Fix installing pip without ensurepip

* [platform] Install binary dependencies only
2023-09-10 19:23:27 +02:00
Kuba Szczodrzyński
3750ae6953 [docs] Fix flashing redirect links 2023-09-02 15:20:08 +02:00
Kuba Szczodrzyński
5be993f9eb [docs] Add various redirect links for ESPHome docs 2023-09-02 15:12:12 +02:00
Kuba Szczodrzyński
57c43ce515 [libs] Fix possible MD5 memory leak in Update 2023-08-30 11:35:11 +02:00
Kuba Szczodrzyński
159ffa76fd [release] v1.3.0
Some checks failed
Release / Run Clang lint (push) Has been cancelled
Release / Publish PlatformIO platform (push) Has been cancelled
Release / Publish GitHub release (push) Has been cancelled
v1.3.0
2023-08-29 19:21:09 +02:00
Kuba Szczodrzyński
1ac3d30d84 [libs] Implement Update MD5 2023-08-29 19:19:28 +02:00
Kuba Szczodrzyński
631ef6ba59 [github] Reuse GitHub workflows 2023-08-29 14:39:39 +02:00
Kuba Szczodrzyński
27393e47c3 [beken-72xx] Initialize UART to fix deep sleep 2023-08-23 16:08:03 +02:00
Péter Sárközi
bd47772c04 [beken-72xx] Fix GPIO deep sleep wakeup edge (#159)
Manufacturer docs: https://docs-bekencorp-com.translate.goog/sdk_3.0.x/bk7238/html/developer-guide/power_save/sleep_test.html?_x_tr_sl=auto&_x_tr_tl=en&_x_tr_hl=hu&_x_tr_pto=wapp

Discussion: https://github.com/libretiny-eu/libretiny-esphome/pull/11
2023-08-23 16:06:55 +02:00
Kuba Szczodrzyński
f3871388ce [docs] Restore feature support table 2023-08-18 13:47:06 +02:00
Ivan Kravets
62874bebf4 [misc] Fix PlatformIO repository URL (#157) 2023-08-17 19:23:10 +02:00
Kuba Szczodrzyński
2ca368305c [release] v1.2.1
Some checks failed
Lint check / Lint with clang-format (push) Has been cancelled
Lint check / Lint with black (push) Has been cancelled
PlatformIO Publish / publish (push) Has been cancelled
v1.2.1
2023-08-17 19:04:50 +02:00
Kuba Szczodrzyński
f697ae6f11 [docs] Add migration to OpenBeken guide 2023-08-17 18:38:04 +02:00
Kuba Szczodrzyński
ef6dd35977 [docs] Rewrite flashing guides 2023-08-17 17:17:10 +02:00
Hajo Noerenberg
ccf21b4eab [realtek-ambz] Enable Mbed-TLS for MD5 hashing, remove Polar SSL (#156)
* Enable Mbed-TLS, remove Polar SSL

* Reformat lt_defs.h

---------

Co-authored-by: Kuba Szczodrzyński <kuba@szczodrzynski.pl>
2023-08-17 15:20:02 +02:00
Kuba Szczodrzyński
e99c6124e7 [docs] Add video guide link, use ready Docker images 2023-07-13 21:19:04 +02:00
Kuba Szczodrzyński
5721bd74d7 [docs] Update LibreTiny ESPHome component naming 2023-07-13 20:41:21 +02:00
Kuba Szczodrzyński
ff443ca488 [release] v1.2.0
Some checks failed
Lint check / Lint with clang-format (push) Has been cancelled
Lint check / Lint with black (push) Has been cancelled
PlatformIO Publish / publish (push) Has been cancelled
v1.2.0
2023-07-13 18:02:58 +02:00
Péter Sárközi
93e0a5d066 [beken-72xx] Implement deep sleep (#140)
* Initial support code for Deep Sleep

* Global functions

* Remove unnecessary override

* clang-format

* Support for multiple pins

* Fix math

* Add a way to unset GPIOs

* Clang format

* Update brief

---------

Co-authored-by: Kuba Szczodrzyński <kuba@szczodrzynski.pl>
2023-07-13 18:00:14 +02:00
Kuba Szczodrzyński
150c2ef26d Merge branch 'family/ambz2' 2023-07-13 17:31:52 +02:00