Can't upload CODE VIA OTA when my sensor is working

Hello guys,im working on a wemos D1 with one bmp280 sensor and trying to add an illuminance sensor today,my sensor is working properly with the home assistant but when i try to upload the new file the esphome cant resolve the ip adress,so i just compile it to a bin then flashed it on the wemos and the sensors were working great,then i wanted to see if the OTA programming was resolved but still goes with the same error,when litterally the sensor is online on the system and tranferring data,why i cant upload?

esphome:
  name: my_first_sensors
  platform: ESP8266
  board: d1_mini

wifi:
  ssid: "SALONI"
  password: "*************"

  # Enable fallback hotspot (captive portal) in case wifi connection fails
  ap:
    ssid: "SALONI"
    password: "************"

captive_portal:

# Enable logging
logger:

# Enable Home Assistant API
api:

ota:

i2c:
  sda: D2
  scl: D1
  scan: False
  id: bus_a

sensor:
  - platform: bmp280
    i2c_id: bus_a
    temperature:
      name: "BMP280 Temperature"
      id: bmp280_temperature
      oversampling: 16x
      filters:
      - offset: -1.6
    pressure:
      name: "BMP280 Pressure"
      id: bmp280_pressure
      oversampling: 16x
      filters:
      - offset: 14.3
    address: 0x76
    
  - platform: adc
    pin: A0
    name: "TEMT6000 Illuminance"
    unit_of_measurement: lx
    filters:
      - lambda: |-
          return (x / 10000.0) * 2000000.0;
    update_interval: 5s
    
  - platform: wifi_signal
    name: "WiFi Signal Sensor"
    update_interval: 60s

Use a static IP address.

I tried IPv4 Address. . . . . . . . . . . : 192.168.1.13(Preferred) nothing
i tried DHCP Server . . . . . . . . . . . : 192.168.1.1 nothing

    static_ip: 192.168.1.1 or this .13
    gateway: 192.168.1.1
    subnet: 255.255.255.0

You cannot set the static ip to be the same as your router.

what ip should i use?

Something that nothing else on your LAN is using, outside your DHCP range so thet the DHCP server doesn’t give that IP to another device.

Sorry but i dont get it,where can i find my range of DHCP? give me an example if you can please,thank you for your answers!

Take a look at your router. There is likely a dhcp page.

I guess my DHCP range is this


i tried 192.168.1.251-250-247 and some other randoms that nothing is on them and stil the same error,i have to say that i didnt have that problem yesterday

PLUS
my sensor is currenlty working that means with the simple SSID and pass is connecting, so idont get it why i cant upload with the same setting via OTA

Okey weird,here what i did,i Compled a fresh bin and upload it via ESPHOME flasher,on the log i found that the ip was 192.168.1.17 that was connecting succesfull,then i added this ip manually and it worked.Why that happened though?