Blackymas / NSPanel_HA_Blueprint

This allows you to configure your complete NSPanel via Blueprint with UI and without changing anything in the code
1.23k stars 227 forks source link

Panel does not connect to the WIFI #1842

Open edwardtfn opened 3 months ago

edwardtfn commented 3 months ago

After flash the firmware, the nspanel does not connect to the WIFI at all, Is there any location I can check log or debug? on ESP home wen it says flash complete. the panel now boot into ewelink frontend and does not have any connections at all.

_Originally posted by @vshijiav in https://github.com/Blackymas/NSPanel_HA_Blueprint/discussions/1756#discussioncomment-8621043_

edwardtfn commented 3 months ago

@vshijiav, could you please share your panel's ESPHome yaml? Please hide any private info before sharing.

vshijiav commented 3 months ago
substitutions:
  # Settings - Editable values
  device_name: "nspanel"
  friendly_name: "test"
  wifi_ssid: !secret wifi_ssid
  wifi_password: !secret wifi_password
  # nextion_update_url: "http://HAip:8123/local/nspanel_eu.tft"  # Optional
  # Add-on configuration (if needed)
  # heater_relay: "1"  # Possible values: "1" or "2"

# Customization area
##### My customization - Start #####
##### My customization - End #####

# Core and optional configurations
packages:
  remote_package:
    url: https://github.com/Blackymas/NSPanel_HA_Blueprint
    ref: main
    files:
      - nspanel_esphome.yaml # Core package
      # Optional advanced and add-on configurations
      # - advanced/esphome/nspanel_esphome_advanced.yaml
      # - nspanel_esphome_addon_climate_cool.yaml
      # - nspanel_esphome_addon_climate_heat.yaml
      # - nspanel_esphome_addon_climate_dual.yaml
    refresh: 300s

esp32:
  framework:
    type: esp-idf

I actually didn`t change much...compile without error, flash says complete.

vshijiav commented 3 months ago

I kind of figure it out, I created a guest network called test with a simple password and it instantly connect, I tried flash the welcome firmware on web esphome and connect with device hotspot and I see 2 wifi signal with same name(my mesh router network) Is this the reason it does not connect? Any solutions to this?

edwardtfn commented 3 months ago

I'm affraid this could be related to some special char used in your password or SSID that are not supported by the substitutions or not in the way we are using those substitutions. Could you please try these two approaches and let us know if any worked?

Try 1

substitutions:
  # Settings - Editable values
  device_name: "nspanel"
  friendly_name: "test"
  wifi_ssid: !secret wifi_ssid
  wifi_password: !secret wifi_password
  # nextion_update_url: "http://HAip:8123/local/nspanel_eu.tft"  # Optional
  # Add-on configuration (if needed)
  # heater_relay: "1"  # Possible values: "1" or "2"

# Customization area
##### My customization - Start #####
wifi:
  networks: !remove
  ssid: !secret wifi_ssid
  password: !secret wifi_password
##### My customization - End #####

# Core and optional configurations
packages:
  remote_package:
    url: https://github.com/Blackymas/NSPanel_HA_Blueprint
    ref: main
    files:
      - nspanel_esphome.yaml # Core package
      # Optional advanced and add-on configurations
      # - advanced/esphome/nspanel_esphome_advanced.yaml
      # - nspanel_esphome_addon_climate_cool.yaml
      # - nspanel_esphome_addon_climate_heat.yaml
      # - nspanel_esphome_addon_climate_dual.yaml
    refresh: 300s

esp32:
  framework:
    type: esp-idf

Try 2

substitutions:
  # Settings - Editable values
  device_name: "nspanel"
  friendly_name: "test"
  wifi_ssid: !secret wifi_ssid
  wifi_password: !secret wifi_password
  # nextion_update_url: "http://HAip:8123/local/nspanel_eu.tft"  # Optional
  # Add-on configuration (if needed)
  # heater_relay: "1"  # Possible values: "1" or "2"

# Customization area
##### My customization - Start #####
wifi:
  networks: !remove
  ssid: "!secret wifi_ssid"
  password: "!secret wifi_password"
##### My customization - End #####

# Core and optional configurations
packages:
  remote_package:
    url: https://github.com/Blackymas/NSPanel_HA_Blueprint
    ref: main
    files:
      - nspanel_esphome.yaml # Core package
      # Optional advanced and add-on configurations
      # - advanced/esphome/nspanel_esphome_advanced.yaml
      # - nspanel_esphome_addon_climate_cool.yaml
      # - nspanel_esphome_addon_climate_heat.yaml
      # - nspanel_esphome_addon_climate_dual.yaml
    refresh: 300s

esp32:
  framework:
    type: esp-idf
vshijiav commented 3 months ago

The strange thing is that as long as I connect to the SSID 'test' once, it starts to recognize my old 2.4G SSID. I flashed back old SSID version and now it seems everything works. But it does not show up in ESPhome, but HA instantly picked up the device and everything looks fine. BTW is there any way I can flash back to ewelink software? I cant find the original firmware anywhere.

edwardtfn commented 3 months ago

BTW is there any way I can flash back to ewelink software? I cant find the original firmware anywhere.

I've never tried that, but there is: https://github.com/Blackymas/NSPanel_HA_Blueprint/issues/972#issuecomment-1673164989

vshijiav commented 2 months ago

IMG_20240310_111107 After working for some days sadly it stops working, stuck at connect to WIFI...Is there any troubleshooting method to see what is happening with this? I can confirm none of the above works.

edwardtfn commented 2 months ago

Can you connect to your panel to get ESPHome logs? If so, please share some here.

vshijiav commented 2 months ago

Can you connect to your panel to get ESPHome logs? If so, please share some here.

The problem is, the panel actually never connects to ESPhome (Esphome shows offline all the time) After flash the firmware back and forth, the panel connects to the router and getting picked up instantly in home assistant... and therefore, set up correctly with the blueprint(but still not recognized by ESPhome, I run the docker version ESPhome), about a week or so, the panel restart once and never reconnect right now..

vshijiav commented 2 months ago

Or is there a way I can set up a hotspot for the panel that I can connect WIFI myself during setup?

edwardtfn commented 2 months ago

You can add captive_portal: to your panel's yaml, but you will have to connect to your panel to install this anyways. 😞

vshijiav commented 2 months ago

You can add captive_portal: to your panel's yaml, but you will have to connect to your panel to install this anyways. 😞

I think I found something, last time when the panel connected to WIFI, the router showing "ESPHOME-WEBXXXX" as device name, but in my yaml file, I named it 'nspanel'. Could this be the problem the ESPHOME never showed it online?

But why the firmware didn`t change the device name? Could this be something related to flashing firmware problem?

