Code Monkey home page Code Monkey logo

openshwprojects / openbk7231t_app Goto Github PK

View Code? Open in Web Editor NEW
1.3K 39.0 218.0 25.07 MB

Open source firmware (Tasmota/Esphome replacement) for BK7231T, BK7231N, BL2028N, T34, XR809, W800/W801, W600/W601 and BL602

Home Page: https://openbekeniot.github.io/webapp/devicesList.html

C 78.67% Makefile 0.49% JavaScript 1.81% CSS 0.08% C++ 18.88% Dockerfile 0.02% Shell 0.05% Batchfile 0.01%
wifi iot mqtt smart-home tuya tasmota bk7231 bk7231n bk7231t bl602

openbk7231t_app's People

Contributors

abdul2000 avatar avigeilpro avatar boozeman avatar btsimonh avatar darvigettad avatar dheenhasty avatar diggar avatar divadiow avatar dschndr avatar exploware avatar giedriuslt avatar iglooom avatar ilengyel avatar iprak avatar luisthe0ne avatar masj-mobica avatar michaelkamprath avatar no2chem avatar openshwprojects avatar pieter12345 avatar rogere66 avatar softplus avatar stef-90 avatar stefan064 avatar sweetlilmre avatar talltechdude avatar tarwirdur avatar valeklubomir avatar warewolf avatar zuckschwerdt avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

openbk7231t_app's Issues

BK7231N+BL0937 The device hangs.

When it activates the controller from BL0937 after some time (about an hour) the device stops working. There is nothing special in the logs. I had a preview in logs through the www all the time.
Log tip:

Info:MAIN:Time 4986, free 91368, MQTT 1, bWifi 1, secondsWithNoPing -1, socks 2/38
Info:BL0942:Voltage pulses 1803, current 0, power 0
Info:BL0942:Voltage 238.951813, current 0.000000, power 0.000000
Info:MAIN:Time 4987, free 91368, MQTT 1, bWifi 1, secondsWithNoPing -1, socks 2/38
Info:MQTT:Publish result: -3
Info:BL0942:Voltage pulses 1803, current 0, power 0
Info:BL0942:Voltage 238.951813, current 0.000000, power 0.000000
Info:MAIN:Time 4988, free 91368, MQTT 1, bWifi 1, secondsWithNoPing -1, socks 2/38
Info:BL0942:Voltage pulses 1803, current 0, power 0
Info:BL0942:Voltage 238.951813, current 0.000000, power 0.000000
Info:MAIN:Time 4989, free 91368, MQTT 1, bWifi 1, secondsWithNoPing -1, socks 2/38
Info:BL0942:Voltage pulses 1803, current 0, power 0
Info:BL0942:Voltage 238.951813, current 0.000000, power 0.000000
Info:MAIN:Time 4990, free 91368, MQTT 1, bWifi 1, secondsWithNoPing -1, socks 2/38
Info:GEN:dhcp=0 ip=10.0.0.46 gate=10.0.0.1 mask=255.255.255.0 mac=c8:47:8c:01:64:99
Info:BL0942:Voltage pulses 1807, current 0, power 0
Info:BL0942:Voltage 239.481934, current 0.000000, power 0.000000
Info:MAIN:Time 4991, free 91048, MQTT 1, bWifi 1, secondsWithNoPing -1, socks 2/38
Info:BL0942:Voltage pulses 1807, current 0, power 0

Info:BL0942:Voltage 239.481934, current 0.000000, power 0.000000

Info:MAIN:Time 4992, free 91368, MQTT 1, bWifi 1, secondsWithNoPing -1, socks 2/38

Info:MQTT:Publish result: -3

Power monitoring supported?

I have some DIN relays with power monitoring.
It doesn't look like power monitoring is supported yet. I have 3-4 (similar) different brand devices here I can flash, is there a way I can help test?
I need power monitoring in addition to relay control.

Please add some additional information to README

Can you please add a little more text in the introduction where it mentions releases to explain the different files in the releases?
There is .rbl, QIO, UA, UG files... explain what are each of them are for?

Tasmota 'feature' compatibility

What do we NEED?

we currently have MQTT commands, specifically
cmnd/<name>/CMND : where CMND is case insensitive.

cmnd/<name>/POWER
accepts 0-100 for setting channel 0
cmnd/<name>/POWERn
accepts 0-100 for setting channel n

cmnd/<name>/color
accepts #xx or #xxyy or #xxyyzz or #xxyyzzaa ox #xxyyzzaabb
Each 2 digit hex sets a value in a PWM channel in channel order. 2 digit hex is converted from 0-255 to 0-100 to set the channel.

