benzino77 / tasmocompiler

Web GUI for custom Tasmota compilation
MIT License
511 stars 148 forks source link

Enabling MI32 Homekit #337

Open steini72 opened 1 year ago

steini72 commented 1 year ago

Can you please include MI32 Homkit ?

benzino77 commented 1 year ago

As I understand correctly Tasmota driver, there has to be USE_BLE_ESP32 and USE_MI_ESP32 defined. Addtionally there has to be USE_MI_HOMEKIT and one of those CONFIG_IDF_TARGET_ESP32 or CONFIG_IDF_TARGET_ESP32C3 or CONFIG_IDF_TARGET_ESP32S3 defined (source)

First two are enabled in TasmoCompiler by selecting "Bluetooth" feature as described here

The last one USE_MI_HOMEKIT can be added in "Custom paramters" step by:

#ifdef USE_MI_HOMEKIT
#undef USE_MI_HOMEKIT
#endif
#define USE_MI_HOMEKIT

Those *IDF* defines should be included when you choose appropriate board (but do not quote me on that). Give it a try. If it doesn't work for you, ask Tasmota Dev team (preferably on Tasmota discord channel) to find out what needs to be #define to get what you need.

steini72 commented 1 year ago

I have

ifdef USE_MI32_HOMEKIT

undef USE_MI32_HOMEKIT

endif

define USE_MI32_HOMEKIT

written. thank you

benzino77 commented 1 year ago

Does it work for you?

steini72 commented 1 year ago

Compile yes homekit does not work

benzino77 commented 1 year ago

Have you read this part of documentation link? Select "Bluetooth" from features list and add those line in "Custom parametrs" field:

#ifdef USE_MI_HOMEKIT
   #undef USE_MI_HOMEKIT
#endif
#define USE_MI_HOMEKIT  1

#ifdef USE_MI_EXT_GUI
   #undef USE_MI_EXT_GUI
#endif
#define USE_MI_EXT_GUI
steini72 commented 1 year ago

Compile yes homekit does not work No MI GUI

steini72 commented 1 year ago

Unselect "Bluetooth" from features list and add those line in "Custom parametrs" field:

ifdef USE_MI_HOMEKIT

undef USE_MI_HOMEKIT

endif

define USE_MI_HOMEKIT 1

ifdef USE_MI_EXT_GUI

undef USE_MI_EXT_GUI

endif

define USE_MI_EXT_GUI

ifdef USE_MI_ESP32

undef USE_MI_ESP32

endif

define USE_MI_ESP32

