-
-
Notifications
You must be signed in to change notification settings - Fork 22
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add yeelink.light.fancl5 support #42
Comments
You could open the device and provide some photos. If you own a multimeter I could provide some instructions how to collect all required infos. |
thank you, I have multimeter, I will give you some postion of gpio, such as gpio0, rx, tx ... |
Some high-res photos of the mainboard especially the WiFi daughter board are important. In best case the pin header between the mainboard and the daughter board is labeled. Are you able to control different speed levels of the ceiling fan using the app? |
using Mijia app, I can control fan speed. |
How many levels? |
3 level speed, it use uart communicate between esp32 and bp8601 |
You could use a logic analyzer (something like this https://de.aliexpress.com/item/1005002511491492.html or https://de.aliexpress.com/item/1005003812410259.html) plus a open-source software called sigrok/pulseview to capture the serial traffic between the ESP and the driver board of the fan. As soon as we know the messages here we can try to replicate the communication. The ceiling lamp is working already? What's working and what's not if you flash your yaml? Did you make a backup of the stock firmware? |
no, I have not flash esphome, I just test UART using a usb-ttl tools, and get
when I set gpio0 = low level, it could enter into flash mode. I can not get gpio for light., the gpio of my yaml is copy from your's, do not test. Do you any decompiled circuit diagram of yeelight ceiling? |
The If you are able to enter the flash mode please make a backup of the firmware. Please follow this guide: I don't have any circuit diagrams. How to identify the PWM GPIOs:
Follow the same steps to identify the cold-white PWM GPIO and the Night Light PWM GPIO. It's possibe there is a feature called "power supply standby" ( Please try to identify these GPIOs so you are able to control the ceiling light. The next step will be the reverse engineering of the fan. I'm afraid a logic analyzer is required here. I could provide some guidance how to use sigrok to decode the serial traffic between the ESP and the driver board of the fan. |
Another wish/suggestion:
|
you are genius!
when use remote controller and tap any key, the buzzer beep a time.
I will provide the label of IC, wait some time |
test result is :
so, the light gpio is same as ps: |
Could you provide a photo of your remote control? I assume it's the standard BLE remote talking to the ESP. It's known how to receive commands from these kind of remotes but we shouldn't try to support the remote control at the first iteration. I would be happy if we focus on the ceiling light and fan feature. |
Did you backup the stock firmware? |
yes, I have |
The remote control is the standard bluetooth remote control of yeelight fans. I assume it's the |
It looks like you managed to flash the ESP32. If you don't want to buy a logic analyzer I could provide some instruction how to piggy back another ESP (running esphome to dump some traffic) to the serial line between the ESP and the fan driver board. The idea is to sniff the traffic between these two components to get a better understanding how to replicate the communication. |
that is a good idea! I have a nodemcu esp32 , I will to flash stock firmware into it , and check what happed |
the buzzer beep is for fan mcu BP6601, check here https://bbs.elecfans.com/jishu_1868688_1_1.html |
nop, I want to use esphome to execute animation. I use ble tracker to get remote controller adversie data, like
so, just use esphome to get adversie data and using |
In the past the single core ESP32 of the yeelight devices did crash if you try to use the BLE tracker at your configuration yaml. Some remote controls are encrypted and the https://github.com/syssi/esphome-yeelight-ceiling-light/blob/main/yeerc_ylyk01yl.yaml This implementation can be easily extended to support the yeerc_fancl remote control. Please keep in mind: A dual core ESP32 is required to avoid the boot loop. I've replaced the single core ESP32 of some of my lights to be able to use bluetooth without trouble. |
I know this issue, but it could be fixed by add delay
I use framework is |
Wow. Good job! I didn't know about this solution.
I prefer ESP-IDF over the Arduino framework. I flash my esphome nodes using |
Could you |
maybe, we could use decompile engineering to check how control fan |
I've no experience with reverse engineering of ELF executables. This is the way I would choose:
Some more ideas:
https://github.com/syssi/esphome-jbd-bms/blob/main/tests/esp8266-dummy-receiver.yaml to sniff the traffic of one direction. Try to identify the baudrate. Capture the traffic/commands from the ESP. Swap the RX/TX lines and capture the responses from the fan driver board (hopefully the board responds). If this doesn't work I would attach a 24V power source too to make the fan driver board happy. |
I try to identify, but failed! the board have a layer of insulating glue.
bewteen rx, tx of |
I have check your external_components, but I have no idea how to get it work. I use
to print adv data. I confirm there is no and then, use x[14] to get key code, and use if condition select
and now, I have a question is |
comfirm
|
I check your code carefully, and check esphome offical api document, and notice that
It will clear read buffer when period > 50 ms |
Yes. The RX buffer is cleared of the is a period of 50ms silence on the serial line. If the value is too low some received bytes can get dropped. I don't care much about the feedback of the BP6601 right now. This shouldn't cause crashes. If you want to debug the crashes / BLE commands you could flash the configuration yaml (with another ESPHome node name) to a second ESP32. |
yes, drop but do not cause crash.
I see, I will test. |
Just pick the config yaml f.e. Change to node name:
Flash the yaml to another ESP32: |
Do you remember the |
how find this gpio |
|
If you are able to control the stock firmware using a second ESP32 you could avoid to flash the stock firmware to your lamp again. But I assume the remote control cannot be paired with the second ESP32 easily. |
There is a brute-force and a bit risky brute-force solution if you don't want to flash the stock firmware again:
A bet GPIO3 is the one we are looking for. |
I use
for every gpio not used before. turn on or off, no lucky happed!
the low level have
turn on/off all of these, not find what change. except gpio 34 - 39 , because it is not for output. |
no, paired easy |
need turn on ceiling or night light? |
gpio3 is for uart rx0, so are you sure? I measure uart voltage, the rx is |
I would turn on/off the ceiling light but it doesn't matter. Both lamps cannot work if the power supply is turned off. |
You did discover the enable pin of the fan driver. My hope was this is a shared pin and is used to enable/disable the fan and lamp power supply. It's possible we are on the wrong track here. |
The logic level of the GPIO must change if you toggle the light. If the level doesn't change it's not the GPIO we are looking for. If there is no |
test all possible gpio, have not lucky, maybe It does not support |
pin3 is for INPUT, and it always have high level. so it maybe do not control by software |
In case of a serial connection |
Could you explain how to pair a remote to the ESP32? I would like to give it a try. |
because this remote controller communication without encrytion, so what it submit data could be recieved by any BLE device. so, there is no pair produce, they communiction just use broadcast. |
And if you own two ceiling lamps you are in trouble? How do I teach the ESP32 (stock firmware) the MAC address of the remote control? |
no trouble is here. because you need write MAC address of remote controller
press |
I would try to compare the PWM signal and voltages between the stock firmware and the new one. If you are able to make the PWM visible we can get a better understanding what's the difference between both implementations. |
I have decompile circuit diagram. after close ceiling light and night light, measure voltage
but
because so the voltage should be all chip datasheet is here |
@avion23 Any ideas how to solve this issue? I am out of ideas. |
I'm not sure what the problem is and I don't fully understand what the circuit does :)
|
@avion23 thank you |
RT,
thank you
The text was updated successfully, but these errors were encountered: