Commit Graph

542 Commits

Author SHA1 Message Date
4ced41bf4c on ha discovery event 2025-11-30 20:26:22 +01:00
db211a0429 garage cover entity discovery - just impl, not called anywhere 2025-11-25 15:58:26 +01:00
9581b34b95 bl602 fast connect (#1868) 2025-11-22 16:32:21 +01:00
2086cb84fc Implementation of girier MCU driver for 2ch dimmer (#1846)
* Implementation of girier MCU driver for 2ch dimmer

* Fixed review notices

* makefiles

* dpType = 0; // TODO - uninitialized

* header

* add to vcproj

* header

* #if ENABLE_DRIVER_GIRIERMCU

* clear

---------

Co-authored-by: Tester <85486843+openshwprojects@users.noreply.github.com>
2025-11-18 22:00:19 +01:00
b35a6731e4 reduce stack size iusage n ha discovery, next enum self test 2025-10-18 01:17:03 +02:00
42976ee561 few more fixes 2025-10-17 23:04:33 +02:00
4ad9a85a08 Add ChType_Enum and enable SetChannelEnum. (#1830)
* create a ChType_Enum to go with SetChannelEnum

* resolve build errors for ChType_Enum PR

* fixing build errors for simulator and others for cmd_enums.c

* added ChType_ReadOnlyEnum and assocaited enum selftests

* ChType_Enum simulation and memory error corrections

* ChType_Enum documentation updates

---------

Co-authored-by: root <root@stonacek.nz>
2025-10-14 09:21:18 +02:00
f60d242fbb Flag13 - extend pin state display to PLATFORM_GPIO_MAX (#1823)
* Update http_fns.c

* Update http_fns.c

* Update http_fns.c

* Revert "Update http_fns.c"

This reverts commit c899cb45b0.

* Revert "Update http_fns.c"

This reverts commit 012c49c32d.

* Update http_fns.c
2025-10-03 14:50:09 +02:00
4a2ae013ed HLW8112 Driver for energy measurments (#1810)
* initial test driver for hlw8112

Signed-off-by: Nizam <code@maxters.net>

* restrict build to BK7231N
will stub other platforms later

Signed-off-by: Nizam <code@maxters.net>

* fix newer gcc build

Signed-off-by: Nizam <code@maxters.net>

* fix channel b stat restore
after all i still doesnt get pointer arithmetic

Signed-off-by: Nizam <code@maxters.net>

* clean up flashvar bk7231 still use emetering struct to store data

Signed-off-by: Nizam <code@maxters.net>

* fix OpenBK7231N_ALT build fail

Signed-off-by: Nizam <code@maxters.net>

* disable incomplete spi device raw access commands and ui

Signed-off-by: Nizam <code@maxters.net>

* remove mqtt hack for commands. leverage existing tasmota command framework

Signed-off-by: Nizam <code@maxters.net>

* missed flashvar restore

Signed-off-by: Nizam <code@maxters.net>

* disable hlw812 driver for upstream pr

Signed-off-by: Nizam <code@maxters.net>

---------

Signed-off-by: Nizam <code@maxters.net>
2025-09-30 15:04:15 +02:00
d0dfea0822 battery sensor publish with no bl0937 build fix by dedamraz 2025-09-27 18:22:02 +02:00
481cc0ede2 DMX works on ESP32 LilyGO, other platforms requires porting code to change baudrate
* ENABLE DMX on ESP

* test

* s

* Update hal_uart_espidf.c

* Update obk_main.cmake

* w

* test

* Update hal_uart_espidf.c

* Update drv_dmx512.c

* test

* test

* test

* w

* t

* c

* t

* test

* T

* Update drv_dmx512.c

* test

* test

* try flush

* try wait

* ticks w

* t

* fx

* 100 ms

* SIM fx

* Update cmd_newLEDDriver.c

* test 2x

* tests

* fixes

* free

* fix

* misc

* b

* hal

* s

* Update workflow.yaml

* pin

* fin

* test

* Update hal_uart_espidf.c
2025-09-14 21:07:24 +02:00
f68c6ac9f2 al;low empty entries in led remap (#1789)
* test

* some verification

* ha disc?
2025-09-06 10:30:11 +02:00
0d007112b1 TXW817 support (#1779)
* txw81x base no makefile

* txw81x

* gpio fix?

* non-working ota

* mic
2025-09-03 11:46:06 +02:00
e5b1b864fa spellings (#1767) 2025-08-19 08:50:37 +02:00
36218fd38e ota cosmetic (#1762)
* step 1

* Update obk_main.mk

* Update OpenBeken.mk

* Update obk_main.cmake

* Update hal_ota_bk7231.c

* Update hal_ota_bk7231.c

* m

* split

* guards

* Update hal_ota_bl602.c

* Update hal_ota_bl602.c

* bk

* better

* header

* w

* TMP

* tttttttt

* Update rest_interface.c

* hal_ota is xradio header....

* undoi

* header

* move

* xradio

* read

* fx

* t

* makefile

* move out xradi o read

* fx

* move out esp

* move out bl602

* move out beken, ln

* move out w8

* ecr tr

* realtek

* Update rest_interface.c

* win

* forgot

* tr6260 split

* Update hal_ota_tr6260.c

* rename ota_progress

* use OTA_GetProgress on all paltforms

* fx

* not needed header

* call OTA_IncrementProgress on OTA so we at laest know that something is happening
2025-08-16 16:04:57 +02:00
a1501c00c4 RTL8721DA (AmebaDplus) and RTL8720E (AmebaLite) (#1718)
* amebadplus

* fix + amebalite

* ota, lfs, fast connect fix

* Fix TCP_MSL and hostname

* Readme and releaserc
fix esp irq

* small fixes

* setting mac on amebad/1

* ameba ir

* win ef

* update sdk & disable rtl8720e rest ota

* fix
2025-08-12 17:28:36 +02:00
b8965817f6 bl602 deep sleep & ecr sdk update (#1743)
* bl602 deep sleep & ecr sdk update

* esp8266 disable wpa3

* platforms.md
2025-08-10 17:08:33 +02:00
0fb70227df add pinmutex driver (potentially for shutters); disabled by default
* draft

* Update drv_pinMutex.c

* working with self test?

* Update selftest_cmd_generic.c

* ENABLE_DRIVER_PINMUTEX on beken

* ChType_StopUpDown

* addRepeatingEventUID

* rest

* Update obk_config.h
2025-08-10 14:27:26 +02:00
aaaa95a8d1 correct spelling and grammar (#1747)
* Update http_fns.c

* Update flags.json

* Update flags.md

* Update selftest_mqtt_get.c

* Update flags.md

* Update flags.json

* Update http_fns.c

* Update user_main.c

* Update drv_ir_new.cpp

* Update subpages.json

* Update flags.json

* Update http_fns.c

* Update flags.md

* Update tcpServer.md

* Update hal_flashConfig.h

* Update flash_pub.h

* Update win_flash_stub.c

* Update hal_flashConfig_bk7231.c
2025-08-10 08:46:49 +02:00
8ee93ace88 Update http_fns.c 2025-08-07 23:44:19 +02:00
6bb7a5743d Fix spacing in main page (#1738) 2025-07-26 15:53:54 +02:00
1c7cdd4881 Ds1820 simple+full as separate drivers (#1705)
* Seperate simple and full driver, introduce "common" for shared code

* Fix command prefixes

* Generate command as multiline if requested

* Fix JS linebreak

* Only use simple dirver - check sizes of firmware images

* Update obk_config.h - enable Full driver for all platforms to allow testing

* Change parsing sttring to device address to allow compact form
Change obk_config.h: remove extra entry for W800, add "FULL" driver to windows build

* fix windows code for "fake" DS18B20

* fix missing files in openBeken_win32_mvsc2017.vcxproj

* fix handle missing task.h for windows

* change Windows emulation to MAX/2 fake sensors

* try fix BL602

* change "fake temperature" of sensors in windows

* change windows sensor temperature once more

* shorten commands by alias

* fix escaping linebreak

* Fix broken JS code ...

* Fix ESP32 is crashing if interrupts are disabled during OWReset for > 480us

* Change output for unused channels
Test if DS1820 channels are in use

* fix warning/error for channel (<=64) printed into a char[5] value

* removeunuses quotes for address

* Fix language

* Capial "S" in Menu entry "Sensors"

* restore obk_config - #define ENABLE_DRIVER_DS1820_FULLonly for WINDOWS and SENSORS variant
2025-07-19 08:03:46 +02:00
a261a71ab1 Update ESP-IDF to v5.5-beta1 and add minimal ESP8266 support (#1707)
* update esp-idf

* esp8266

* fix

* pwm, uart and wifi fix

* fix ota

* fix 1m and ps

* update workflow
2025-07-06 07:54:23 +02:00
55ce270fef simple correction in config page (#1708)
Since I saw this in an illustration for an "issue".
If I'm not mistaken, I changed the GUI some time ago so the additional input appears/vanishes as soon as role is changed to button. So no need to wait for saving...
2025-07-03 15:40:11 +02:00
69121fb252 merge gosund sw2 port (not clear if it will be used) 2025-06-30 21:56:13 +02:00
3b99b17cc2 Xradios (#1695)
* Xradios

* deep sleep

* xr806

* small adjustments
2025-06-30 18:47:47 +02:00
fac2cf081c w800 + berry (#1629)
* w800 + berry

* fix w600

* Update XR and makefile

* Berry cmake

* BL602 lfs test

* Update w800

* Fix

* W600 heap

* sensors & bl602

* bl602 delay_us
2025-06-20 09:35:00 +02:00
b1b41f4a66 channel type - Percent 2025-05-31 01:18:37 +02:00
d6f7678dc6 TCL AC driver progress + LowMidHigh etc channels HA discovery
* Buzzer

* Update obk_config.h

* Display

* uart test stub

* unfinished TCL_DoDiscovery

* ha

* Update drv_tclAC.c

* ha mode send

* unfinished not working

* Update drv_tclAC.c

* Update hass.h

* better discovery

* Update obk_config.h
2025-05-30 16:10:36 +02:00
a2c9d19147 Fix a memory leak in http_fns.c (#1653) 2025-05-26 17:35:45 +02:00
cbf0d459fd Fix tests on linux (#1640)
The tests were segfaulting on linux, I don't know how they work on
Windows, perhaps casting `void*` to `int` happens to work there.
Generally it's not portable.

Berry has a dedicated `comptr` type, so let's use that and be portable.

Also makes `run_closure` handle arbitrary number of arguments, see
https://berry.readthedocs.io/en/latest/source/en/Chapter-5.html#function-with-variable-number-of-arguments-vararg
for docs.

Test Plan:
* CI
* make -f custom.mk, ./build/win_main -runUnitTests 2
2025-05-25 18:12:56 +02:00
a5a5b4b7b9 xr872 (A9 camera) 2025-04-18 18:05:04 +02:00
ac3c5d6da6 Faster wifi connecting (up to 2sec restart -> connected) (#1297)
* Wifi fast connect + extra

* --
2025-04-15 16:38:10 +02:00
00890d1cf4 API CHANGE - extend http callback for drivers so it includes bPreState boolean so we can add HTML either before state div (without refresh) or in state div (refreshing) 2025-04-13 19:18:30 +02:00
9922aec8df add prestate for berry 2025-04-13 09:45:19 +02:00
eadba42f9f Berry integration part 1
* t

* fx

* split closure handler

* setTimeout, setInterval

* split berry frm SVM, but I need to move event waiter to separate struct?

* fx

* fx

* split relations

* remvoe ode duplciaton

* POC - pass value to berry

* POC - pass str to berry

* berry preps + lfs test

* lfs test + bytes

* save

* remove code duplication

* try dpid calls

* working test for bytes

* tyuamcu to file in eberry

* str for berry test

* tuyamcu to berry glue

* fx1

* fixes

* try berry http

* fix

* tests

* test  vaar lifespan

* test

* test

* test if

* berry in html

* #if ENABLE_OBK_BERRY

* fx

* better

* fx

* test nested loop

* free mem

* simpler

* split lfs run

* arg

* fx

* fix

* #if ENABLE_OBK_BERRY

* comamnd hook

* vars access, ntp

* finalize?

* unfinished
2025-04-12 16:56:24 +02:00
XJ
5810db7ae1 BL0492 Frequency to HASS (MQTT) + Energy calculation in TWIN_BL_ENABLED mode for channel 2 (#1578)
* twinbl energy for channel 2

* .

* removed movavg

* Added HASS MQTT frequency (both standard and TWIN_MODE)

* .

* simplify, store total only IX0

* Ext BugFix: addChangeHandler Power < 20 appears broken #1543
2025-03-26 13:24:34 +01:00
7ace8c31ba tr6260 (#1564) 2025-03-13 09:01:58 +01:00
544f48d022 ECR6600 (#1553)
* ECR6600

* fix macstr

* uart, bl0937

* vbat adc, ota

* pwm freq

* static ip, change mac

* update partitions
2025-03-07 22:11:42 +01:00
86fbfe90e0 Mqtt-mbedtls (#960)
* Update package.json

Update repo url for build

* MQTT over TLS first build

* MQTT TLS boot ok

* Funcional version MQTT secure TLS

* Add option for mqtt to use tls in web config

* Versao funcional pendente otimizacao de rom

* Versao funcional com verify certificate disabled

* Adicao de informacoes para debug

* Versao funcional com verificacao do certificado

* Otimizacoes de rom e heap usage

* Versao com webserver enable/disable

* Versao boa para mqtt mbedtls boa uso

* Invert CFG enable_web_server to disable_web_server

* MQTT over TLS first build

* MQTT TLS boot ok

* Funcional version MQTT secure TLS

* Add option for mqtt to use tls in web config

* Versao funcional pendente otimizacao de rom

* Versao funcional com verify certificate disabled

* Adicao de informacoes para debug

* Versao funcional com verificacao do certificado

* Otimizacoes de rom e heap usage

* Versao com webserver enable/disable

* Versao boa para mqtt mbedtls boa uso

* Invert CFG enable_web_server to disable_web_server

* Same documentation

* Rever submodulos configuration

* Rever ignore submodules

Rever ignore submodules

* Fix for git actions

* Fix build start_type_pub only in platform Beken

* Fix build git w600

* Fix BL602 build

* Remove format only changes

* Delete src/driver/drv_ir.cpp

Space changes only

* Updates to pull request

* Revert space only changes

* Change cfg bool to byte and some documentation

* Fix get initial time from compile time

* Fix base64.c duplicate module

* Fix base64.c duplicate module for git workflow

* Fix strange behavior on BK7231n. Connection completed only in the second callback WIFI_STA_CONNECTED

* MQTT-MBEDTLS default disable

* Fix SERIOUS bug breaking all platforms except BK7231N (did you want to set g_bHasWiFiConnected  in #else?)

---------

Co-authored-by: Tester23 <85486843+openshwprojects@users.noreply.github.com>
2025-03-05 19:27:51 +01:00
XJ
1cc0603748 Cmd Flags 64bit repair + webui (#1548)
* flags 64bit cmd repair + webui

* uint32

* flags 0 webui strange char repair
2025-03-01 06:17:38 +01:00
969e5bfa50 RTL8720D (#1550)
* ambd

* update sdk, get current fw idx

* test

* ota

* reset if hard fault

* revert and fix

* uart flow control

* disable uart tcp debug by default

* test

* wifi test

* adjust lwip
adjust scan

* increase timeout

* enable ssdp, close uart tcp sockets on restart

* test

* pwm

* fix bl0942

* cut some code
2025-02-28 08:43:00 +01:00
XJ
3c22b5e4ad Twin BL0942 mod - Two BL0942 on two UARTs on one power metering device (#1531)
* Twin BL0942 mod

* Energy data more checks for index 0

* BL09XX_ResetEnergyCounter reset lastSavedEnergyCounterValue

* added ENABLE_BL_TWIN compiler option, default disabled

* added more ENABLE_BL_TWIN
2025-02-26 11:51:22 +01:00
d4d6c69be3 BK7238 (#1527)
* beken new sdk + bk7238

* fix bk7238
2025-02-14 22:22:59 +01:00
6ac1f260ed RTL8710B/RTL8711AM (#1501)
* --

* test

* ota

* ameba1/rtl8711am

* workflow build

* uart tcp bridge driver

* fix build

* Static ip fix

* fix

* Rework amebaz ota

---------

Co-authored-by: Tester23 <85486843+openshwprojects@users.noreply.github.com>
2025-02-01 19:04:23 +01:00
7495c70322 f div 1000 type 2025-01-28 04:56:25 +01:00
77efc7ebca make startup command multiline
* step 1

* step2

* Update cmd_script.c

* Update cmd_script.c

* Update obk_config.h

* Update cmd_script.c

* Update cmd_script.c

* fx

* Update obk_config.h

* Update OpenW800

* Update OpenW800

* Update obk_config.h

* f

* fix waitfor

* Update obk_config.h

* Update Makefile

* json escap9ijgng

* crash checks and size check

* w600 bmp

* fx

* Update Makefile

* test

* fx

* Tokenizer_GetPin

* fix

* fix

* ln882h pins

* Update new_http.c

* Update new_http.c

* Update new_http.c

* aht

* aht

* Update obk_config.h

* drv_sht3x

* aht pins

* f

* fx

* aht

* sunset fx

* ln owm

* Update CMakeLists.txt
2025-01-23 23:10:35 +01:00
eb5b1ca2d0 Allow to disable more drivers and features in order to reduce binary size (#1500)
* Update obk_config.h

* Update obk_config.h

* shared

* fx

* he

* fix

* fx

* ffff

* F

* T

* tre

* fcx

* leeed

* ww

* w

* fx

* t

* ENABLE_OLD_YAML_GENERATOR

* w

* startyuip[

* dis all

* remove test post

* ENABLE_HTTP_SEND

* extra guard

* ENABLE_TCP_COMMANDLINE

* better OBK_DISABLE_ALL_DRIVERS

* tr

* ENABLE_PING_WATCHDOG

* ENABLE_HA_DISCOVERY

* TEST WITH EMPTY USER_MAIN

* fx

* no mqtt

* nm

* tr

* ENABLE_MQTT

* Update cmd_newLEDDriver.c

* tr

* header

* fx

* Update user_main.c

* t

* Update hal_main_bk7231.c

* w

* ENABLE_DRIVER_IR

* RESTORE

* fx

* #warning "Platform not defined"

* fx 1

* Update obk_config.h

* ENABLE_DRIVER_TESTPOWER

* DS1820

* fx

* fx

* enable DHT on W800

* Update Makefile

* ntp w800

* ntp

* ssdp

* OWM AND CHARTS

* why utils net has flash pub included

* nmakefile only, no refs

* makefile only

* drv

* Update Makefile

* drcs

* ENABLE_DRIVER_BMP280

* Update Makefile

* d

* ENABLE_I2C

* Update Makefile

* fin
2025-01-10 19:50:17 +01:00
6eb8162b45 static rtl (#1492)
* Update hal_wifi_rtl87x0c.c

* Update hal_wifi_rtl87x0c.c

* test

* fx

* test
2025-01-05 22:57:17 +01:00
3a1c3e9bbf BatteryLevelPercent for HA 2025-01-05 14:39:19 +01:00