/root/.platformio/packages/toolchain-xtensa-esp32/bin/../lib/gcc/xtensa-esp32-elf/8.4.0/../../../../xtensa-esp32-elf/bin/ld: /tmp/ccTwC5sJ.ltrans10.ltrans.o:(.literal+0x5ac): undefined reference to mi_homekit_main' /root/.platformio/packages/toolchain-xtensa-esp32/bin/../lib/gcc/xtensa-esp32-elf/8.4.0/../../../../xtensa-esp32-elf/bin/ld: /tmp/ccTwC5sJ.ltrans10.ltrans.o:(.literal+0x5b0): undefined reference tomi_homekit_stop' /root/.platformio/packages/toolchain-xtensa-esp32/bin/../lib/gcc/xtensa-esp32-elf/8.4.0/../../../../xtensa-esp32-elf/bin/ld: /tmp/ccTwC5sJ.ltrans10.ltrans.o: in function `_Z13RulesMqttDatav$part$455':

:(.text+0x4574): undefined reference to `mi_homekit_main' /root/.platformio/packages/toolchain-xtensa-esp32/bin/../lib/gcc/xtensa-esp32-elf/8.4.0/../../../../xtensa-esp32-elf/bin/ld: /tmp/ccTwC5sJ.ltrans10.ltrans.o: in function `Xsns62(unsigned int)': :(.text+0x4934): undefined reference to `mi_homekit_update_value' /root/.platformio/packages/toolchain-xtensa-esp32/bin/../lib/gcc/xtensa-esp32-elf/8.4.0/../../../../xtensa-esp32-elf/bin/ld: :(.text+0x4986): undefined reference to `mi_homekit_update_value' /root/.platformio/packages/toolchain-xtensa-esp32/bin/../lib/gcc/xtensa-esp32-elf/8.4.0/../../../../xtensa-esp32-elf/bin/ld: :(.text+0x49e5): undefined reference to `mi_homekit_stop' /root/.platformio/packages/toolchain-xtensa-esp32/bin/../lib/gcc/xtensa-esp32-elf/8.4.0/../../../../xtensa-esp32-elf/bin/ld: /tmp/ccTwC5sJ.ltrans11.ltrans.o:(.literal+0x494): undefined reference to `mi_homekit_update_value' /root/.platformio/packages/toolchain-xtensa-esp32/bin/../lib/gcc/xtensa-esp32-elf/8.4.0/../../../../xtensa-esp32-elf/bin/ld: /tmp/ccTwC5sJ.ltrans11.ltrans.o: in function `MI32AdvCallbacks::onResult(NimBLEAdvertisedDevice*)': :(.text+0x479f): undefined reference to `mi_homekit_update_value' /root/.platformio/packages/toolchain-xtensa-esp32/bin/../lib/gcc/xtensa-esp32-elf/8.4.0/../../../../xtensa-esp32-elf/bin/ld: :(.text+0x4808): undefined reference to `mi_homekit_update_value' /root/.platformio/packages/toolchain-xtensa-esp32/bin/../lib/gcc/xtensa-esp32-elf/8.4.0/../../../../xtensa-esp32-elf/bin/ld: :(.text+0x4877): undefined reference to `mi_homekit_update_value' /root/.platformio/packages/toolchain-xtensa-esp32/bin/../lib/gcc/xtensa-esp32-elf/8.4.0/../../../../xtensa-esp32-elf/bin/ld: :(.text+0x48de): undefined reference to `mi_homekit_update_value' /root/.platformio/packages/toolchain-xtensa-esp32/bin/../lib/gcc/xtensa-esp32-elf/8.4.0/../../../../xtensa-esp32-elf/bin/ld: /tmp/ccTwC5sJ.ltrans11.ltrans.o::(.text+0x49de): more undefined references to `mi_homekit_update_value' follow /root/.platformio/packages/toolchain-xtensa-esp32/bin/../lib/gcc/xtensa-esp32-elf/8.4.0/../../../../xtensa-esp32-elf/bin/ld: /root/.platformio/packages/framework-arduinoespressif32/tools/sdk/esp32/lib/libsdmmc.a(sdmmc_mmc.c.obj): access beyond end of merged section (33554768) /root/.platformio/packages/toolchain-xtensa-esp32/bin/../lib/gcc/xtensa-esp32-elf/8.4.0/../../../../xtensa-esp32-elf/bin/ld: /root/.platformio/packages/framework-arduinoespressif32/tools/sdk/esp32/lib/libsdmmc.a(sdmmc_mmc.c.obj): access beyond end of merged section (136132) collect2: error: ld returned 1 exit status *** [.pio/build/tasmota32/firmware.elf] Error 1 ========================= [FAILED] Took 788.71 seconds ========================= Environment Status Duration ------------- -------- ------------ tasmota32 FAILED 00:13:08.714 ==================== 1 failed, 0 succeeded in 00:13:08.714 ==================== Finished. Exit code: 1.
benzino77 commented 1 year ago

Unselect "Bluetooth" from features list and add those line in "Custom parametrs" field:

The "Bluetooth" feature needs to be SELECTED/CHECKED.

If it does not work for you please contact Tasmota Dev Team to assist you with your problem.

Jason2866 commented 1 year ago

This is a verified working env for MI Homekit

[env:tasmota32-mi32-homebridge]
extends                 = env:tasmota32_base
board_build.f_cpu       = 240000000L
build_flags             = ${env:tasmota32_base.build_flags}
                          -DFIRMWARE_BLUETOOTH
                          -DUSE_MI_EXT_GUI
                          -DUSE_MI_HOMEKIT=1    ; 1 to enable; 0 to disable
                          -DUSE_BERRY_ULP
lib_extra_dirs          = lib/libesp32, lib/libesp32_div, lib/lib_basic, lib/lib_i2c, lib/lib_div, lib/lib_ssl
lib_ignore              = ESP8266Audio
                          ESP8266SAM
                          TTGO TWatch Library
                          Micro-RTSP
                          epdiy
Jason2866 commented 1 year ago

Somehow related. Homekit support is now removed in Tasmota. Release v13.2 will be the last which does support Homekit. Homekit is not compatible to IDF5.1 which is the underlying SDK for Arduino 3.0.0. Arduino 3.0.0 is needed for supporting the newer espressif MCUS. Matter is now the way ;-)