Code Monkey home page Code Monkey logo

Comments (7)

helgek avatar helgek commented on June 6, 2024 1

Congrats! :D When you managed the reading part you will certainly manage the writing part as well. Another way you could probably achieve this without soldering and without investing into the PCBite equipment would be to e.g. use the pins you used or to e.g. use acupuncture needles. One could tie some thick foam onto the esp32 chip and push the needles through the foam. The foam would hold them in place. Just another idea that just came to my mind. Nevertheless I'm glad I invested into the PCBite since I've used it to flash six lamps so far. The other lamp's esp32s were more difficult to access, so the PCBite was my rescue.

from esphome-yeelight-ceiling-light.

helgek avatar helgek commented on June 6, 2024

There is support already for this lamp. You can also see this thread #72 where I added a photo of how I flashed it.

from esphome-yeelight-ceiling-light.

mrumpf avatar mrumpf commented on June 6, 2024

Thanks for the hint!

However, as I had no sophisticated equipment, I had to improvise ...

I was able to solder 3 wires to the board to some larger pads:

  • RX - green
  • TX - blue
  • GPIO0 - black

And use alligator clips with simple pins to connect GND and 3.3V from my USB to serial adapter to the ESP32.

IMG_5963

So far I was able to read the 4MB original firmware from the lamp. This takes several minutes and you need a steady hand :) When you move the pins even slightly, the transfer of the original firmware will fail.

I'm a little bit hesitant, flashing ESPHome now because I do not see a file that matches the name of the floor lamp in this project.
My floor lamp has this touch panel with 3 functions:

  • ON/OFF Button
  • Slider (Dimmer)
  • Program Change Button (white, colors...)

Where do I find the ESPHome YAML file that supports those features?

from esphome-yeelight-ceiling-light.

mrumpf avatar mrumpf commented on June 6, 2024

Related: #61
IMG_5946

IMG_5964

from esphome-yeelight-ceiling-light.

helgek avatar helgek commented on June 6, 2024

Ah sorry, I just realized you're not trying to flash a meteorite pendant light but this lamp also identifies as yeelink.light.lamp10. The pendant light doesn't have manual controls on the lamp itself. The bedside lamp has such controls included: https://github.com/syssi/esphome-yeelight-ceiling-light/blob/main/yeelight_light_lamp9.yaml

from esphome-yeelight-ceiling-light.

mrumpf avatar mrumpf commented on June 6, 2024

I also have the bedside lamp, but it identifies as yeelink.light.bslamp2. I already flashed that one with the guide from here:
https://devices.esphome.io/devices/Xiaomi-Mijia-Bedside-Lamp-2
This has the same control panel as the Staria floor lamp yeelink.light.lamp9.

I tried to flash the ESPHome config from the bslamp2 above, but I could not turn on the light. I flashed back the original firmware and the lamp is working again. So at least I know that I can go back to the original firmware if something is not working.

from esphome-yeelight-ceiling-light.

mrumpf avatar mrumpf commented on June 6, 2024

OK, I managed to solder the necessary wires directly to the ESP32 since the reverse engineering is taking much more time than expected. I first flashed the firmware from esphome-xiaomi_bslamp2, but I could not turn on the light. I suspected that the I2C bus was connected to different GPIO pins or that the I2C address of the front panel was different. So I flashed some I2C scanner tool to the ESP32 using the same GPIO pins of the esphome-xiaomi_bslamp2 firmware:

  • GPIO21 SDA
  • GPIO19 SCL

That revealed that there is an I2C device discovered at address 0x50:

     0  1  2  3  4  5  6  7  8  9  a  b  c  d  e  f
00:          -- -- -- -- -- -- -- -- -- -- -- -- --
10: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
20: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
30: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
40: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
50: 50 -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
60: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
70: -- -- -- -- -- -- -- --

Then I modified the example.yaml by overwriting the I2C address of the front-panel from the core.yaml file:

xiaomi_bslamp2:
  front_panel:
    address: 0x50

After flashing it to the ESP32 of the lamp, I received messages from the front-panel like this:

[E][xiaomi_bslamp2:149]: Front panel I2C event error:
[E][xiaomi_bslamp2:150]:   Error: prefix is not 04:04:01:00
[E][xiaomi_bslamp2:151]:   Event: [0a:01:03:00:00:00:02]
[E][xiaomi_bslamp2:152]:   Parsed part: n/a
[E][xiaomi_bslamp2:153]:   Parsed event type: n/a
[W][xiaomi_bslamp2:255]: Skipping unsupported message from front panel

That is a good sign because it means that the I2C address 0x50 is the address of the front-panel. But the events from the front-panel seem to be different and the firmware cannot interpret the content (yet).
Receiving messages with the button press also means that the same GPIO16 is used for the trigger to read data from the front-panel.

from esphome-yeelight-ceiling-light.

Related Issues (20)

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.