cant program esp01

Hello, I uploaded software to esp01 using Arduino ide, it works, but I wanted to make case for it and put it on the wall and I modified the sketch to add OTA support and after uploading it to esp8266 to test it work and I upload it to esp01 and after I made a new version of that sketch I try to upload it to esp 01 over OTA, but it doesn’t work, then I connected I trough USB to serial to pc and try it upload again but using serial and it doesn’t work. using OTA it writes: [ERROR]: Error Uploading and if I use serial it write:
esptool.py v2.8
Serial port COM5
Connecting……_____
Traceback (most recent call last):
File “C:\Users\Martin\Documents\ArduinoData\packages\esp8266\hardware\esp8266\2.6.3/tools/upload.py”, line 65, in
esptool.main(cmdline)
File “C:/Users/Martin/Documents/ArduinoData/packages/esp8266/hardware/esp8266/2.6.3/tools/esptool\esptool.py”, line 2890, in main
esp.connect(args.before)
File “C:/Users/Martin/Documents/ArduinoData/packages/esp8266/hardware/esp8266/2.6.3/tools/esptool\esptool.py”, line 483, in connect
raise FatalError(‘Failed to connect to %s: %s’ % (self.CHIP_NAME, last_error))
esptool.FatalError: Failed to connect to ESP8266: Timed out waiting for packet header
esptool.FatalError: Failed to connect to ESP8266: Timed out waiting for packet header

but if I set boot mode on esp01 then rxd led light and booth LEDs on esp01 light. Where can be a problem? Thank you Martin