esphome / feature-requests

ESPHome Feature Request Tracker
https://esphome.io/
420 stars 26 forks source link

New MagicHome RGBW controller with BL602 (RISC-V) support #1049

Open exentio opened 3 years ago

exentio commented 3 years ago

Describe the problem you have/What new integration you would like

The classic MagicHome LED controllers just switched from ESP8266 to an SoC called BL602, apparently based on RISC-V. I accidentally got one while ordering LED controllers from AliExpress, expecting to get the classic ESP one. They're probably all gonna switch to this SoC, which is also way better (supports Bluetooth). I'd be happy to help test the porting!

Please describe your use case for this integration and alternatives you've tried:

ESPhome does not support this new SoC yet, neither do Tasmota and others.

Additional context

All the info I was able to find: https://community.openhab.org/t/risc-v-based-bl602-magichome-rgb-led-strip-controller/109704 https://www.reddit.com/r/homeassistant/comments/jwylhx/need_some_help_flashing_tasmota_to_a_new https://forum.creationx.de/forum/index.php?thread/3098-magichome-wlan-controller-v1-2-tasmota-flashen/&postID=35506#post35506 https://www.bouffalolab.com/bl602 https://github.com/bouffalolab/bl_iot_sdk https://github.com/bouffalolab/bl_docs https://github.com/pine64/bl602-docs https://github.com/spacemeowx2/blflash https://github.com/mkroman/bouffalo-cli https://github.com/stschake/bl60x-flash

randybb commented 3 years ago

As @OttoWinter mentioned earlier "Not an ESP, so not for ESPHome. Sorry"

glmnet commented 3 years ago

As @OttoWinter mentioned earlier "Not an ESP, so not for ESPHome. Sorry"

Actually partially correct, the project can very well be extended for others SoC, that would make it way more difficult to maintain though. I'm not in the mood to do much research but if it works for with PlatformIO and Arduino then development is just on our side.

OFF, that SOC seems to have built in flash, that's a big advantage over classic esp8266

randybb commented 3 years ago

Sure, theoretically it could be extended to any Arduino lib compatible devices, but this one is not compatible. Otto denied compatibility for Seeduino Wio Terminal powered by SAMD21 that is fully compatible with Arduino libs and in this case it would not be too hard... Well, at least for SAM MCU, then we would need have support for RTL8720DN that is used for WLAN/BLE. Maybe this could be a good start for Bluetooth mesh, Thread, Zigbee, 802.15.4, ANT and 2.4 GHz proprietary stacks support.

glmnet commented 3 years ago

812

It's not same but is quite similar

Citrullin commented 3 years ago

@exentio Where did you buy it? Do you have a link?

exentio commented 3 years ago

I wasn't the one who made the order so I don't have the link, sorry

gusman80 commented 3 years ago

Hei i started fiddling around with this board and made a simple firmware to test around the PWM outputs. i started out of the info provided right here: https://lupyuen.github.io/articles/book the author's super kind, answers quickly on reddit and provides very good information. I don't think its possible to support this completely different architecture within this project.

Still - for those who are stuck with magichome's $#%firmware - Here is the Layout of the new MagicHome >>

RGBW controller MagicHome ZJ-BWCE-IR-RGBW V1.2 PIN gpio Asset PWM-Channel 4 gpio3 Red pwm3 5 GPIO4 Green pwm4 9 ANt RF
16 gpio7 RX 17 gpio8 Boot Pin 21 gpio12 IR Pin 27 gpio16 TX 29 gpio20 WHITE pwm0 30 gpio21 BLUE pwm1

have great fun

glmnet commented 3 years ago

Well I believe we should support the esp32 c3 which is risc v

unfortunately I don’t own one and can’t get them in my country.

I accept shipments via DHL or FedEX 🙃

glmnet commented 3 years ago

I believe that will mean supporting risc v in general. Not sure yet I’m slow to grasp new stuff

Citrullin commented 3 years ago

Well I believe we should support the esp32 c3 which is risc v

unfortunately I don’t own one and can’t get them in my country.

I accept shipments via DHL or FedEX upside_down_face

I contacted a couple of seller on Aliexpress. This seller told me that their product uses the BL602. (e: It was a lie, it doesn't uses the BL602) Ohh shit, I just looked it up: 40 Euro to send it to Argentina. That is crazy.

glmnet commented 3 years ago

Yeah it is

gusman80 commented 3 years ago

image i ordered many different magichome layouts ... you can recognize the devices with a 50% bl602 rate by these weird octagon cornered casings i ordered mine on ebay 283947655801

Citrullin commented 3 years ago

image i ordered many different magichome layouts ... you can recognize the devices with a 50% bl602 rate by these weird octagon cornered casings i ordered mine on ebay 283947655801

I can confirm this. My success rate 100% with it.

lanrat commented 3 years ago

I ordered 4 with the diagonal corners from 3 different sellers, all contained the BL602.

RoganDawes commented 3 years ago

I see https://github.com/pine64/ArduinoCore-bouffalo, but apparently no support yet in platformio, which is a bit of an obstacle. I note the aim to make it as compatible as possible with the ESP*, which should simplify things a bit, perhaps. I don't really imagine that use of RiscV vs Xtensa cores should make much of a difference, that's simply down to the compiler, surely?

normanr commented 3 years ago

fyi: I filed a bug to add support in PlatformIO: https://github.com/platformio/platformio-core/issues/4046

maxgerhardt commented 3 years ago

If anyone can help test my PlatformIO integration (https://github.com/platformio/platformio-core/issues/4046#issuecomment-918220660), please let me know your results. You should be able to compile + upload to a BL602 based board with the Pine64 Bouffalo Arduino core, such as the DT-BL10 or Pine64 PineCone board.

bdraco commented 3 years ago

Well I believe we should support the esp32 c3 which is risc v

unfortunately I don’t own one and can’t get them in my country.

I accept shipments via DHL or FedEX 🙃

@glmnet

If you are still looking for some I have a few extra from testing other projects left over. Happy to ship.

Email nick at koston dot org

geoffrothman commented 1 year ago

For anyone stumbling on this via google search later on, here's a link to opensource firmware that can add it to esphome: https://community.home-assistant.io/t/open-source-firmware-for-new-sonoff-products-or-any-other-bl602-based-iot-device-with-youtube-guide/536935