80 Commits

Author SHA1 Message Date
NonPIayerCharacter
365a0dbcf9
rda5981 ota (#1839)
* rda5981 ota

* easyflash and lfs

* adjust offsets

* mac change
2025-10-21 09:08:48 +02:00
NonPIayerCharacter
f5a3b2642b
RTL new fix OTA (#1836)
* RTL new fix OTA
clean-up workflow

* fix esp cache?
2025-10-17 08:44:13 +02:00
NonPIayerCharacter
e930bd2d75
hlw8112 variant (#1819) 2025-10-02 17:09:47 +02:00
NonPIayerCharacter
bbbf490011
Fix workflow (#1816) 2025-09-29 09:24:06 +02:00
NonPIayerCharacter
cd17fbf7f5
Fix workflow (#1815) 2025-09-29 08:59:52 +02:00
NonPIayerCharacter
6083ddfca5
RDA5981 (#1813) 2025-09-29 08:41:36 +02:00
MaxineMuster
c1d258fb60
Add DS1820 to JSON sensor output (#1809)
* first try for DS1820 sensors

* fix windows build

* Fix wrong comment format

* Fix code

* fix missing includes

* fix missing defines (only check if driver is included)

* Add DS1820 to sensors in "DRV_IsSensor
Fix string might be not empty

* fix output for long string in case of many DS1820 sensors
2025-09-27 09:15:20 +02:00
NonPIayerCharacter
ea3ea1ffcf
Use cache in workflows (#1793)
* Cache gcc

* cache esp32 toolchains

* skip
2025-09-15 13:17:52 +02:00
openshwprojects
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
NonPIayerCharacter
0d007112b1
TXW817 support (#1779)
* txw81x base no makefile

* txw81x

* gpio fix?

* non-working ota

* mic
2025-09-03 11:46:06 +02:00
NonPIayerCharacter
719f7dd701
Update ESP-IDF (#1784) 2025-09-03 11:45:04 +02:00
NonPIayerCharacter
f3d3ff412a
BL602 irRemoteESP (#1777) 2025-08-30 21:24:04 +02:00
NonPIayerCharacter
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
NonPIayerCharacter
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
openshwprojects
d34ef02b54
enable irRemoteESP8266 variant on BK7238 - it seems to receive something, but original IR works better for RC6, I didn't test anything more
* try irRemoteESP bk7238

* add IRremoteESP8266
2025-08-09 23:40:20 +02:00
NonPIayerCharacter
61d035f616
bk new spi & spidma (#1745)
* bk new spi & spidma

* long app version fix

* esp fix
2025-08-03 11:01:31 +02:00
NonPIayerCharacter
e7db07f7ab
esp8266 fix (#1734) 2025-07-20 19:24:41 +02:00
NonPIayerCharacter
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
NonPIayerCharacter
af37e093d0
bk7231u/bk7231s/bk7252/bk7252n/bk7231t alt. (#1680)
* bk7231u/bk7231t/bk7252 new sdk

* 7252n
2025-06-24 13:16:27 +02:00
NonPIayerCharacter
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
Tester23
b2ed2df150 sensors 2025-06-19 00:19:03 +02:00
Bartosz Nitka
0ae3f861af
Run linux tests with UBSAN (#1664)
Undefined Behavior Sanitizer (UBSAN) [1] is a similar tool to ASAN,
useful for catching bugs related to undefined behavior.

All the problems it detects seem related to the bitshifts related to
flags. Here's a sample:

```
src/new_pins.c:2437:8: runtime error: left shift of 1 by 31 places cannot be represented in type 'int'
	#0 0x55a1b51011c1 in PIN_get_Relay_PWM_Count src/new_pins.c:2437
	#1 0x55a1b500389b in NewLED_InitCommands src/cmnds/cmd_newLEDDriver.c:1627
	#2 0x55a1b5150208 in Main_Init_BeforeDelay_Unsafe src/user_main.c:1151
	#3 0x55a1b51506e7 in Main_Init_Before_Delay src/user_main.c:1290
	#4 0x55a1b5150a05 in Main_Init src/user_main.c:1428
	#5 0x55a1b515902c in SIM_ClearOBK src/win_main.c:166
	#6 0x55a1b515a0fd in main src/win_main.c:534
	#7 0x7f1acfdabd8f in __libc_start_call_main ../sysdeps/nptl/libc_start_call_main.h:58
	#8 0x7f1acfdabe3f in __libc_start_main_impl ../csu/libc-start.c:392
	#9 0x55a1b4fd8eb4 in _start (/home/niteria/tmp/broken-realloc/OpenBK7231T_App/build/win_main+0x10ceb4)

SUMMARY: UndefinedBehaviorSanitizer: undefined-behavior src/new_pins.c:2437:8 in
```

```
src/new_cfg.c:591:9: runtime error: left shift of 1 by 31 places cannot be represented in type 'int'
	#0 0x5629450eb803 in CFG_HasFlag src/new_cfg.c:591
	#1 0x562944ffdb53 in CMD_Init_Early src/cmnds/cmd_main.c:1007
	#2 0x562945153230 in Main_Init_BeforeDelay_Unsafe src/user_main.c:1162
	#3 0x5629451536e7 in Main_Init_Before_Delay src/user_main.c:1290
	#4 0x562945153a05 in Main_Init src/user_main.c:1428
	#5 0x56294515c02c in SIM_ClearOBK src/win_main.c:166
	#6 0x56294515d0fd in main src/win_main.c:534
	#7 0x7f9f5e12bd8f in __libc_start_call_main ../sysdeps/nptl/libc_start_call_main.h:58
	#8 0x7f9f5e12be3f in __libc_start_main_impl ../csu/libc-start.c:392
	#9 0x562944fdbeb4 in _start (/home/niteria/tmp/broken-realloc/OpenBK7231T_App/build/win_main+0x10ceb4)
```

```
src/httpserver/http_fns.c:369:8: runtime error: left shift of 1 by 31 places cannot be represented in type 'int'
	#0 0x560135601d44 in http_fn_index src/httpserver/http_fns.c:369
	#1 0x5601356185cb in HTTP_ProcessPacket src/httpserver/new_http.c:826
	#2 0x5601356a1e93 in Test_FakeHTTPClientPacket_Generic src/selftest/selftest_http.c:86
	#3 0x5601356a2002 in Test_FakeHTTPClientPacket_GET src/selftest/selftest_http.c:102
	#4 0x5601356b773f in Test_PIR src/selftest/selftest_pir.c:27
	#5 0x5601356d204b in Win_DoUnitTests src/win_main.c:171
	#6 0x5601356d3116 in main src/win_main.c:538
	#7 0x7f6911b2ad8f in __libc_start_call_main ../sysdeps/nptl/libc_start_call_main.h:58
	#8 0x7f6911b2ae3f in __libc_start_main_impl ../csu/libc-start.c:392
	#9 0x560135551eb4 in _start (/home/niteria/tmp/broken-realloc/OpenBK7231T_App/build/win_main+0x10ceb4)
```

Preexisting problems are suppressed in `platforms/linux/ubsan.suppressions`

[1] https://clang.llvm.org/docs/UndefinedBehaviorSanitizer.html
2025-06-18 22:52:22 +02:00
Bartosz Nitka
92ea9cd8ab
Ability to run linux tests with AddressSanitizer (#1651)
* Ability to run linux tests with AddressSanitizer

This makes it possible to compile and run the tests with Address
Sanitizer (ASAN) [1].

The command is:
```
make -f custom.mk clean; ASAN=1 make -f custom.mk && ./build/win_main -runUnitTests 2
```

Building without ASAN works without change.

Address Sanitizer saves a lot of time debugging memory issues, for
example for a bug where we index in an array with negative index it
gives this nice error message:
```
=================================================================
==2532658==ERROR: AddressSanitizer: global-buffer-overflow on address 0x5642389c5e37 at pc 0x564237e67492 bp 0x7fff17726e50 sp 0x7fff17726e40
READ of size 1 at 0x5642389c5e37 thread T0
    #0 0x564237e67491 in CHANNEL_GetType src/new_cfg.c:427
    #1 0x564237dfc933 in TuyaMCU_ApplyMapping src/driver/drv_tuyaMCU.c:1126
    #2 0x564237dff92f in TuyaMCU_ParseStateMessage src/driver/drv_tuyaMCU.c:1632
    #3 0x564237e019fa in TuyaMCU_ProcessIncoming src/driver/drv_tuyaMCU.c:1977
    #4 0x564237e027ee in TuyaMCU_RunReceive src/driver/drv_tuyaMCU.c:2178
    #5 0x564237e02dc2 in TuyaMCU_RunFrame src/driver/drv_tuyaMCU.c:2335
    #6 0x564237dd2ce6 in DRV_RunQuickTick src/driver/drv_main.c:536
    #7 0x564237ec4037 in QuickTick src/user_main.c:946
    #8 0x564237eca8a5 in Sim_RunFrame src/win_main.c:106
    #9 0x564237eca993 in Sim_RunFrames src/win_main.c:134
    #10 0x564237ebce4a in Test_TuyaMCU_Basic src/selftest/selftest_tuyaMCU.c:369
    #11 0x564237ecab1f in Win_DoUnitTests src/win_main.c:194
    #12 0x564237ecba57 in main src/win_main.c:535
    #13 0x7fb55312ed8f in __libc_start_call_main ../sysdeps/nptl/libc_start_call_main.h:58
    #14 0x7fb55312ee3f in __libc_start_main_impl ../csu/libc-start.c:392
    #15 0x564237cb16b4 in _start (/home/niteria/tmp/broken-realloc/OpenBK7231T_App/build/win_main+0xcf6b4)

0x5642389c5e37 is located 51 bytes to the right of global variable 'stat_deduper_culled_tooFast' defined in 'src/mqtt/new_mqtt_deduper.c:40:12' (0x5642389c5e00) of size 4
0x5642389c5e37 is located 9 bytes to the left of global variable 'g_mutex' defined in 'src/mqtt/new_mqtt_deduper.c:42:26' (0x5642389c5e40) of size 4
SUMMARY: AddressSanitizer: global-buffer-overflow src/new_cfg.c:427 in CHANNEL_GetType
Shadow bytes around the buggy address:
  0x0ac8c7130b70: 04 f9 f9 f9 f9 f9 f9 f9 04 f9 f9 f9 f9 f9 f9 f9
  0x0ac8c7130b80: 00 f9 f9 f9 f9 f9 f9 f9 04 f9 f9 f9 f9 f9 f9 f9
  0x0ac8c7130b90: 04 f9 f9 f9 f9 f9 f9 f9 04 f9 f9 f9 f9 f9 f9 f9
  0x0ac8c7130ba0: 00 00 00 00 00 00 00 00 00 00 f9 f9 f9 f9 f9 f9
  0x0ac8c7130bb0: 04 f9 f9 f9 f9 f9 f9 f9 04 f9 f9 f9 f9 f9 f9 f9
=>0x0ac8c7130bc0: 04 f9 f9 f9 f9 f9[f9]f9 04 f9 f9 f9 f9 f9 f9 f9
  0x0ac8c7130bd0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
  0x0ac8c7130be0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
  0x0ac8c7130bf0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
  0x0ac8c7130c00: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
  0x0ac8c7130c10: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
Shadow byte legend (one shadow byte represents 8 application bytes):
  Addressable:           00
  Partially addressable: 01 02 03 04 05 06 07
  Heap left redzone:       fa
  Freed heap region:       fd
  Stack left redzone:      f1
  Stack mid redzone:       f2
  Stack right redzone:     f3
  Stack after return:      f5
  Stack use after scope:   f8
  Global redzone:          f9
  Global init order:       f6
  Poisoned by user:        f7
  Container overflow:      fc
  Array cookie:            ac
  Intra object redzone:    bb
  ASan internal:           fe
  Left alloca redzone:     ca
  Right alloca redzone:    cb
  Shadow gap:              cc
==2532658==ABORTING
```

[1] https://github.com/google/sanitizers/wiki/addresssanitizer

* disable tests broken on linux

* add a suppression file for known leaks

* attempt at adding an ASAN workflow

* fix autogen

* Update workflow.yaml

---------

Co-authored-by: openshwprojects <85486843+openshwprojects@users.noreply.github.com>
2025-05-31 14:27:02 +02:00
openshwprojects
162e4df354
Update workflow.yaml 2025-04-23 00:28:35 +02:00
openshwprojects
5d09349b9d
also add XR806 to online builds (it boots but there is some issue with WiFi?)
* Update .gitmodules

* w

* Manually added submodule OpenXR

* Update Makefile

* Update Makefile

* Update Makefile

* Update OpenXR806

* Update OpenXR806

* Update OpenXR806

* Update hal_wifi_xr809.c
2025-04-19 11:58:35 +02:00
openshwprojects
379f7cb00e
XR872 online builds (#1609)
* Update workflow.yaml

* Update Makefile

* Update .gitmodules

* Update .gitmodules

* Manually added submodule OpenXR872

* Update workflow.yaml

* Update .gitmodules

* Update OpenXR872

* Update OpenXR872

* Update OpenXR872

* Update OpenXR872

* Update OpenXR872

* Update workflow.yaml

* Update OpenXR872
2025-04-19 08:17:56 +02:00
openshwprojects
0ea1983049
add IRRemoteESP8266 IR alternate version to online builds (vfonov PR)
* add IRRemoteSP

* fx

* Update IRsend.cpp

* f

* fix

* s

* irRemoteESP

* Update obk_config_irRemoteESP.h

* w
2025-04-18 18:24:13 +02:00
openshwprojects
64ec573482
EXPERIMENT: allow alternate build permutations (with berry), should not break anything
* Update obk_config.h

* Update workflow.yaml

* Update obk_config.h

* v2

* Update workflow.yaml

* test

* tr3

* ffs

* save fx

* Update workflow.yaml

* APP NAME FX?

* Update workflow.yaml

* Update workflow.yaml

* Update workflow.yaml

* Update workflow.yaml

* test

* Update obk_config.h

* Update win_main.c

* Update Makefile

* test

* Update obk_config_berry.h

* test

* test

* matrix

* Update workflow.yaml

* Update obk_config.h
2025-04-17 22:51:58 +02:00
NonPIayerCharacter
9a7447fd4b
Fix T build (#1607) 2025-04-16 09:11:50 +02:00
Bartosz Nitka
7e1afd0fdf
[POC] Run berry-lang (#1544)
* setChannel(ch, v) in Berry

* try

* t2

* b

* fx

* update to berry with autogenerated files

* Add debug to find out whether the submodule is really checked out

* Revert "Add debug to find out whether the submodule is really checked out"

This reverts commit 40ec2f667716aa20180305ec7c3f1e61e88394c8.

* Add src/berry checkout to every build

* berry separate file p1

* #define ENABLE_OBK_BERRY 1 on Beken only

* Compile in obkSimulator

Compiles, but crashes in parser.
Seems like the Berry code has not been tested under MSVC2017.

* Checkout with submodules in obkSimulator workflow

* berry with ffs msvc fix

* berry autogen fiasco fix

* OpenBK7231T compiles from official berry, handle prebuild

Breaks obkSimulator

* Fix botched rebase on .gitmodules

* Build in msvc with a berry prebuild step (requires python)

* MSVC: also extend include directories for Release

* Fix BK723x build, extract common berry build rules into berry.mk

* Fix OpenBL602 build

This doesn't actually compile berry for OpenBL602, but makes compile
errors go away and marks where further work will be needed.

* working delayMs

Test Plan:
```
berry state = 1; var tick; def tick() state = 1 - state; channelSet(1, state); delayMs(1000, tick); end; tick();
```
can be stopped with `stopAllScripts`

* only use os_realloc on PLATFORM_BK7231T

* Move as much berry logic as possible out of cmd_script

* Guard more with ENABLE_OBK_BERRY

* upload script

* file operations & working import

* enough to implement "Advanced turn off after time with timer on UI and timer setting on UI and kept in flash"

* experiments

* clang-format -i src/berry/be_*.{h,c} src/cmnds/cmd_berry.c

* Remove redundant hfile != NULL

Calling with hfile == NULL would be bug in some other part of the code

* Don't checkout other submodules for simulator build

* remove stray debug & .user files

* Use be_newcomobj

* Build sim on linux

* build linux sim [2]

* threads & tests

* Leave enabled on Windows, disable on BEKEN

* SIM_RunWindow fix?

* allow "startScript test.be" as a shorthand for "berry import test" ??

* test?

* fix /

* test arg

* test2

* test

* test add

* fx

* test

* just checking if i can use import without module?

* test with module

* CMD_StopBerry fix?

* run obk command from berry? probably not good idea due to the stack size, will delay execution later?

* str arg

* test to see if i have to repeat import

* submit unfinished code

* concat tst

* more tests

* fix copy/paste mistake, add fib test

* fx

* channelSet

* fx

* try

* tester.fib(11)

* rename

---------

Co-authored-by: Tester23 <85486843+openshwprojects@users.noreply.github.com>
Co-authored-by: NonPIayerCharacter <18557343+NonPIayerCharacter@users.noreply.github.com>
2025-03-30 20:37:37 +02:00
NonPIayerCharacter
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
NonPIayerCharacter
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
NonPIayerCharacter
d4d6c69be3
BK7238 (#1527)
* beken new sdk + bk7238

* fix bk7238
2025-02-14 22:22:59 +01:00
NonPIayerCharacter
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
openshwprojects
9b84004ae7
Update workflow.yaml 2025-01-05 15:19:48 +01:00
NonPIayerCharacter
2a9a7270f2
RTL8710C/RTL8720C support (#1468)
* Move delay us and wdt to hals, update workflow

* rtl8720c initial

* move uart to hal

* rtl uart

* obk adjustments

* sdk adjustments, fix ota

* add some features

* fix some warnings

* esp uart + tr6260/esp tcp_msl

* add bl0937, adjust ota

* enable artifacts merge

* add forgotten ln882h delay

* fix mqtt, pwm on boot

* irq fix

* fix wifi disconnect

* update sdk, change lfs location and size

* Update Makefile
2025-01-01 12:11:49 +01:00
NonPIayerCharacter
532a90313c
TR6260 support (#1446)
* TR6260 initial

* fix gh-actions

* various fixes/features

* wifi fast connect fix

* fix gpio, add i2c

* move config to obk
2024-12-12 18:55:26 +01:00
NonPIayerCharacter
c50515603a
ESP32 support (#1344)
* esp-idf

* fix, add s2, s3

* fix + ci

* fix naming

* ota

* adc

* reboot reason

* wdt + uart

* dht + ds1820

* fix esp32

* pwm

* uart hack

* fix build

* charts

* increase stack size

* tests

* fix timer

* optimize

* further c2 optimization

* gpio test, wifi reconnect fix

* gpio test

* Revert ledc freq

* cht83xx, increase inttemp stack size

* fix

* S3 fix, enable sht3x, pwm freq selection

* gpio & i2c fix attempt

* s2 fix

* Update defines for DHT

* Update sdk

---------

Co-authored-by: openshwprojects <85486843+openshwprojects@users.noreply.github.com>
2024-11-06 14:47:22 +01:00
MaxineMuster
5906d536eb
Fix release sometimes missing windows binaries (#1405)
Update workflow.yaml try fix (sometimes) missing windows binaries by adding "build2" as "needs" for release
2024-10-29 08:46:52 +01:00
openshwprojects
20d21d0a53
testing (#1354)
* run

* print socketg error on change

* typo

* resa

* fix??

* try

* try error

* fix error, add more info

* some tests

* more self tests

* tests
2024-09-21 07:21:19 +02:00
Tester
a4975477e2 fix exapmples 2024-09-20 18:17:09 +02:00
Tester
d85528a2c1 copy bats 2024-09-20 08:33:03 +02:00
openshwprojects
4c716fb487
include samples (#1353) 2024-09-20 08:20:59 +02:00
Tester
649b02b655 fx 2024-09-20 03:35:54 +02:00
Tester
a548daaccc fx 2024-09-20 03:26:20 +02:00
Tester
907747d2e3 trying to fix gh path 1 2024-09-20 03:17:27 +02:00
Tester
b406424b77 test rel bin 2024-09-19 23:16:29 +02:00
Tester
f5751812c8 release bin p1 2024-09-19 23:03:20 +02:00
openshwprojects
23cf6c59d0
add sim bin - test
* Update workflow.yaml

* Update README.md

* Update new_pins.h

* Update workflow.yaml

* Update workflow.yaml

* fx

* fx

* fx

* rellll

* fix

* fix errors

* ddddddd

* qqq

* fx

* tr

* w

* s

* tr

* tr

* tr

* tr

* tr

* tr

* tr

* tr1

* tr

* tr

* test

* tr

* tr3

* fix

* tr1

* Update workflow.yaml

* dlls

* tr

* tr

* needs

* flat

* tr
2024-09-19 22:18:24 +02:00
openshwprojects
2c17531188
Update workflow.yaml 2024-06-05 17:28:23 +02:00