OpenBK7231T project - main application

Overview

Building

Clone the SDK repo to a folder, e.g. bk7231sdk/

Clone the app repo into bk7231sdk/apps/ - e.g. bk7231sdk\apps\openbk7231app

On Windows, start a cygwin prompt.

go to the SDK folder.

build using: ./build_app.sh apps/<folder> <appname> <appversion>

e.g. ./build_app.sh apps/openbk7231app openbk7231app 1.0.0

flashing

UART

clone the repo https://github.com/OpenBekenIOT/hid_download_py

connect the PC to serial 2 on the bk7231

flash using: python uartprogram <sdk folder>\apps\<folder>\output\1.0.0\<appname>_UA_<appversion>.bin -d <port> -w re-power the device until the flashing program works, repeat if required.

e.g. python uartprogram C:\DataNoBackup\tuya\tuya-iotos-embeded-sdk-wifi-ble-bk7231t\apps\my_alpha_demo\output\1.0.0\my_alpha_demo_UA_1.0.0.bin -d com4 -w

SPI

see https://github.com/OpenBekenIOT/hid_download_py/blob/master/SPIFlash.md

OTA

Once the firmware has been flashed for the first time, it can be flashed over wifi (note: change hardcoded firmware URL in new_http.c)

Setup a simple webserver to serve <sdk folder>\apps\<folder>\output\1.0.0\<appname>_<appversion>.rbl

Visit /ota - this will start the flashing process.

First run

At first boot, if the new formware does not find your wifi SSID and password in the Tuya flash, it will start as an access point.

The access point will come up on 192.168.4.1, however some machines may not get an ip from it - you may need to configure your connecting for a staitc IP on that network, e.g. 192.168.4.10

Once you are connected and have an IP, go to http://192.168.4.1/index , select config then wifi, and setup your wifi.

After a reboot, the device should connect to your lan.