edwardtfn commented 2 months ago

If ESPHome can't connect to WiFi, it shook ukd expose an wifi fallback AP with your panel's name, but if it is connecting, you shoukd be able to see it's IP on the boot screen in the panel itself, although this picture you shared earlier shows another problem related to ESPHome not connecting to its display also:

IMG_20240310_111107

So, as I understood, if you go to ESPHome dashboard, it shows the panel offline, right? What about the integration in Home Assistant? Can you see data from your panel under Settings > Devices and Services > ESPHome? If so, could you please change the baud rate to 115200bps and check if the IP is shown in the boot screen?

vshijiav commented 2 months ago

If ESPHome can't connect to WiFi, it shook ukd expose an wifi fallback AP with your panel's name, but if it is connecting, you shoukd be able to see it's IP on the boot screen in the panel itself, although this picture you shared earlier shows another problem related to ESPHome not connecting to its display also:

IMG_20240310_111107

So, as I understood, if you go to ESPHome dashboard, it shows the panel offline, right? What about the integration in Home Assistant? Can you see data from your panel under Settings > Devices and Services > ESPHome? If so, could you please change the baud rate to 115200bps and check if the IP is shown in the boot screen?

When the panel connect to the WIFI, it get instantly picked up by HA integration, but ESPhome shows offline. In router the device name shows "ESPhome-webXXXX" not the name in the yaml file "nspanel" But right now the panel never connect to the WIFI, and shows the picture above

edwardtfn commented 2 months ago

When the panel connect to the WIFI, it get instantly picked up by HA integration

That means your panel is connected to WiFi. A long press on the time will bring you to the settings page. From there, a long press on the "Reboot" Text will bring you to the boot page, where you can se the IP.

Do you have HA and your panel in different networks? It could be that you have mDNS issue: https://esphome.io/guides/faq.html#notes-on-disabling-mdns

vshijiav commented 2 months ago

Yes I used ping instead of mdns, but still offline

Right now the panel refuse to connect to WIFI and behaving just like the picture shown above.

