Commit Graph

2945 Commits

Author SHA1 Message Date
XJ
71ce6d33bc tuyaMcu_sendCmd without second param bugfix (#1585) 2025-03-28 23:23:28 +01:00
XJ
04ab04ccfc HASS - Sensor name 'Battery' also for BATTERY_CHANNEL_SENSOR (#1583)
* Sensor name 'Battery' also for BATTERY_CHANNEL_SENSOR

* .

* changed unique_id to battery_ch to avoid collision

* spaces

* updated comment
2025-03-26 22:15:18 +01:00
openshwprojects
2d43185902 Port Simulator to Linux - p1
* intial makefile for windows sim

* netdb

* tr

* fx

* fxes

* fxes

* fxes

f

* fxes

* fxes

* fxes

* fx

* fx

* fxes?

* fxes

* better?

* stubs

* more

* fxes

* fx?

* comment out sleep

* but only in self test

* add assertion keyword

---------

Co-authored-by: Alexandre Oliveira <rockytvbr@gmail.com>
2025-03-26 22:13:39 +01: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
Kim Su
33c844bae1 added Tasmota command json to get compatibility with SmartThings Tasmota Edge Driver (#1581)
* added Tasmota command json in order to get compatibility with SmartThings Tasmota Edge driver

* revert missing parts
2025-03-25 10:52:14 +01:00
Tester23
b80fff5d40 added TuyaMCU delta option for per-dpID calibration like temperature, etc 2025-03-23 09:23:57 +01:00
Tester23
64b4136283 command to send mqtt group 2025-03-23 08:49:14 +01:00
Pavel Rochnyak
c30dcbf205 DS1820: Fixes and style improvement (#1572)
* drv_ds1820_simple.c: Refactor using "Return Early Pattern"

Function DS1820_OnEverySecond() has too much nesting conditions.
Nonlinear flow of the code is hard to follow.

Also added define for magic constants.

* drv_ds1820_simple.c: Fixed incorrect first reading

DS1820_DiscoverFamily() call between OWReset() and OWWriteByte(Pin, COMMAND) causes command to ignore.

Closes: #1571

* drv_ds1820_simple.c: reset all state variables on driver start

* drv_ds1820_simple.c: Implemented DS1820_SetResolution command

* drv_ds1820_simple.c: Mark functions as static

* drv_ds1820_simple.c: Call DS1820_DiscoverFamily() from DS1820_driver_Init() so DS1820_SetResolution could be called from autoexec.bat
2025-03-17 08:38:45 +01:00
NonPIayerCharacter
9ad08c17b6 bl0937 (#1569) 2025-03-16 08:25:42 +01:00
NonPIayerCharacter
7ace8c31ba tr6260 (#1564) 2025-03-13 09:01:58 +01:00
Bartosz Nitka
9af814c490 Expand testRealloc (#1563)
* Expand testRealloc

I was debugging an issue in another pull request and I noticed that
`realloc` was behaving weird on my OpenBK7231T device.

I've found #298, so it looked like a known problem.

The old test doesn't hang my device, so extended it and it looks like
sometimes reallocated memory gets overwritten.

Here's a log from my device:
```
Info:CMD:Realloc difference: rep 90, i 2 j 0 initialra1 230 ra1 242 msg[j] 8 (j % 100) 0
Info:CMD:Realloc difference: rep 90, i 2 j 1 initialra1 230 ra1 242 msg[j] 121 (j % 100) 1
Info:CMD:Realloc difference: rep 90, i 2 j 2 initialra1 230 ra1 242 msg[j] 66 (j % 100) 2
Info:CMD:Realloc difference: rep 90, i 2 j 3 initialra1 230 ra1 242 msg[j] 0 (j % 100) 3
Info:CMD:Realloc difference: rep 90, i 2 j 4 initialra1 230 ra1 242 msg[j] 88 (j % 100) 4
Info:CMD:Realloc difference: rep 90, i 2 j 5 initialra1 230 ra1 242 msg[j] 1 (j % 100) 5
Info:CMD:Realloc difference: rep 90, i 2 j 6 initialra1 230 ra1 242 msg[j] 0 (j % 100) 6
Info:CMD:Realloc difference: rep 90, i 2 j 7 initialra1 230 ra1 242 msg[j] 0 (j % 100) 7
Info:CMD:Realloc has been tested! Total calls 90, reps now 100, reallocBroken 1
```

It's pretty non-deterministic, but during my debugging I've noticed it's
related to timers and one way we use timers is logging.

Issue #298 mentions eaf4e1a606/platforms/bk7231t/bk7231t_os/beken378/os/mem_arch.c (L30)
which references `platform_is_in_interrupt_context` which I assume is
related to timers as well.

* Technically malloc and realloc could return NULL

* Unbreak CI by restoring obk_config.h
2025-03-12 15:00:34 +01: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
a5301939a7 Update hal_wifi_bk7231.c (#1560)
Ensure that connected event is triggered only once.
2025-03-06 21:07:46 +01:00
alexsandroz
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
Tester23
49a466aecb float change callback temp fix 2025-03-05 08:51:37 +01:00
Tester23
8c01b0cf83 test for addChangeHandler Channel20 != 0 2025-03-05 07:27:02 +01:00
openshwprojects
55e76b504a PWM frequncy select and move freq code outside hal (#1554)
* test

* w

* fx

* fx

* reapply to change pwm ffreq?

* array
2025-03-02 15:03:20 +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
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
Tester23
23e67076c3 ip parse test 2025-02-26 22:32:11 +01:00
Tester23
e67d605964 Fix warnign 2025-02-26 22:27:33 +01:00
Tester23
0d18dd0a22 expression test 2025-02-26 20:43:40 +01:00
Tester23
1b455ef82e most basic tests 2025-02-26 20:40:18 +01:00
Tester23
a00d88b2a1 add test driver - disabled by default 2025-02-26 20:35:26 +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
openshwprojects
974d97acda try ln flash read (#1547)
* try flash read

* fx

* clera buffer so we won't get nonsense

* clear buffer
2025-02-25 22:58:29 +01:00
Tester23
9b9f6359d4 remove printf per request 2025-02-24 10:06:05 +01:00
Tester23
1ea3519307 script pwm 2025-02-23 20:35:18 +01:00
openshwprojects
80111be27e Update hal_pins_ln882h.c 2025-02-20 08:35:07 +01:00
openshwprojects
e88875a458 Update hal_generic_bk7231.c 2025-02-15 10:34:33 +01:00
NonPIayerCharacter
d4d6c69be3 BK7238 (#1527)
* beken new sdk + bk7238

* fix bk7238
2025-02-14 22:22:59 +01:00
Tester23
437bd68daa xr806 p2 2025-02-10 00:02:02 +01:00
Tester23
dd75d3f773 xr806 p1 2025-02-09 23:43:49 +01:00
XJ
4dde6c80a9 Uart2bufmod - mod for using 2 UARTs simultaneously (#1516)
* Mod for using 2 UARTs simultaneously (Beken)

* .

* uartindex checking

* return undefided bug

* changed index to pointer to struct, corrected buffer on devices with UART_2_UARTS_CONCURRENT disabled

* retrigger checks
2025-02-04 20:01:35 +01:00
giedriuslt
0c517431d8 Fix multi-line startup command for BL602 (#1529) 2025-02-04 13:13:06 +01:00
openshwprojects
a5b536b0d5 Update obk_config.h 2025-02-02 19:46:24 +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
divadiow
017929d189 enable GPIO13 - Update hal_pins_tr6260.c (#1526) 2025-02-01 14:03:40 +01:00
Tester23
8a3ecb5aaf enabe discoevry on rtl 2025-01-29 06:30:28 +01:00
Tester23
125ebc9d61 uuse new type 2025-01-28 05:02:19 +01:00
Tester23
7495c70322 f div 1000 type 2025-01-28 04:56:25 +01:00
Tester23
0b39365b54 DP_TYPE_RAW_VCPPfF 2025-01-27 17:02:07 +01:00
Tester23
e5e6a962ea tuyamcu command for config mode (access point) 2025-01-27 14:25:47 +01:00
Tester23
f1fb56f3c2 fix mcu 2025-01-27 06:24:29 +01:00
Tester23
ed1d815d20 respect CHANNEL_MAX in channels API 2025-01-27 06:22:11 +01:00
Tester23
3df11217c7 stub for parsing TUYA_CMD_WIFI_SELECT 2025-01-27 06:16:10 +01:00
openshwprojects
bc35f97f1a temporary bl602 commandline crash fix 2025-01-27 05:37:13 +01:00
Pavel Rochnyak
7e942c3467 BL0937: Fixed swapped division and multiplication in measured value correction (#1280)
value = pulses / time

More pulses for same time - bigger value.
More time for same pulses count - smaller value.
Twice more pulses for twice time - same value.
2025-01-26 14:59:50 +01:00
openshwprojects
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
giedriuslt
1ef7c8192f publish energy mqtt data with qos zero (#1518) 2025-01-22 13:51:23 +01:00