We currently do not publish TAS style (i.e. no stat/<name/CMD

Please attach comments here for 'nice to haves'....

add ADC Temp

please add

NTC thermistor a B value of 3950 100k
resistor 20k
scheme:
https://github.com/Alexxx113/hlam/blob/main/IMG_20220716_015555.jpg

tasmota name ADC TEMP

work haas
config:

sensor:

  • platform: mqtt
    state_topic: "koridor/5/get"
    name: "mqtt temp sens koridor"
    qos: 1
    device_class: power
    availability_topic: "koridor/connected"
    #device_class: temperature
    #state_class: measurement
    #last_reset_value_template: "00"

template:
sensor:
- name: Temperatura NTC
unique_id: temperatura_koridor
device_class: temperature
state: >
{% set Vo = states('sensor.mqtt_temp_sens_koridor')|float %}
{% set c1 = 1.009249522e-03 %}
{% set c2 = 2.378405444e-04 %}
{% set c3 = 2.019202697e-07 %}
{% set R1 = 100000 %}
{% set R2 = R1 * 1023 / ( Vo - 1 ) %}
{% set logR2 = log(R2,10) %}
{% set T = ( 1 / ( c1 + c2 * logR2 + c3 * logR2**3 ) - 273.15 ) / 5 -11.3 %}
{{ T |round(1) }}
unit_of_measurement: '°C'

found an example
I have selected the parameters , under the current temperature )))

but this is not right
this is without calibration table

Adding support for IR Reciever/Transmitter

Hello, would be possible to add support or configure an IR Transmitter/Receiver?

Bought an S06 Generic transmitter and has a CBU board (BK7231N). Managed to flash OpenBk on it and works great, I can control an LED and button that the board includes, but have no way to configure the transmitter/receiver that Im aware of.

This is very close to the model I bought but instead of ESP8266 it comes with the CBU board:
https://templates.blakadder.com/auvisio_S06.html

I have some Ardunio/Programming experience, so if there is anywere documentation on how to add custom input/outputs I could try to implement this, however I am not able to find any kind of documentation or way on how to do this.

I would be able to test and try to help with the implementation if possible, it will be great if we can get this transmitters working!

Regards.

Autostart doesn't work

Hello!
Is there any way to switch on the light for the Tuya E27 LED bulb when it powers up?
I tried to add "color #000000FF" to the "startup command line", but it didn't help.
Thanks!

MQTT connection problem

I recently flashed a couple BK7231T WB2S devices (same devices) with the latest OpenBK7231T_UA_1.0.20.bin image. I had a hard time getting BKwriter to work but was able to make it work in the first attempt using hid_download_py.

The problem I am running into is with MQTT connection. I ahve noticed that if I leave user/password empty then MQTT is 0 in the log but if I enter something random e.g. user/password then connection succeeds. My MQTT server does not require authentication. Any suggestions for further debugging?

Fan has four speeds off/low/med/high

Most fans have these same 4 speeds. I have already updated my personal firmware, but I don't know how to do a pull request. Sorry about that. I'll learn I'm sure. this is echojjj

CFG_GetDeviceName