All the successful connection to WIFI was about five days ago, when I flash the panel back and forth and it finally connected once. And right now no matter how I flash the firmware, it refuse to connect and shows the picture above.

On Wed, Mar 13, 2024 at 3:50 PM Edward Firmo @.***> wrote:

When the panel connect to the WIFI, it get instantly picked up by HA integration

That means your panel is connected to WiFi. A long press on the time will bring you to the settings page. From there, a long press on the "Reboot" Text will bring you to the boot page, where you can se the IP.

Do you have HA and your panel in different networks? It could be that you have mDNS issue: https://esphome.io/guides/faq.html#notes-on-disabling-mdns

— Reply to this email directly, view it on GitHub https://github.com/Blackymas/NSPanel_HA_Blueprint/issues/1842#issuecomment-1996038285, or unsubscribe https://github.com/notifications/unsubscribe-auth/AGUUSZMLWFZNUILWHBSU3WTYYDJ3LAVCNFSM6AAAAABD6PAUSGVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMYTSOJWGAZTQMRYGU . You are receiving this because you were mentioned.Message ID: @.***>

edwardtfn commented 2 months ago

So, the panel is not connecting to Home Assistant then?

Ok.

So, I can only suggest you to flash via serial in this case. 😞

vshijiav commented 2 months ago

So, the panel is not connecting to Home Assistant then?

Ok.

So, I can only suggest you to flash via serial in this case. 😞

Okay so I tried on another computer reflash new version, and it connect to home assistant finally. But still: esphome shows offline updating TFT to see if everything works fine

vshijiav commented 2 months ago

Just flash back and forth again.... Really silly question: Do I have to long press the reset button on the panel before start flash the firmware? It seems on my computer if I straight plug the panel into USB and start flash, the panel won`t boot and shows the picture above. I tried long press the reset button before the flash and my FT232 flash got a green light blink once. Then it seems the firmware got loaded into the nspanel....Not sure if this would help though

edwardtfn commented 2 months ago

Do I have to long press the reset button on the panel before start flash the firmware?

No, that is not needed.

How is your panel's yaml now?

vshijiav commented 2 months ago

I tried 3 times using same file to flash. only with long press the button could get me to a proper boot. If I dont press the button the panel will just stuck at no ESPHome version like pictures above.

On Sat, Mar 16, 2024, 00:41 Edward Firmo @.***> wrote:

Do I have to long press the reset button on the panel before start flash the firmware?

No, that is not needed.

How is your panel's yaml now?

— Reply to this email directly, view it on GitHub https://github.com/Blackymas/NSPanel_HA_Blueprint/issues/1842#issuecomment-2001894478, or unsubscribe https://github.com/notifications/unsubscribe-auth/AGUUSZIBKL5GAHO4GKZKTVLYYPZUDAVCNFSM6AAAAABD6PAUSGVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDAMBRHA4TINBXHA . You are receiving this because you were mentioned.Message ID: @.***>

edwardtfn commented 2 months ago

Are you connecting IO0 to GND? That should be sufficient to put the board on flashing mode.

What you see in the screen is not very important when you are flashing ESP32. The screen have it's own firmware and will show that image (or anything provided by the TFT previously loaded) when it is powered on.

edwardtfn commented 2 months ago

Are you using ESPHome Web for flashing? That should inform you when erasing, flashing and when the transfer is done.

vshijiav commented 2 months ago

yes Im using esp web home

And I can see erase loading flash progress during flash, I also have all 5 connector soldered with pin so there wont be any contact issue. The only difference between button press or not during flash is: If I press the button, the flash procedure will take about 10 second longer.

On Sat, Mar 16, 2024, 05:58 Edward Firmo @.***> wrote:

Are you using ESPHome Web for flashing? That should inform you when erasing, flashing and when the transfer is done.

— Reply to this email directly, view it on GitHub https://github.com/Blackymas/NSPanel_HA_Blueprint/issues/1842#issuecomment-2001979957, or unsubscribe https://github.com/notifications/unsubscribe-auth/AGUUSZJ7MUTJ6LABDWCRTLDYYQ6YVAVCNFSM6AAAAABD6PAUSGVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDAMBRHE3TSOJVG4 . You are receiving this because you were mentioned.Message ID: @.***>

vshijiav commented 2 months ago

Its been a week since the fix, so far no problem seen, I have reflash the panel for like 5 times and confirmed only by long press the reset button could flash the panel in my hand. If I do not press the reset button, the flash procedure seems normal on computer screen but it is actually not flashing anything. And another strange part is no matter what network configuration in my yaml file (static ip), the panel never appears in ESPhome, but could instantly picked up by homeassistant. I have no idea whether it is my own panels problem or it is being newly manufactured (I bought this from taobao`s sonoff official, I can assume this is a very new version)

