Flashing Help: Failed to Connect to ESP32: Timed Out Waiting for Packet Header #esp32


NeoMoses
 

Hi, I'm having trouble uploading the firmware to my ESP32 with the Hujer Shield.  This board was pre-flashed from George and just needs an update to the drive ratios to match my final mechanical setup.  I keep getting the "A fatal error occurred: Failed to connect to ESP32: Timed out waiting for packet header" when I try to upload the sketch.

I am connected to the computer and it shows up on port COM5 when I look in Device Manager.  I've both 921600 and 115200 upload speeds.  Any idea what I'm doing wrong here?  I feel like I'm getting really close now!  

Arduino: 1.8.19 (Windows Store 1.8.57.0) (Windows 10), Board: "ESP32 Dev Module, Disabled, Default 4MB with spiffs (1.2MB APP/1.5MB SPIFFS), 80MHz (WiFi/BT), QIO, 80MHz, 4MB (32Mb), 921600, None"
 
Sketch uses 338537 bytes (25%) of program storage space. Maximum is 1310720 bytes.
 
Global variables use 21524 bytes (6%) of dynamic memory, leaving 306156 bytes for local variables. Maximum is 327680 bytes.
 
esptool.py v2.6
 
Serial port COM5
 
Connecting........_____....._____....._____....._____....._____....._____.....____An error occurred while uploading the sketch
 
_
 
 
 
A fatal error occurred: Failed to connect to ESP32: Timed out waiting for packet header
 
 


Dave Schwartz
 

Try holding down the EN0 button while its outputting the ...s and ___s until it recognizes it. Some modules/situations need it, some don't.

On 2022-05-10 12:53 a.m., NeoMoses wrote:
Hi, I'm having trouble uploading the firmware to my ESP32 with the Hujer Shield.  This board was pre-flashed from George and just needs an update to the drive ratios to match my final mechanical setup.  I keep getting the "A fatal error occurred: Failed to connect to ESP32: Timed out waiting for packet header" when I try to upload the sketch.

I am connected to the computer and it shows up on port COM5 when I look in Device Manager.  I've both 921600 and 115200 upload speeds.  Any idea what I'm doing wrong here?  I feel like I'm getting really close now!

Arduino: 1.8.19 (Windows Store 1.8.57.0) (Windows 10), Board: "ESP32 Dev Module, Disabled, Default 4MB with spiffs (1.2MB APP/1.5MB SPIFFS), 80MHz (WiFi/BT), QIO, 80MHz, 4MB (32Mb), 921600, None"
Sketch uses 338537 bytes (25%) of program storage space. Maximum is 1310720 bytes.
Global variables use 21524 bytes (6%) of dynamic memory, leaving 306156 bytes for local variables. Maximum is 327680 bytes.
esptool.py v2.6
Serial port COM5
Connecting........_____....._____....._____....._____....._____....._____.....____An error occurred while uploading the sketch
_
A fatal error occurred: Failed to connect to ESP32: Timed out waiting for packet header


Dave Schwartz
 

Actually, the IO0 button. One of them anyway... try both.

On 2022-05-10 8:02 a.m., Dave Schwartz wrote:
Try holding down the EN0 button while its outputting the ...s and ___s until it recognizes it. Some modules/situations need it, some don't.

On 2022-05-10 12:53 a.m., NeoMoses wrote:
Hi, I'm having trouble uploading the firmware to my ESP32 with the Hujer Shield.  This board was pre-flashed from George and just needs an update to the drive ratios to match my final mechanical setup.  I keep getting the "A fatal error occurred: Failed to connect to ESP32: Timed out waiting for packet header" when I try to upload the sketch.

I am connected to the computer and it shows up on port COM5 when I look in Device Manager.  I've both 921600 and 115200 upload speeds.  Any idea what I'm doing wrong here?  I feel like I'm getting really close now!

