mmakaay / esphome-xiaomi_bslamp2

ESPHome integration for the Xiaomi Mijia Bedside Lamp v2.
Other
219 stars 51 forks source link

Unable to flash #37

Closed cracrama closed 3 years ago

cracrama commented 3 years ago

Hello I'm having problem with flashing bedside lamp - I have copied config file - (i don't need to change anything) I have pasted it to esphome in HA. Later I managed to compile firmware (after error correction) - I have downloaded firmware and esphome-flasher - I connected adapter and im getting "Unexpected error: ESP Chip Auto-Detection failed: Failed to connect to Espressif device: Timed out waiting for packet header " pins connection - rx-tx , tx-rx, gnd-gnd, gnd-gpio its same story when i'm trying to update through server - (rasppi). i have tried different drivers and still nothing read that connecting gpio-gnd is not everything - you also need to press reset button? but where is reset button? my adapter doesn't have one - just holes with rts , cts. I also tried different drivers but no sucess. Plese advise.

mmakaay commented 3 years ago

There is no reset button on the lamp. When comparing this setup with for example a NodeMCU, then:

The adapter is recognized by esphome-flasher? You can see its exposed COM-port in the drop down list? The adapter has been used with other ESP32 projects for flashing?

cracrama commented 3 years ago

Thank you for response and for amazing firmware - everything works fine now

I will describe below what was the issue in my case (maybe that will help someone)

Errors I was getting:

esphome HA A fatal error occurred: Failed to connect to ESP32: Timed out waiting for packet header *** [upload] Error 2

esphome flasher Using 'COM3' as serial port. Connecting......................................_____ Unexpected error: ESP Chip Auto-Detection failed: Failed to connect to Espressif device: Timed out waiting for packet header

esphome flasher log: view log Using 'COM3' as serial port. Unexpected error: could not open port 'COM3': PermissionError(13, 'Access is denied.', None, 5)

Solution: Get yourself decent FTDI adapter!!! I know cheap ones on ebay looks tempting but believe me - you will be using this tool many times in different projects so get one from reputable and trusted source. I went through 2 cheap adapters and when i finally got decent one everything went smooth as per author instruction.

Also - check your soldering (it wasn't main reason however i found during the initial testing that not everything was connected correctly even when soldering was looking "fine" - resoldering pads helped.

Thank you for great firmware and advice Best regards

mmakaay commented 3 years ago

"Get yourself decent FTDI adapter!!!", best advice ever :-D Thanks for reporting back with the detailed update. Great that you got it to work eventually!