edwardtfn commented 2 months ago

no matter what network configuration in my yaml file (static ip)

I don't see the static ip on your yaml. Could you please share that again? It's fine if you hide the IP address, but I wanna know how is my your real settings. And if you are downloading the TFT file directly from GitHub (not using nextion_update_url) and using manual ip, you also must have the dns set in your yaml.

edwardtfn commented 1 month ago

Hey @vshijiav, any update to this?

vshijiav commented 1 month ago
substitutions:
  # Settings - Editable values
  device_name: "test"
  friendly_name: "test"
  wifi_ssid: !secret wifi_ssid
  wifi_password: !secret wifi_password
  nextion_update_url: "http://homeassistant.local:8123/local/nspanel_eu.tft"  # Optional
  # Add-on configuration (if needed)
  # heater_relay: "1"  # Possible values: "1" or "2"

wifi:
  manual_ip:
        static_ip: ${ip}
        gateway: ${gw}
        subnet: ${subnet}
        dns1: ${dns}

# Core and optional configurations
packages:
  remote_package:
    url: https://github.com/Blackymas/NSPanel_HA_Blueprint
    ref: main
    files:
      - nspanel_esphome.yaml # Basic package
      # Optional advanced and add-on configurations
      # - esphome/nspanel_esphome_advanced.yaml
      # - nspanel_esphome_addon_climate_cool.yaml
      # - nspanel_esphome_addon_climate_heat.yaml
      # - nspanel_esphome_addon_climate_dual.yaml
    refresh: 300s

esp32:
  framework:
    type: esp-idf

this is my yaml, it still not being recognized by ESPHOME, but could be instantly picked up by homeassistant.

And about the flash, I can confirm if I dont long press the reset button before flash, it does not flash anything into the panel.(even though the screen shows a progress of flashing). I have tried to flash the sample firmware on ESPWEB, if I dont press the button, after the flash the panel will straight boot into NSPanel_HA_Blueprint, but if I press the button, the panel will flashed with the sample firmware(boot with a blacked screen with a WIFI hotspot)

edwardtfn commented 1 month ago

Please try this:

substitutions:
  # Settings - Editable values
  device_name: "test"
  friendly_name: "test"
  wifi_ssid: !secret wifi_ssid
  wifi_password: !secret wifi_password
  nextion_update_url: "http://homeassistant.local:8123/local/nspanel_eu.tft"  # Optional
  # Add-on configuration (if needed)
  # heater_relay: "1"  # Possible values: "1" or "2"

# Customization area
##### My customization - Start #####

# Set IP address manually
wifi:
  networks:
    - id: !extend wifi_default
      manual_ip:
        static_ip: ${ip}
        gateway: ${gw}
        subnet: ${subnet}
        dns1: ${dns}
##### My customization - End #####

# Core and optional configurations
packages:
  remote_package:
    url: https://github.com/Blackymas/NSPanel_HA_Blueprint
    ref: main
    refresh: 300s
    files:
      - nspanel_esphome.yaml # Basic package
      # Optional advanced and add-on configurations
      # - esphome/nspanel_esphome_advanced.yaml
      # - nspanel_esphome_addon_climate_cool.yaml
      # - nspanel_esphome_addon_climate_heat.yaml
      # - nspanel_esphome_addon_climate_dual.yaml
edwardtfn commented 1 month ago

Hey @vshijiav, any update to this?

AlainKlarte commented 2 weeks ago

Hy Guys For what it's worth, I had the same problem of Panel not connecting to wifi, while I was rather confident in the flashing process. I had cleaned the "-" and "_" from the ssid name, but it was changing nothing. When looking at the validation logs, I've seen that my ssid name TPLink1234 was appearing as TPLINK1234 in the logs. I could imagine the ssid was case sensitive, but I'd not imagined that the validation or later compilation would turn the ssid into caps. When moving my router ssid to caps, the panel immediately and magically appeared on HA. Seems to me as a little bug. Besides, all my thanks to the incredible community working on HA, with special thanks @edwardtfn and @MarkWattTech. Hope it may help. Regards