Arduino: 1.8.19 (Windows Store 1.8.57.0) (Windows 10), Board: "ESP32 Dev Module, Disabled, Default 4MB with spiffs (1.2MB APP/1.5MB SPIFFS), 80MHz (WiFi/BT), QIO, 80MHz, 4MB (32Mb), 921600, None"
Sketch uses 338537 bytes (25%) of program storage space. Maximum is 1310720 bytes.
Global variables use 21524 bytes (6%) of dynamic memory, leaving 306156 bytes for local variables. Maximum is 327680 bytes.
esptool.py v2.6
Serial port COM5
Connecting........_____....._____....._____....._____....._____....._____.....____An error occurred while uploading the sketch
_
A fatal error occurred: Failed to connect to ESP32: Timed out waiting for packet header


Serge CLAUS
 

I have the same problem with an AMD computer. I use an USB hub and it works


Le 10 mai 2022 14:05:03 GMT+02:00, "Dave Schwartz via groups.io" <Dave.Schwartz@...> a écrit :
Actually, the IO0 button. One of them anyway... try both.

On 2022-05-10 8:02 a.m., Dave Schwartz wrote:
Try holding down the EN0 button while its outputting the ...s and ___s until it recognizes it. Some modules/situations need it, some don't.

On 2022-05-10 12:53 a.m., NeoMoses wrote:
Hi, I'm having trouble uploading the firmware to my ESP32 with the Hujer Shield.  This board was pre-flashed from George and just needs an update to the drive ratios to match my final mechanical setup.  I keep getting the "A fatal error occurred: Failed to connect to ESP32: Timed out waiting for packet header" when I try to upload the sketch.

I am connected to the computer and it shows up on port COM5 when I look in Device Manager.  I've both 921600 and 115200 upload speeds.  Any idea what I'm doing wrong here?  I feel like I'm getting really close now!

Arduino: 1.8.19 (Windows Store 1.8.57.0) (Windows 10), Board: "ESP32 Dev Module, Disabled, Default 4MB with spiffs (1.2MB APP/1.5MB SPIFFS), 80MHz (WiFi/BT), QIO, 80MHz, 4MB (32Mb), 921600, None"
Sketch uses 338537 bytes (25%) of program storage space. Maximum is 1310720 bytes.
Global variables use 21524 bytes (6%) of dynamic memory, leaving 306156 bytes for local variables. Maximum is 327680 bytes.
esptool.py v2.6
Serial port COM5
Connecting........_____....._____....._____....._____....._____....._____.....____An error occurred while uploading the sketch
_
A fatal error occurred: Failed to connect to ESP32: Timed out waiting for packet header