Issues
  • feat: automated GitHub releases

    feat: automated GitHub releases

    Use GitHub actions to automatically build and release new versions, adding binaries to release outputs (e.g. https://github.com/talltechdude/OpenBK7231T_App/releases) and also tests builds on PRs.

    Uses Conventional Commits and cycjimmy/[email protected] to automatically increment release versions and generate change logs.

    Also makes use of a simplified Makefile to build assets pulling in the SDK via a git submodule to ease development of app only inside single repo (while remaining compatible with exisiting SDK)

    released 
    opened by talltechdude 16
  • add support for moes WIFI Smart Dimmer Module 105 (TuyaMCU dimmer, WB2S based)

    add support for moes WIFI Smart Dimmer Module 105 (TuyaMCU dimmer, WB2S based)

    This PR adds suppport for moes WIFI Smart Dimmer Module 105 (WB2S).

    • add a new channel type "dimmer", using same slider control as PWM
    • maps TuyaMCU's dimming range to a normalized interval 0..100 (for web UI and MQTT)
    • propagate new channel values to TuyaMCU (via TuyaMCU_OnChannelChanged)
    • store TuyaMCU data point type for each mapped channel

    moes WIFI Smart Dimmer Module 105 is controlled by two data points: 1: DP_TYPE_BOOL: on/off 2: DP_TYPE_VALUE: dimming level (0..1000)

    autoexec.bat (working for me):

    startDriver TuyaMCU
    setChannelType 1 toggle
    setChannelType 2 dimmer
    tuyaMcu_setDimmerRange 0 1000
    linkTuyaMCUOutputToChannel 1 1 1
    linkTuyaMCUOutputToChannel 2 2 2
    
    released 
    opened by heikobihr 7
  • OTA changes all devices name to obk8C000000

    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?

    opened by boozeman 6
  • Publish UG artifacts in releases for stock OTA

    Publish UG artifacts in releases for stock OTA

    Changes the GH workflow to publish UG files (Tuya OTA format) as well. This is useful for users who want a quick n' easy download for a particular OpenBK7231 image to remotely OTA with the stock firmware.

    released 
    opened by khalednassar 5
  • Btsimonh5 - webserver updates

    Btsimonh5 - webserver updates

    The main thing this does is base everything on a http_request_t structure. It also introduces a 'poststr(p_request, str)' for adding data to the http response, which automatically checks the available size, and really sends if it has to.

    This should make it easier to create (for example) a rest style API, essential for an external web interface. It should also avoid breaking the server by expanding the number of pin entries, etc.

    Please check it over carefully. I have built & tested in windows, but not on a real device (as I have no serial connection temporarily!).

    released 
    opened by btsimonh 5
  • feat: update sdks from Makefile

    feat: update sdks from Makefile

    I've added a Makefile command to automatically update the SDK submodules, effectively just a git pull on each and commit the changes.

    make update-submodules
    

    Also fixed the fail-fast logic as it was cancelling other builds if any platform failed.

    released 
    opened by talltechdude 4
  • Cmnds

    Cmnds

    commands: all strings now const (no more modification). split CMD_Exec into two - for easier use in MQTT. move some commands into cmnds/taslike.c Fix bug in CMD_Find.

    commands added: POWER n (channel 0) POWERm n (channel m) COLOR #RRGGBB[cw][ww] - PWM control assuming colour.

    (these were already in MQTT, but now MQTT just calls CMD_Execute instead!!!)

    released 
    opened by btsimonh 3
  • feat: auto update SDK submodules

    feat: auto update SDK submodules

    Allows the Github Action to automatically update SDK submodules when upstream changes are detected and push changes back to this App repo in order to automatically track any changes to the SDKs master branches.

    As requested by @openshwprojects in https://github.com/openshwprojects/OpenBK7231T_App/pull/45#issuecomment-1055930843

    released 
    opened by talltechdude 3
  • Littlefs - more

    Littlefs - more

    Looking pretty good now....

    lfs file endpoints - POST /api/lfs/folder/filename to write a file.
    GET /api/lfs/folder/filename to read/serve a file.

    add reboot POST /api/reboot (3 second delay) add OTA POST /api/ota (not used this yet, but below work well) add fs backup GET /api/fsblock (reads as 512k file) add fs flash POST /api/fsblock (writes the data your provide - should be a 512k little FS image)

    Note: LittleFS blocks are at OTA + 0x1000 (so we don't write the header). It's overwritten by OTA, hence the ability to backup and restore it.....

    I still have random crashes/disconnects. serial logs have some clues, so will try to 'catch it at it' and look into the logs. Most likely we still have some thread conflict issues.

    released 
    opened by btsimonh 3
  • bugfix: correct pwm duty cycle

    bugfix: correct pwm duty cycle

    PWM output was not getting past 10% in Channel_OnChanged (confirmed on Oscilloscope). Copied similar math operation from PIN_SetPinRoleForPinIndex function

    released 
    opened by talltechdude 3
  • Added LSC Smart Connect Plug

    Added LSC Smart Connect Plug

    I added the LSC Smart Connect Plug (https://www.action.com/de-at/p/lsc-smart-connect-intelligenter-stecker/) as Quick Template.

    Here a Screenshot from the working config: image I think I did everything right :)

    released 
    opened by LuisThe0ne 2
  • Home assistant auto setup

    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.

    opened by brandondb1 0
  • OTA Bricking?

    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!

    opened by brandondb1 1
  • Flashing on WB3S not working!

    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.

    opened by LuisThe0ne 4
  • bk7231N socked

    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

    opened by JanKiel2000 5
  • Tasmota 'feature' compatibility

    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'....

    opened by btsimonh 5
Releases(1.0.20)
The main repository for the Darkflame Universe Server Emulator project.

Darkflame Universe Introduction Darkflame Universe (DLU) is a server emulator for LEGO® Universe. Development started in 2013 and has gone through mul

null 386 May 7, 2022
Example-application - Example out-of-tree application that is also a module

Zephyr Example Application This repository contains a Zephyr example application. The main purpose of this repository is to serve as a reference on ho

Zephyr Project 58 Apr 29, 2022
The Vulkan Profiles Tools are a collection of tools delivered with the Vulkan SDK for Vulkan application developers to leverage Vulkan Profiles while developing a Vulkan application

Copyright © 2021-2022 LunarG, Inc. Vulkan Profiles Tools (BETA) The Vulkan Profiles Tools are a collection of tools delivered with the Vulkan SDK for

The Khronos Group 49 May 2, 2022
EarlyBird process hollowing technique (BOF) - Spawns a process in a suspended state, inject shellcode, hijack main thread with APC, and execute shellcode

HOLLOW - Cobalt Strike BOF Authors: Bobby Cooke (@0xBoku) Justin Hamilton (@JTHam0) Octavio Paguaga (@OakTree__) Matt Kingstone (@n00bRage) Beacon Obj

Bobby Cooke 185 Apr 11, 2022
An operating system. Its main goal? Readable code, developer experience and documentation.

OS Dependencies Required for development. sudo apt install build-essential nasm grub-pc-bin grub-common xorriso Required for building cross-compiler.

Stijn Rogiest 1 Nov 21, 2021
A commented version of my libft, with details about how my algorithms work and simple main functions to compile them.

LIBFT COMMENTED VERSION : ?? PART I : ?? FT_STRCHR : ?? PART II : ?? FT_SUBSTR : /* * DEFINITION : * CREATES A SUBSTRING FROM A STRING WITH PREDETER

Abdessamad Laamimi 1 Nov 11, 2021
A conda-smithy repository for qt-main.

About qt-main Home: http://qt.io Package license: LGPL-3.0-only Feedstock license: BSD-3-Clause Summary: Qt is a cross-platform application and UI fra

conda-forge 2 Dec 17, 2021
Half-Life : Extended main branch for developing purposes

Half Life : Extended SDK Source Code of Half Life : Extended as a open source modbase for everyone publicly, make your own mod with alot of features e

Bacontsu 12 May 10, 2022
Mitsuba renderer main repository

Mitsuba — Physically Based Renderer http://mitsuba-renderer.org/ About Mitsuba is a research-oriented rendering system in the style of PBRT, from whic

Mitsuba Physically Based Renderer 855 May 14, 2022
PRINT++ is a simple, open source print library for C++, the main usage of PRINT++ is printing out "log" messages

note that for now, print++ is using std::cout. In future it will be using own print function. Windows version can be unstable That library is in alpha

Ksawery 3 Jan 23, 2022
Flutter TODO application for cs50 final project with hive database.

TODO application TODO apllication for CS50 final project with flutter framework. Video Demo: https://youtu.be/91qB2TgGXTc Description: This is my Fina

Seyyed Mohammad Hossein Nabavi 2 Dec 16, 2021
An application that can generate traduction pokeemerald dizzy egg project files. Credits to Pokecreator and myself.

INSTRUCTIONS First of all, you have to launch "PokeemeraldTraductor.exe", chose a language then, you just have to wait until the traduction finish. A

null 4 Apr 16, 2022
An application that can generate traduction pokeemerald dizzy egg project files. Credits to Pokecreator and myself.

INSTRUCTIONS First of all, you have to launch "PokeemeraldTraductor.exe", chose a language then, you just have to wait until the traduction finish. A

null 4 Apr 16, 2022
This is a template project showing how to implement an application protocol on top of the MetaProtocol.

Manage any protocols in Istio service meshes with MetaProtocol and Aeraki! meta-protocol-awesomerpc This is a template project showing how to implemen

Aeraki 3 Jan 10, 2022
This is a template project showing how to implement an application protocol on top of the MetaProtocol.

Manage any protocols in Istio service meshes with MetaProtocol and Aeraki! meta-protocol-awesomerpc This is a template project showing how to implemen

Aeraki Mesh 3 Jan 10, 2022
dogefetch, a project made in C for doges, very project, much wow

dogefetch dogefetch, a project made in C for doges, very project, much wow. before installing this project uses nerd fonts, please install it to see t

null 19 Jan 10, 2022
this project is a function in c to take the next line of a file or a file descriptor. this is a project of 42 school.

Get Next Line of 42. Make with ❤︎ for Luiz Cezario ?? Index What's this Repo? List of Archives Technologies How to Run Find a Bug? Or somenthing need

Luiz lima cezario 9 Apr 20, 2022
The Project name is "ATM - Automated Teller Machine" and It is for beginners level Project.

ATM - Automated Teller Machine The Project name is "ATM - Automated Teller Machine" and It is for beginners level Project. What is ATM? An automated t

Sorav Kumar Sharma 1 Nov 7, 2021