Commit Graph

122 Commits

Author SHA1 Message Date
54d5ae7e16 Driver for NEO6M GPS module (#1890)
* Driver vor NEO6m GPS receiver
Tested on W800

* Some tweaks:
empty RX buffer betewwn readings
on several unsuccessful reads, try enabling the NMEA RMC messages again

* empty buffer every second
remove commented out old code

* fix broken log if no lat/long NS or EW is present

* Add "savecfg" argument to save config to NEO after configuring - so next time we might use it without sending commands to NEO module
this way, only NEOs Tx is needed (and OpenBekens Rx)

---------

Co-authored-by: openshwprojects <85486843+openshwprojects@users.noreply.github.com>
2025-12-21 12:30:01 +01:00
51210453f2 only add rc to vcproj, no new features 2025-12-20 20:08:42 +01:00
a34f90bcbb DS3231 RTC driver embedded in "local clock" (PR#1729) (#1792)
* Try NTP split update to actual source

* fix windows makefiles and timed_events

* fix typo

* Fix sprintf format

* sprintf format - next try to fix for ESP and ESP8266

* sprintf - special case for ESP8266

* Adding GUI button to set clock

* fix

* Add debug output

* fix missing HTTP output
use original obk_config.h - only renaming functions - to see filesizes

* limit functions to NTP ode CLOCK present

* try fix selftests

* Enable simple clock for all platforms, even if NTP is not enabled

* test fixing merge-conflict

* try fixing merge conflicts #1

* try fix merge conflict

* Fix typos
consolidate time display on main page
fix double comments preventing several documentation details ($mday, $month ...) on docs/constants.md
enabling more time stuff for W800 for local testing.

* Fix setDST argument passing

* only test DST if clock is running

* Fix setting epoch time - use atol(<string arg>) instead of Tokenizer_GetArgInteger(0) for epoch
Change user_main.c to use xticks as uptime for g_secondsElapsed

* Fix g_secondsElapesd for Windows - no xTicks there so stick to old way with g_secondsElapesd++ here ...

* Fix simulator build
remove additional defines for W800 used for testing

* Use esp_timer_get_time() instead of xTicks for ESP.
Seems much better, 30 seconds difference in one day
(used to be over 10 minutes off in 12 hours)

* Include DS3231 code

* Include DS3231 RTC driver

* Try simple fix for TXW81X without RTOS

* Second try fix TXW81X

* Fix comments for doc

* fix obk_config (still using "#define ENABLE_NTP_SUNRISE_SUNSET" instead of new "#define ENABLE_CLOCK_SUNRISE_SUNSET")
fix RDA5981
(as already done in branch Split_NTP_new)

* fix deviceclock code for corrected #define

* enable DS3231 driver for all platforms to test compilation and compare sizes

* fix selftest DST and sunrise/sunset (command names are "CLOCK_..." not "NTP...")

* Fix selftest for DST and sunset/sunrise events

* Add debug to try fixing selftest issue

* more debug

* Disable bedug output after fix.

* Disable DS3231 for all platforms. To tes, use previous commit

* Fix comments and handling of year when setting time of DS3231
Switch to internal time functions to reduce flash usage (avoid gmtime and mktime)

* Fix direct acces of NTP-time via g_ntpTime - use function "Clock_GetCurrentTime()"
switch to obktime instead of time.h "gmtime"

* Fix missing include for deviceclock and obktime

* made ds3231 driver dependent on "#define ENABLE_DRIVER_DS3231"
change "deviceclock.c" to set DS3231 RTC on every clock set command if driver is running, so e.g. every NTP update will also adjust RTC time

* fix missing includes for DRV_IsRunning() and DS3231_SetEpoch()

* introducing DS3231_informClockWasSet(bool force) - called by drv_deviceclock whenever clock is set.
so DS3231 driver can ste the clock, if needed - using "force" will force setting (no supprise ;-))

* Fixes to drv_main.c (missing args for onHassDiscovery)
Fixed missing arg "bPreState" in XX_AppendInformationToHTTPIndexPage()
Changed name from CLOCK to TIME
changed some "gmtime" to obktime "calculateComponents()a

* fixes

* fix obk_config.h

* fix missing include

* fix include for drv_txw81x_camera.c

* Directly call TIME "driver" functions, but don't use as real driver - so hiding it's presence in GUI

* fix missing OnEverySecond for TIME

* Prepare for merge: disable DS3231 driver for all platforms

* fix broken obk_config.h

* revert unintended change of src/driver/drv_max72xx_single.c
2025-12-04 14:46:51 +01:00
e9e20ed445 esp8266 ADC, EEPROM driver, max7219 simulator
* test

* Update workflow.yaml

* t

* makes

* Update drv_simpleEEPROM.c

* Update drv_simpleEEPROM.c

* ber

* Update workflow.yaml

* tt

* ber

* charts

* owm

* tt

* rem charts

* smaller

* test

* test

* fixes

* test

* charts

* comments

* test

* tt

* test

* add file to proj

* try to add pin 13 as ADC (testing in progress)

* test

* test

* MAX7219 simulator HACK

* final fixes

* Update drv_max72xx_internal.c

* restore

* fx
2025-11-23 14:01:04 +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
f2c87bf690 merge max72xx clock progress and i2c pinwide scanner and misc fixes
* MAX72XX

* better

* faster buof

* eext

* test

* fx

* fxes

* tr

* fx

* Update drv_max72xx_clock.c

* fxes

* test

* fxes

* tests fxes

* fxes

* scr

* fx

* Update drv_local.h

* show

* Update drv_max72xx_clock.c

* test

* Delete lastEnumTemplate.txt

* TEST

* scan

* Update drv_main.c

* Update obk_main.cmake

* Update drv_multiPinI2CScanner.c

* dbg

* fxes

* Update drv_multiPinI2CScanner.c

* Update drv_multiPinI2CScanner.c

* Update drv_multiPinI2CScanner.c

* owm

* osm test

* restorew platfotms

* Update selftest_openWeatherMap.c

* test

* getter

* Update obk_config.h
2025-11-11 16:27:13 +01:00
73bbc45126 merge partition search driver (disabled by default)
* test

* search

* fx

* fx1

* enavble

* Update obk_main.mk

* 0x200000

* Update drv_bkPartitions.c

* chk

* crc

* finalize

* fxes
2025-11-04 20:29:54 +01: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
6ea915a574 prelimary support for DDP sending - not tested outside simulator
* ddp send stub etc

* queue

* Update drv_ddp_send.c

* sender

* Update drv_ddp_send.c

* q

* enable

* fx

* test

* fx

* Update selftest_ws2812b.c

* Update drv_ddpSend.c

* Update drv_ddpSend.c

* hder

* test - will udp send adn receive work on github workflw?

* better wait method for self test
2025-08-29 20:18:31 +02:00
670798a83a merge LED strip backend separation before DMX support
* stub

* clear

* clear upo

* one more test

* split

* fx

* Update drv_led_shared.c

* step

* split

* Update drv_leds_shared.c

* Update selftest_ws2812b.c

* port

* dmx

* DMX

* s

* with test

* fix

* fx

* ChType_Ph test and RGBW test

* ddp formats unfinished

* Update selftest_ws2812b.c

* Update selftest_hass_discovery_ext.c

* fxes
2025-08-28 21:52:59 +02:00
e6dbea6007 simple TCA9554 driver, enabled by default on 4MB ESP32, for Waveshare barrd
* TCA9554

* fx

* proj

* makeff

* io

* better

* fx

* TCA9554 almoisy

* test

* fx
2025-08-22 09:07:28 +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
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
a72fe4a4c5 add software SPI flash support (disabled by default) along with ultra-fast BK7231 software SPI and ability to store littlefs on that SPI , rel: https://www.elektroda.pl/rtvforum/topic4133583.html
* tt

* tt

* kk

* Update drv_spi_flash.c

* Update drv_spi_flash.c

* Update drv_spi_flash.c

* Update drv_spi_flash.c

* Update drv_spi_flash.c

* nodelay

* Update drv_spi_flash.c

* Update drv_spi_flash.c

* Update drv_spi_flash.c

* Update drv_spi_flash.c

* Update drv_spi_flash.c

* Update drv_spi_flash.c

* test

* test

* test

* tt

* Update our_lfs.c

* Update our_lfs.c

* Update our_lfs.c

* Update our_lfs.c

* Update our_lfs.c

* t

* Update drv_spi_flash.c

* Update drv_spi_flash.c

* ttt

* Update drv_spi_flash.c

* unrolll

* Update drv_spi_flash.c

* Update drv_spi_flash.c

* Update drv_spi_flash.c

* Update drv_spi_flash.c

* Update drv_spi_flash.c

* Update drv_spi_flash.c

* better wait for logic

* Update drv_spi_flash.c

* revert

* Update drv_spi_flash.c

* PLATFORM_BEKEN_NEW fix???

* faster?>

* faster?

* test memory

* test2

* restore

* coarse time test

* test

* restore

* DISABLE
2025-08-09 19:13:17 +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
69121fb252 merge gosund sw2 port (not clear if it will be used) 2025-06-30 21:56:13 +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
5899b0c7e5 CSE stub (unfinished)
* test1

* Update CMakeLists.txt

* Update drv_cse7761.c

* tr

* dbg

* Update hal_uart_espidf.c

* Update hal_uart_espidf.c

* Update hal_uart_espidf.c

* cmnt
2025-05-23 10:23:01 +02:00
d07c72a0ca AC TCL driver - part 1
* ac t1

* test

* fx

* fx

* p

* build_set_cmd

* try enable

* makefile

* make

* header

* self test

* parsing - not tested

* rename for easier testing

* add src

* print len

* parity

* FIX PARITY - 2

* SwingH and SwingV

* w

* files

* Update drv_tclAC.c

* display vals

* few berry tests

* disable
2025-05-18 18:24:21 +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
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 40ec2f6677.

* 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
a00d88b2a1 add test driver - disabled by default 2025-02-26 20:35:26 +01:00
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
cafa3619a5 Add commands to check if actual time is in DST or not (#1429)
* Add commands to check if actual time is in DST or not

New command "clock_calcDST nthWeekEnd monthEnd dayEnd hourEnd nthWeekStart monthStart dayStart hourStart"
to set the DST start and end rule.

$isDST will return 1 if DST is active, 0 else

It's enabled with

* switched from strftime to ctime to get smaller memory footprint

* disabled feature by default in obk_config.h (enabled for Windows for possible testing)

* try selftest for DST

* enable Test_NTP_DST() in win_main.c

* fix missing NTP offset settings, fix LOG

* Add possibility to set g_ntpTime according to DST settings
tried to reduce image sizes by avoiding mktime
still image size for this feature varies very much:

LN882H: 2.2k in bin / 1.5k in OTA
Beken:  4.3k in rbl
BL602:  21.4k in bin / 9.7k in ota

This commit has feature enabled, to get images for testing, will change it to disabled by default in next release

* disable feature for all plattforms but windows (to allow tests)

* Fix selftest - all DST changes are now done by the system!

* Fix selftest - setsimulated time must also call setDST as "real" ntp setting

* Next try to fix selftests

* For testing switch back to mktime

* New try to reduce image by avoiding time functions
Fix own leap year calculation

* Disable feature for all platforms but Windows (to keep selftest)
2024-12-28 22:23:21 +01:00
f099183753 self test for conditional relay 2024-12-28 22:21:07 +01:00
30a530d16d OpenWeatherMap driver part 1
* TEST1

* thr

* tr

* fx

* fx

* fx

* fx

* w

* qq

* stack

* w

* w

* 2v

* fx

* tes without close

* try

* close

* w

* w

* header

* owm windows and display on http debugf text

* skip http header

* weather checkpoint

* disable on beklen
2024-12-03 11:25:02 +01:00
dbc2cc4b49 proj 2024-12-01 13:08:16 +01:00
400e48f242 fix warnings p2 2024-09-27 18:10:44 +02:00
d8ccf4e9b1 Simulator: DHT object, read temperature/humidity from DH11 object 2024-09-22 19:27:40 +02:00
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
783eb96264 self test for sign and value 2024-06-19 20:27:17 +02:00
59fcf19bbd SM15155E support
SM15155E support
2024-06-12 10:54:36 +02:00
7a7ad1eba0 Drawers (#1232)
* drawers draft

* test

* support post as well

* Update drv_drawers.c

* ambient

* add led_ambient

* foolproof compile

* disable drivers before merge
2024-05-14 10:41:33 +02:00
0a1520b604 add door sensor self test 2024-05-11 11:17:16 +02:00
35beeaaf06 includfe HD2015 in prj 2024-05-07 16:55:17 +02:00
52383326ca add pixe;lanim to prtoject 2024-05-07 12:38:48 +02:00
7aa735b7de add a link between simulator and per pixel drv 2024-04-29 00:08:39 +02:00
ef2ef4a23f allow SM16703P driver compilation on windows (self test stub) 2024-04-28 21:28:14 +02:00
e0f7506bf2 bl602 watchodg (#1158)
* first attempt

* header

* add freeze driver

* add bl_timer_tick_enable

* remove timer enable
2024-03-31 20:38:13 +02:00
fe4e61eba3 MAX6675 stub 2024-02-23 22:59:57 +01:00
44652fb0a1 split selfttest http led, add more tests 2024-02-23 21:26:39 +01:00
af2c720752 Update openBeken_win32_mvsc2017.vcxproj 2024-01-01 09:24:35 +01:00
71288859ed add rn8209 to proj 2023-11-29 21:01:22 +01:00
c84d69904e rename driver functions to correctly reflect every second/quick tick call types 2023-11-06 14:40:06 +01:00
efb30a3de6 Text scroller driver 2023-10-29 15:04:06 +01:00
c000268ba3 PT6523 text (font) 2023-10-28 18:58:39 +02:00
0e9ac33b9e PT6523 STUB 2023-10-28 11:05:42 +02:00
841aade755 fix build without lfs 2023-09-28 08:41:00 +02:00
a746bd6ada adc smoother p2 2023-08-30 01:50:56 +02:00
a362dc0d36 charging driver small self test 2023-08-09 01:31:47 +02:00