Unable to Flash: AJ-SR04M - Invalid head of packet

Hi all,

I’m getting the following error trying to flash my AJ-SR04M sensor

  • Unexpected error: ESP Chip Auto-Detection failed: Failed to connect to Espressif device: Invalid head of packet (0x00)

The AJ-SR04M is a water proof version of the HC-SR04 sensor that I’ve been able to successfully flash, see Ultrasonic Distance Sensor (also referenced here)

I have reversed RX/TX

Here’s my .yaml

  • I want to flash it first and code for it later so it’s pretty blank
  • I created my “oil-gauge.bin” with it when using esphome-flasher where it was recognized using COM4
    image

I tried not reversing RX/T but got the following:

  • Unexpected error: ESP Chip Auto-Detection failed: Failed to connect to Espressif device: Timed out waiting for packet header

Nothing seemed to jump out to me in the “I can’t get flashing over USB to work” section of the ESPHome Frequently Asked Questions

For reference, here’s a short video of my failing flash attempt:

You can’t flash that with esphome - it does not have an esp chip in it.

lol! Well, I guess that “might” the problem… Yeah, after I sent this post that was the only thing I could think of that might be the cause. I tried to read the text on chip to verify if it was an ESP chip, but it was scratched.

I bought an extra Sonoff SV just in case (f/ a previous project) that I should be able to hook this sensor up to similar to my last project - maybe I’ll also add an LED that will turn on when appropriate. Thanks @nickrout!