I cant compile because CFG_GetDeviceName
D:\git\bk7231\openbk7231n-master\platforms\bk7231n\bk7231n_os/beken378/func/lwip_intf/lwip-2.0.2/port/ethernetif.c:140: undefined reference to `CFG_GetDeviceName'

What i am doing wrong?

Thank you

63-character wifi password key not working

Hi,
I've tried using a 63-character wifi password key, but only shorter passwords (up to 62-character) are working. Would you be so nice an fix this minimal issue? Thank you.

PS: Thank you for this great possiblity to use the CB2S with cloudfree software

Devices hosed after OTA update to 1.10.4

I updated 3 similar OpenBK7231T plugs from 1.4.16 to 1.10.4 (OpenBK7231T_1.10.4.rbl) and they all stopped working.

The current version is now 1.10.7 but I can't tell from the changes if any fix was introduced in this regard.

OTA changes all devices name to obk8C000000

Testing OTA from device.ip.address/app page. All went well, but restore did not work, the device drops at AP-mode at the process and MAC address somehow changed to C8:47:8C:00:00:00 and the device name is obk8C000000 1.
I was testing this with 2 devices and both have the same behavior. Original device names was obk61FB56C0 1 and obk618184AB 1

Firmware was build in current git state.

My router (and anyone elses too) did not like 2 devices with the same mac address.

My humble suggestion is that we can later on use device name (and possibly the mqtt-topic name) as the same as configured MQTT settings client name.

It seems that I do the OTA flashing wrongly. I was using bin, not rbl. With rbl (and ota-server at raspberrypi:1880/firmware) new builds are installed correctly. I wonder what happened and how I get my previous mac-adressess back or is there any way to do it?

Compatibility with RTL8710BX

First of all thanks a lot for your amazing work.
Since it's not possible to start a discussion I had to open an issue.
Do you still have plans for the RTL8710BN, since I don't see releases for it and there only seems to be a demo available?
And would it be compatible with a RTL8710BX?
I have an EZVIZ T31 smart plug which I would like to convert.
Thanks in advance.

Lenovo/Tuya Bulb with BK7231N

Hey everyone.

I have a Lenovo/Tuya Bulb that if like to flash with this firmware so I can bring it into Home Assistant. I got the globe off with a bit of effort. Tons of silicone then it twists and pops off.

Anyway. Seems the power supply and the board for the wifi chip are under a metal shield I can't seem to remove.

However, the LED board has test points but are not labeled. It also has a connector to connect it with the main board and the PSU. Not sure where to start so I'm hoping for some guidance here. Apologies if this is in the wrong place.

I'll attach photos below.

Thanks!

20220710_170029
20220710_170020
20220710_170012
20220710_165938
20220710_165924
20220710_165705

Flashing on WB3S not working!

Hey Guys!

I have a problem, whenever I try to flash the WB3S with OpenBeken it simply doesn't work.
I wired it like this:
Tx1 - TX RX1 - RX VCC - 3 3V GND - GND CEN - NOTHING
(I don't have an usb uart adapter thats why i am using an Arduino, for tasmota that setup worked well)

If I start bkwriter it starts flashing but never goes further than Init and after a while it says failed.(I tried the python program too -> Cannot get bus)

Has anyone had the same problem and knows a solution?

Thanks

PS: Yes I tried with resetting after starting bkwriter and without.

BSEED Lightswitch with WB3S, can't turn off?

Hello,

I have a lightswitch that came with Tuya on a WB3S. I flashed the file OpenBK7231T_UA_1.5.8.bin on it successfully and I can now more or less use it.
The device looks a lot like https://templates.blakadder.com/bseed_2_gang.html only it has only a single switch instead of two.

I was able to configure it like this:
image

When P6 is off, an output on P10 will illuminate a red light around the button. When P6 is on, the red light will be off, no matter what P10 says.
When P10 is ON, I can use P7 to turn P6 ON. But I can't use P7 to turn P6 OFF again.

Also, with the original FW, there was a dim BLUE light around the button as well, but I can't find that on the configuration, no matter what I do (Rel, LED, PWM).

Any help would be greatly appreciated!

Kind regards,
blindcoder

Battery-powered device support

Hi!

Can your program work with battery-powered devices, such as a door opening sensor?

For example, this: https://templates.blakadder.com/TY01.html

I bought several such sensors with CB3S controllers, but it is impossible to link them locally with the standard firmware, no TUYA-MQTT converters work, the device simply does not have time to respond to the request and turns off.

OTA flashing of original tuya devices

I am wondering if there is any chance to flash tuya devices with openBK over-the-air. My device is a moodlight, which I can see no chance to open without destroying: https://github.com/tuya-cloudcutter/tuya-cloudcutter/blob/main/device-pictures/3004154.jpeg. As far as I am informed the device contains CB3S chip.

My idea is to make use of the following project: https://github.com/tuya-cloudcutter/tuya-cloudcutter:

“This repository contains the toolchain to exploit a wireless vulnerability that can jailbreak some of the latest smart devices built with the bk7231 chipset under various brand names by Tuya. The vulnerability as well as the exploitation tooling were identified and created by Khaled Nassar and Tom Clement with support from Jilles Groenendijk. Our tool disconnects Tuya devices from the cloud, allowing them to run completely locally. Additionally, it can be used to flash custom firmware to devices over-the-air.”

So,

  • The device chip seems to be supported by openBK.
  • The device should be able to be flashed ota, as it is mentioned in the supported device list of tuya-cloudcutter project, and the device is older that the bug-fixed firmware.

The remaining questions are:

  • How to combine ota flash of tuya-cloutcutter with openBK firmware?
  • And: is the device supported by openBK at all?

Maybe this could also be an interesting feature for other devices than mine which are difficult to open. I could try it with my device if anybody could describe what to do in steps. Unfortunately I am not deep enough in this all to figure out myself.

Different WiFi reconnect system

My switch restarts every 5-10 minutes because it is in a place where WiFi coverage is poor and it just loses it. This is annoying because the light then turns off. Please make a less intrusive/aggressive system for reconnecting to wifi. I want the switch itself to always be available to manual use.

PowerOnState is supported?

Hi,

I would like to know if PowerOnState (tasmota command) feature is supported, if it is, how to change its value? what I have is a smart plug and I would like it to turn on the relay as soon as it boots up.

another minor issue I noticed is the state of the switch is not updated in HA once the device is powered back on, after a powerloss. if that can be fixed somehow, it would be nice.

thank you!

BK7231N+BL0937 MQTT power data interval

Hi, can i somewhere in web interface set interval for sending MQTT voltage, power and current data? I hope for static specific time, for example every 1 seconds. Because current interval is too slow ..
thank you

BL2028N - Cannot get bus

I made the wiring to the pins as the documentation, and checked that some data from the chip were being transferred from the serial using the putty.
Unfortunatelly, when running the scripts I just receive "Cannot get bus".

This was the command issued:

python uartprogram OpenBK7231N_QIO_1.7.1.bin --unprotect -d com5 -w --startaddr 0x0
UartDownloader....
programm....
Cannot get bus. : |

Source of embedded toolchain

For the BK7231t variant, the original build_app.sh will download a toolchain from the URL:
https://airtake-public-data-1254153901.cos.ap-shanghai.myqcloud.com/smart/embed/pruduct/bk7231t_1.1.2.zip
At least some of the components of that zip file appear to be from an old GNU ARM embedded toolchain source. Other parts are chip specific. The file "bk7231t.yaml" indicates the files are provided under an MIT license, and that the source should be available from:
git: https://code.registry.wgine.com/hardware_wifi_soc/bk7231t.git
tag: 1.0.1
However, I cannot reach that URL, so I cannot reproduce the GNU parts of the toolchain from source to verify it is a vanilla build.
Since you have included the toolchain in your repo, the build process should not fetch the toolchain from the URL above, but I don't know whether the toolchain you have included is from that URL or a more authoritative source, e.g. based on https://developer.arm.com/Tools%20and%20Software/GNU%20Toolchain.
Has anyone tried using standard releases of the embedded toolchain in place of Tuya's custom archive? Or replacing the other binaries in the zip file from standard sources (or producing equivalents)?

MQTT Name with some topic

Hi, when i want to add some topic to mqtt message i can do it with adding topic/short_name .. but after reset device it stops sending mqtt messages at all.
Thank you

device name on html config page <title>?

Hi,

I have multiple devices running on this project firmware now.. Just a suggestion, it would be nice to have the device name (short or full name) included in its title tag, so that it will be easy to identify them from the first glance itself.

<title> shortname or full name </title>

Help with configuring to build

I am trying to build this app for BK7231N on my own machine but I'm not getting very far.
I follow the instructions but they aren't that clear in some parts.
I end up with loads of 'No such file or directory messages.
Here are the 'problems'

  1. I download the sdk as a zip file. The file is OpenBK7231N-master.zip. In the zip there is OpenBK7231N-master which then has various folders/files.
  2. I unzip the folders and files to c:\bk7231sdk as in the readme so I end up with c:\openbk7231sdk\apps, platforms etc..
  3. I download the app zip file. The file is OpenBK7231T_App-main.zip. In the zip there is OpenBK7231T_App-main which then has various folders/files.
  4. I unzip the folders and files to c:\bk7231sdk\apps as in the readme so I end up with c:\openbk7231sdk\apps\OpenBK7231T_App-main with various folders/files below it. I see from the b.sh this should be OpenBK7231T_App so I rename it.
  5. I open cygwin prompt and go to /cygdrive/c/bk7231sdk
  6. I run ./b.sh and get loads of file not found and Error 2

What am I doing wrong?
I have file structure:
c:\bk7231sdk
------- apps
-------------OpenBK7231N_App
---------------- .github
---------------- include
---------------- output
---------------- sdk
---------------- src
-----------tuya_demo_elp_1plug
----------- ...... 3 other tuya apps
------- platform

What should I have or what is wrong?

Thanks.

random time mqtt disconect bk7231n

mqtt Mosquitto broker (Haas)
device wifi rele:
firmware OpenBK7231N_1.4.29 work good
firmware OpenBK7231N_1.6.1 - OpenBK7231N_1.7.1
random disconect mqtt
device wifi swith:
firmware OpenBK7231T_1.4.29-OpenBK7231T_1.7.1 work good

Haas log:
Журнал событий
13 июля 2022 г.
Выключается (off)
18:50:57 - 3 минуты назад
Изменяет состояние на "Недоступно" (disconect)
18:50:46 - 3 минуты назад
Выключается
18:47:39 - 6 минут назад
Изменяет состояние на "Недоступно"
18:47:28 - 6 минут назад
Выключается
18:20:35 - 33 минуты назад
Изменяет состояние на "Недоступно"
18:20:24 - 33 минуты назад
Выключается
17:46:17 - 1 час назад
Изменяет состояние на "Недоступно"
17:46:06 - 1 час назад

OpenBK log:

Info:GEN:dhcp=0 ip=5.100.13.144 gate=5.100.13.1 mask=255.255.255.0 mac=c8:47:8c:10:60:6b 

Info:MAIN:Time 7511, free 89952, MQTT 1, bWifi 1, secondsWithNoPing 1, socks 2/38

Info:MAIN:Time 7512, free 76264, MQTT 1, bWifi 1, secondsWithNoPing 1, socks 3/38

Info:MAIN:Time 7513, free 89952, MQTT 1, bWifi 1, secondsWithNoPing 1, socks 2/38

Info:MAIN:Time 7514, free 89952, MQTT 1, bWifi 1, secondsWithNoPing 1, socks 2/38

Info:MAIN:Time 7515, free 89952, MQTT 1, bWifi 1, secondsWithNoPing 1, socks 2/38

Info:MAIN:Time 7516, free 89952, MQTT 1, bWifi 1, secondsWithNoPing 1, socks 2/38

Info:MAIN:Time 7517, free 89952, MQTT 1, bWifi 1, secondsWithNoPing 1, socks 2/38

Info:MAIN:Time 7518, free 89952, MQTT 1, bWifi 1, secondsWithNoPing 1, socks 2/38

Info:MAIN:Time 7519, free 89952, MQTT 1, bWifi 1, secondsWithNoPing 1, socks 2/38

Info:MAIN:Time 7520, free 89952, MQTT 1, bWifi 1, secondsWithNoPing 1, socks 2/38

Info:GEN:dhcp=0 ip=5.100.13.144 gate=5.100.13.1 mask=255.255.255.0 mac=c8:47:8c:10:60:6b 

Info:MAIN:Time 7521, free 89952, MQTT 1, bWifi 1, secondsWithNoPing 1, socks 2/38

Info:MAIN:Time 7522, free 89952, MQTT 1, bWifi 1, secondsWithNoPing 1, socks 2/38

Info:MAIN:Time 7523, free 89952, MQTT 1, bWifi 1, secondsWithNoPing 1, socks 2/38

Info:MAIN:Time 7524, free 89952, MQTT 1, bWifi 1, secondsWithNoPing 1, socks 2/38

Info:MAIN:Time 7525, free 89952, MQTT 1, bWifi 1, secondsWithNoPing 1, socks 2/38

Info:MAIN:Time 7526, free 89952, MQTT 1, bWifi 1, secondsWithNoPing 1, socks 2/38

Info:MAIN:Time 7527, free 89952, MQTT 1, bWifi 1, secondsWithNoPing 1, socks 2/38

Info:MAIN:Time 7528, free 89952, MQTT 1, bWifi 1, secondsWithNoPing 1, socks 2/38

Info:MAIN:Time 7529, free 89952, MQTT 1, bWifi 1, secondsWithNoPing 1, socks 2/38

Info:MQTT:Publishing IP = 5.100.13.144 

Info:MAIN:Forced channel publish! Publishing val 0 with 0 

Info:MQTT:Publishing 0 = 0 

Info:MAIN:Time 7530, free 89704, MQTT 1, bWifi 1, secondsWithNoPing 1, socks 2/38

Info:MQTT:mqtt_connection_cb: Disconnected, reason: 256

Info:GEN:dhcp=0 ip=5.100.13.144 gate=5.100.13.1 mask=255.255.255.0 mac=c8:47:8c:10:60:6b 

Info:MAIN:Time 7531, free 89952, MQTT 0, bWifi 1, secondsWithNoPing 1, socks 2/38

Info:MAIN:Time 7532, free 89952, MQTT 0, bWifi 1, secondsWithNoPing 1, socks 2/38

Info:MAIN:Time 7533, free 89952, MQTT 0, bWifi 1, secondsWithNoPing 1, socks 2/38

Info:MAIN:Time 7534, free 89952, MQTT 0, bWifi 1, secondsWithNoPing 1, socks 2/38

Info:MAIN:Time 7535, free 89952, MQTT 0, bWifi 1, secondsWithNoPing 1, socks 2/38

Info:MAIN:Time 7536, free 89952, MQTT 0, bWifi 1, secondsWithNoPing 1, socks 2/38

Info:MAIN:Time 7537, free 89952, MQTT 0, bWifi 1, secondsWithNoPing 1, socks 2/38

Info:MAIN:Time 7538, free 89952, MQTT 0, bWifi 1, secondsWithNoPing 1, socks 2/38

Info:MAIN:Time 7539, free 89952, MQTT 0, bWifi 1, secondsWithNoPing 1, socks 2/38

Info:MAIN:Time 7540, free 89952, MQTT 0, bWifi 1, secondsWithNoPing 1, socks 2/38

Info:GEN:dhcp=0 ip=5.100.13.144 gate=5.100.13.1 mask=255.255.255.0 mac=c8:47:8c:10:60:6b 

Info:MQTT:mqtt_userName user
mqtt_pass passwd
mqtt_clientID shkaf
mqtt_host 5.100.13.248:1883

Info:MAIN:Time 7541, free 89744, MQTT 0, bWifi 1, secondsWithNoPing 1, socks 2/38

Info:MQTT:mqtt_connection_cb: Successfully connected

Info:MQTT:mqtt_subscribed to shkaf/+/set

Info:MQTT:mqtt_subscribed to cmnd/shkaf/+

Info:MQTT:MQTT client "shkaf" request cb: err 0

Info:MQTT:MQTT client "shkaf" request cb: err 0

Info:MQTT:Publishing IP = 5.100.13.144 

Info:MAIN:Forced channel publish! Publishing val 0 with 0 

Info:MQTT:Publishing 0 = 0 

Info:MAIN:Time 7542, free 89728, MQTT 1, bWifi 1, secondsWithNoPing 1, socks 2/38

Info:MAIN:Forced channel publish! Publishing val 1 with 0 

Info:MQTT:Publishing 1 = 0 

Info:MAIN:Time 7543, free 89952, MQTT 1, bWifi 1, secondsWithNoPing 1, socks 2/38

Info:MAIN:Time 7544, free 89952, MQTT 1, bWifi 1, secondsWithNoPing 1, socks 2/38Info:GEN:dhcp=0 ip=5.100.13.144 gate=5.100.13.1 mask=255.255.255.0 mac=c8:47:8c:10:60:6b 

Info:MAIN:Time 7511, free 89952, MQTT 1, bWifi 1, secondsWithNoPing 1, socks 2/38

Info:MAIN:Time 7512, free 76264, MQTT 1, bWifi 1, secondsWithNoPing 1, socks 3/38

Info:MAIN:Time 7513, free 89952, MQTT 1, bWifi 1, secondsWithNoPing 1, socks 2/38

Info:MAIN:Time 7514, free 89952, MQTT 1, bWifi 1, secondsWithNoPing 1, socks 2/38

Info:MAIN:Time 7515, free 89952, MQTT 1, bWifi 1, secondsWithNoPing 1, socks 2/38

Info:MAIN:Time 7516, free 89952, MQTT 1, bWifi 1, secondsWithNoPing 1, socks 2/38

Info:MAIN:Time 7517, free 89952, MQTT 1, bWifi 1, secondsWithNoPing 1, socks 2/38

Info:MAIN:Time 7518, free 89952, MQTT 1, bWifi 1, secondsWithNoPing 1, socks 2/38

Info:MAIN:Time 7519, free 89952, MQTT 1, bWifi 1, secondsWithNoPing 1, socks 2/38

Info:MAIN:Time 7520, free 89952, MQTT 1, bWifi 1, secondsWithNoPing 1, socks 2/38

Info:GEN:dhcp=0 ip=5.100.13.144 gate=5.100.13.1 mask=255.255.255.0 mac=c8:47:8c:10:60:6b 

Info:MAIN:Time 7521, free 89952, MQTT 1, bWifi 1, secondsWithNoPing 1, socks 2/38

Info:MAIN:Time 7522, free 89952, MQTT 1, bWifi 1, secondsWithNoPing 1, socks 2/38

Info:MAIN:Time 7523, free 89952, MQTT 1, bWifi 1, secondsWithNoPing 1, socks 2/38

Info:MAIN:Time 7524, free 89952, MQTT 1, bWifi 1, secondsWithNoPing 1, socks 2/38

Info:MAIN:Time 7525, free 89952, MQTT 1, bWifi 1, secondsWithNoPing 1, socks 2/38

Info:MAIN:Time 7526, free 89952, MQTT 1, bWifi 1, secondsWithNoPing 1, socks 2/38

Info:MAIN:Time 7527, free 89952, MQTT 1, bWifi 1, secondsWithNoPing 1, socks 2/38

Info:MAIN:Time 7528, free 89952, MQTT 1, bWifi 1, secondsWithNoPing 1, socks 2/38

Info:MAIN:Time 7529, free 89952, MQTT 1, bWifi 1, secondsWithNoPing 1, socks 2/38

Info:MQTT:Publishing IP = 5.100.13.144 

Info:MAIN:Forced channel publish! Publishing val 0 with 0 

Info:MQTT:Publishing 0 = 0 

Info:MAIN:Time 7530, free 89704, MQTT 1, bWifi 1, secondsWithNoPing 1, socks 2/38

Info:MQTT:mqtt_connection_cb: Disconnected, reason: 256

Info:GEN:dhcp=0 ip=5.100.13.144 gate=5.100.13.1 mask=255.255.255.0 mac=c8:47:8c:10:60:6b 

Info:MAIN:Time 7531, free 89952, MQTT 0, bWifi 1, secondsWithNoPing 1, socks 2/38

Info:MAIN:Time 7532, free 89952, MQTT 0, bWifi 1, secondsWithNoPing 1, socks 2/38

Info:MAIN:Time 7533, free 89952, MQTT 0, bWifi 1, secondsWithNoPing 1, socks 2/38

Info:MAIN:Time 7534, free 89952, MQTT 0, bWifi 1, secondsWithNoPing 1, socks 2/38

Info:MAIN:Time 7535, free 89952, MQTT 0, bWifi 1, secondsWithNoPing 1, socks 2/38

Info:MAIN:Time 7536, free 89952, MQTT 0, bWifi 1, secondsWithNoPing 1, socks 2/38

Info:MAIN:Time 7537, free 89952, MQTT 0, bWifi 1, secondsWithNoPing 1, socks 2/38

Info:MAIN:Time 7538, free 89952, MQTT 0, bWifi 1, secondsWithNoPing 1, socks 2/38

Info:MAIN:Time 7539, free 89952, MQTT 0, bWifi 1, secondsWithNoPing 1, socks 2/38

Info:MAIN:Time 7540, free 89952, MQTT 0, bWifi 1, secondsWithNoPing 1, socks 2/38

Info:GEN:dhcp=0 ip=5.100.13.144 gate=5.100.13.1 mask=255.255.255.0 mac=c8:47:8c:10:60:6b 

Info:MQTT:mqtt_userName user
mqtt_pass passwd
mqtt_clientID shkaf
mqtt_host 5.100.13.248:1883

Info:MAIN:Time 7541, free 89744, MQTT 0, bWifi 1, secondsWithNoPing 1, socks 2/38

Info:MQTT:mqtt_connection_cb: Successfully connected

Info:MQTT:mqtt_subscribed to shkaf/+/set

Info:MQTT:mqtt_subscribed to cmnd/shkaf/+

Info:MQTT:MQTT client "shkaf" request cb: err 0

Info:MQTT:MQTT client "shkaf" request cb: err 0

Info:MQTT:Publishing IP = 5.100.13.144 

Info:MAIN:Forced channel publish! Publishing val 0 with 0 

Info:MQTT:Publishing 0 = 0 

Info:MAIN:Time 7542, free 89728, MQTT 1, bWifi 1, secondsWithNoPing 1, socks 2/38

Info:MAIN:Forced channel publish! Publishing val 1 with 0 

Info:MQTT:Publishing 1 = 0 

Info:MAIN:Time 7543, free 89952, MQTT 1, bWifi 1, secondsWithNoPing 1, socks 2/38

Info:MAIN:Time 7544, free 89952, MQTT 1, bWifi 1, secondsWithNoPing 1, socks 2/38

bk7231N socked

Hello.
Can you get on the addition of Volt, AMPER, WAT reading. I have two sockets with a measurement and I would like to check.
Do you think to add MQTT support for Domoticz?

My work pinout without measurement is:
P8 - LED 0
P10 - BTN 1
P26 - REL 1

T34 compatibility

Hello.

I've been reading about your effort to flash a custom firmware in these devices and I find it amazing.
I have a new Tuya wifi in-wall socket with power meter which has serious wifi stability problems, I opened it and I can see there's a "T34" chip inside. I've been reading the characteristics and it seems to be based on BK7231N (according to this Tuya documentation).

t34 (2)

I wonder if your project might be compatible with this chip.

Thanks.

LED Bulb Pin Mapping

Hello,

I have an Feit OM60/RGBW/CA/AG/3 bulb and Was able to dump firmware and also flash it with this firmware. That being said, is there a way I can get the Pin mapping so I can configure the firmware to control the bulb? If theres info in the original fw I could probably get it if I knew where to look.

BL602 AP-Mode after Flash fails

BL602 Software 1.10.4 is the last version that works.

Newer releases show up an accesspoint but after connection the device seems to hang.
no interaction with web-browser and serial console is possible.
serial console is possible after reboot.

Tested some new releases including 1.11.4.

Tested with device:
BL602 Magic Home LED RGB IR Strip

Docs?

Hello,

I noticed that this project hasn't really got a documentation, so I wanted to ask if Docs are needed (@openshwprojects)?
I would really like to create them, because I want to be part of the project. (I would suggest to use Mkdocs, like tasmota does I think)

Regard,
Luis

Is there a way to disable multi touch for wall touch switch

Like tasmota option13
Currently touch switch have a delay when pressed and only turn on/off light when released.
It's same thing with esp based switches and tasmota before enabling that option 13, which basically tells it to use only single touch input and not to wait for double tap or long tap.

Is there a way to do same thing with bk based switches?

Home assistant auto setup

Hello,

As you know the MQTT built into Home Assistant has pretty strong auto setup abilities. Although Tasmota has gone away from this to their own integration, I have maintained a custom version of Tasmota meant to work with the MQTT integration.

Although I am not a great programmer by any stretch, I understand the Home Assistant MQTT auto setup quite well and could help if someone wanted to try and extend the MQTT in that direction.

I also saw that someone was asking about Domoticz - there is a Home Assistant MQTT plugin for Domoticz that uses the same autosetup protocols (and one for OpenHab too), so working on the auto setup for Home Assistant MQTT could provide an easy path to setting up in all three systems.

CSE7766 driver?

Hi, is there any chance of including the power monitor IC CSE7766 driver?

I have this device:
https://templates.blakadder.com/deta_6920HA.html

I've managed to flash the WB2S within and the touch sensors and relays are working, but I'm not sure how to proceed with adding voltage/current sensor.

It seems supported in Tasmota and ESPHome.

(for anyone interested I needed to desolder the WB2S in order to flash.)

volatile reference

new_pins.c many occurrences of volatile UINT32 * : are you sure that it was not UINT32 * volatile ?

OTA Bricking?

Hi, I flashed .016 successfully using the Python tool. When I tried to OTA upgrade using the web interface (not the app) I used the UG variant - is that correct? Or use the java app and the .rbl?

Also the URL I used was file:///c:/directory/to/bin (I don't have a web server running right now).

This should work, but in any case it seems like I've now bricked the device as the web interface won't come up, nor does the AP come up. When I try to reprogram it using the Python tool it won't find the bus (I'm not sure if you can re-program with it or not).

This is for the 7231N chip.

In any case, I'm sure I did something incorrectly but it might be useful to trap improper actions in code as it was really easy to break it (saying this as a veteran of many tasmota OTA upgrades). I can help try and recreate the conditions if that helps.

Thanks for your great work on this!

BL0937 problem

Hi there.

I have this Tuya socket with power meter. It uses the new "T34" chip, which is based on BK7231N. The power meter chip is a BL0937. I talked about this before: #90.

Following your instructions and reading several posts in elektroda.com, this is what I achieved until now:

  • I flashed your BK7231N firmware and the basic socket functionality is working (ON/OFF and leds). These are the pins I used:

    GPIO Function Channel Comments
    P7 REL_N 1 Main Relay
    P8 WIFI LED_N 0 Blue light, blinking when connecting to wifi, OFF when connected
    P9 BTN 1 Button that toggles relay when pressed
    P23 LED_N 1 Red light, ON when relay is on
  • I tried to start the BL0937 driver executing the custom command startDriver BL0937, but the measures are zero and it interferes with my settings, as it is using GPIOS 7 and 8 by default.

  • With a multimeter, I was able to check which GPIOs the device is using to connect to the BL0937. These are my results:

    Device legend T34 pin T34 GPIO BL0937 pin
    H 20 P20 SEL
    CF 18 P22 CF
    CV 16 P24 CF1
  • So I tried to modify the source code of the driver (drv_bl0937.c), making the following changes:

    ...
    #define ELE_HW_TIME 1
    #define HW_TIMER_ID 0
    
    // Original firmware GPIOS
    //int GPIO_NRG_SEL = 24; // pwm4
    //int GPIO_HLW_CF = 7;
    //int GPIO_NRG_CF1 = 8;
    
    // My device GPIOS
    int GPIO_NRG_SEL = 20;
    int GPIO_HLW_CF = 22;
    int GPIO_NRG_CF1 = 24;
    
    bool g_sel = true;
    ...
  • After that I compiled the App and I got success, generating the file OpenBK7231N_App_1.0.0.rbl.

  • Then I flashed the new compiled firmware via OTA and it all went OK, restarting the device.

  • Everything seems to work OK except now when I issue the custom command startDriver BL0937, the device either freezes (most of the times) or restarts (some times). I think there must be something else apart from the GPIOS definition.

  • This is what I get on the logs before the device freezes:

    Debug:CMD:cmd [startDriver BL0937]
    Debug:CMD:Adding command PowerSet
    Debug:CMD:Adding command VoltageSet
    Debug:CMD:Adding command CurrentSet
    Debug:CMD:Adding command PREF
    Debug:CMD:Adding command VREF
    Debug:CMD:Adding command IREF
    Info:NTP:Started BL0937.
    

I don't know what may be the problem with this driver, but if you can shred some light onto it I can check whatever you want and I can compile the changes and test them.

Thanks in advance.

Set more MQTT messages

Hi, can i set more MQTT info messages from BK7231 ? F.e. wifi strength, ip, mac, gate etc ..
Thank you

Building test HTTP server with N SDK

I'm trying to build the http server (myHTTP2022-2010) project using the N SDK. I'm using VS 2019.
When I open the solution there are several files that are reported as missing.

solution

When I try to build I get an error

Error C1083 Cannot open include file: 'lwip/sockets.h': No such file or directory myHTTP2022 C:\bk7231sdk\apps\OpenBK7231N_App\src\httpserver\rest_interface.c 14

I see lwip/sockets.h is in the c:\bk7231sdk\sdk\include directory so I add the sdk directory to the VC++ include directories in the project properties.

Now I get cannot open souce file arch/cc.h (from arch.h) and lwipopts.h (from sockets.h)
I can't find either of these files in the sdk.

How can I fix this to be able to build the server?

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.