Groups.io Links: You receive all messages sent to this group.
View/Reply Online (#43975): https://onstep.groups.io/g/main/message/43975
Mute This Topic: https://groups.io/mt/91006720/531573
Mute #esp32:https://onstep.groups.io/g/main/mutehashtag/esp32
Group Owner: main+owner@onstep.groups.io
Unsubscribe: https://onstep.groups.io/g/main/leave/1105991/531573/661606445/xyzzy [serge@...]
--
Envoyé de mon appareil Android avec Courriel K-9 Mail. Veuillez excuser ma brièveté.


George Cushing
 

When the IED reports Linking everything together... Depress the Boot switch until you see Connecting.... Then release the switch.
image.png


NeoMoses
 

Hi George, I've tried pushing the button on the board and that did not work.  I only see a single button on this board, to the left of the USB.  Is that the correct button?  George, you've flashed this board before, so I'm assuming you know the magic to make it work.  I feel so close right now, yet so far away!

@Dave Schwarz, I don't see an EN0 or IO0 button. Should I be shorting those pins to ground? I see the IO0, but not an EN0 pin. Any thoughts?


Dave Schwartz
 

I thought you were talking about the ESP32S module used for the SHC or SWS w/Bluetooth. You have the ESP32 shield for the controller and I have no experience with these... ignore my ramblings.

On 2022-05-11 12:30 a.m., NeoMoses wrote:
Hi George, I've tried pushing the button on the board and that did not work.  I only see a single button on this board, to the left of the USB.  Is that the correct button?  George, you've flashed this board before, so I'm assuming you know the magic to make it work.  I feel so close right now, yet so far away!

@Dave Schwarz, I don't see an EN0 or IO0 button. Should I be shorting those pins to ground? I see the IO0, but not an EN0 pin. Any thoughts?


Rana Khan
 

Try by selecting board esp32, (update to 2.0.2 version) then run uploading again. This solved my same problem.
Thanks,
Rana.

On Wed, May 11, 2022, 10:00 AM NeoMoses <bryanpryor@...> wrote:
Hi George, I've tried pushing the button on the board and that did not work.  I only see a single button on this board, to the left of the USB.  Is that the correct button?  George, you've flashed this board before, so I'm assuming you know the magic to make it work.  I feel so close right now, yet so far away!

@Dave Schwarz, I don't see an EN0 or IO0 button. Should I be shorting those pins to ground? I see the IO0, but not an EN0 pin. Any thoughts?


NeoMoses
 

Rana, I'm not seeing 2.0.2 for the ESP32 board.  I'm using 1.0.4, and only see availability up to 1.0.6.


NeoMoses
 

I might have some success:  I just disconnected the Hujer Shield from the ESP32 board and it seems to have flashed.  However, I did not get any response when I typed in the :GVP# command.  I'm off to test it on the telescope.


NeoMoses
 

No success.  I plugged in the motors and SHC to the controller and got some strange noises out of the motors, as well as a connection error.  The SHC screen says "Establishing Connection" for about 30 seconds, then says, "Coordinates Observed Place..." before going blank.  After this there is no apparent connection to the SHC.  The motors are making a strange Hiss or thumping sound, kind of like a horse galloping.  I'll post a video to help explain that.
https://youtu.be/B-1rWA8iCks

I tried uploading OnStep 4.2.4 with 2 files from George Cushing.  I had modified the Steps/Axis values and my microsteps.  I'm attaching my config.h here.  Can you see what I'm doing wrong?  I've obviously messed up something when I flashed it.


hitosi sato
 

Hi
Have you tried connecting GPIO 0 to GND with a jumper wire and then plugging in the USB connector and pressing the button once?
Some UNO-based boards may work better with GPIO 0 low.


NeoMoses
 

Finally, a breakthrough!  It was a pinmaps problem.  George had sent me a pinmaps file, but I had copied it to the main OnStep Directory.  I opened the file, read the instructions in the comments (doh!) and realized I needed to "(replace content of Pins.MaxESP3.h in OnStep\src\pinmaps\, retain Pins.MaxESP3.h file name)".  

I had one more error uploading, but upon looking at my config.h I found it calling out the InsteinESP1.  I changed that to MaxESP3 to match the new pinmap and voila!  It's working again.  Thanks again to everyone who is helping, and everyone who has posted knowledge /learnings in the past.  There's no way I could do this without reading and re-reading the Wiki and the messages in this group.

My next step is to check the accuracy on my Azimuth axis and adjust steps as needed, but so far it's looking promising.  Here's a video of where I'm leaving it tonight:
https://youtu.be/ZhFss3rGhBw 


George Cushing
 

Yes the shield has to be pulled before flashing the D1 R32. Roman uses the D1 R32's 5V reg.to power the SHC. Even w/o the SHC connected it may be a problem. He also defines Axis1_DIR 0 and cuts the blue LED circuit to free pin 2 for  ST4DEs. I forgot to cut the circuit and the RA motor ran too fast. Getting blink LED signals as guiding correction pulse? Doubled speed again when the SHC was engaged. 


George Cushing
 


NeoMoses
 

Thanks to all for all the help. Pulling the shield from the D1 R32 was the key I needed to flash the board, and getting the pinmap right was the second main problem.  Once there, with the ability to flash, I found a few other problems with my config.h, such as being set up for GEM mode rather than Alt/Az.  Some other small stuff like that was tweaked and it seems to be working.  I think I have it fixed now, and have the ability to update and re-flash as needed. 

Now I need to adjust my drive ratio on my Az axis to at least double the speed. It's way too slow, and I have plenty of torque to go faster.  I also need to rebuild my Alt drive mount.  I'm getting too much flex in the plastic bracket.  I'm going to re-design it to be MUCH stiffer, and maybe make it out of wood or metal.  Plenty to do, and very little time before the weather really gets nice.  Thanks again, and I'll try to document this once I have it fully functioning!