ESP32 not connecting to WiFi since SSID was changed

Hello,

I have three ESP32 modules that have worked fine for almost one year.

Now we had to change our WiFi SSID and password and all three ESP32 modules won’t connect anymore.

Here’s one of the configs:

esp32:
  board: esp32dev
  framework:
    type: arduino
esphome:
  name: "esp32-01-sensornode01"
logger:
api:
  encryption:
    key: "APIPW"
ota:
  - platform: esphome
    password: "OTAPW"
wifi:
  ssid: !secret wifi_ssid
  password: !secret wifi_password
  fast_connect: true
  ap:
    ssid: "Sensornode01 Fallback Hotspot"
    password: "FBAPPW"
captive_portal:
sensor:
  - platform: bh1750
    name: "BH1750 Illuminance"
    address: 0x23
    update_interval: 1s
    filters:
        - sliding_window_moving_average:
            window_size: 4
            send_every: 1
        - delta: 0.1
  - platform: bme280_i2c
    address: 0x76
    temperature:
      name: "BME280 Temperature"
      oversampling: 16x
      accuracy_decimals: 2
      state_class: "measurement"

    pressure:
      name: "BME280 Pressure"
      state_class: "measurement"

    humidity:
      name: "BME280 Humidity"
      state_class: "measurement"

    update_interval: 5s

i2c:
    scl: 32
    sda: 26
button:
  - platform: restart
    name: Restart
esp32_ble_tracker:

The new WiFi SSID has the character “!” in it, which the old one didn’t have.
Could this be the issue?

All three modules connect to the (simulated using my phone’s hotspot) old network SSID and password just fine (I have of course set the new WiFi credentials in my config when we changed it)

Best Regards
Aaron Eisele

Not sure, but that’s easy enough to test is it not?

I have, as I wrote in the original post, tested it by making a hotspot (using my android phone) with the old WiFi SSID which didn’t contain a !, and it worked…

And if you include a ! on your hotspot it does not connect?

I’ll have test that, but our new SSID also has a space in it, which the old one also didn’t have…

So you test that too then :blush:

Why not just change the ssid to what it used to be?

The problem with that is that our old SSID and Password got leaked so we had to change that, I am also not the admin of the network abd I’m only an advanced user with no access to the router and APs

Ok, so I simulated a new SSID with only a space (no !) in it (“Network Test”) and it connected just fine to it…

Alright, so that’s not the issue then. I’m not sure how you would troubleshoot this without having access to the admin on the wifi. Maybe check with the admin, or set up your own wifi if possible?

I can set up a temporary WiFi network via the hotspot of my laptop or PC for testing the problem with the SSID and check if it connects to that.
However,
I will have to accept the SSID of our main network as it is and have to find a way of connecting my ESP32 modules to it without any router changes or added hardware as I’m not allowed to e.g buy my own AP due to business security reasons…

I would check with the admin - if this is business network and you have business related needs to connect these devices they should be able to troubleshoot.

Just an idea - have you tried using the hex value in the SSID?
%21 is ! I believe…

Edit - or try single quotes rather than double quotes in your secrets file

I have now tried using single quotes around the SSID in my secrets.yaml file, but it still can’t connect to the network even though it says it has found it…
It is configured to connect to the SSID I call “Network! 1” in the logfile for security/privacy reasons.

[14:49:27][D][wifi:482]: Starting scan...
[14:49:33][D][wifi:497]: Found networks:
[14:49:33][D][wifi:546]: - 'Network 2'[redacted] (redacted BSSID) [redacted]▂▄▆█
[14:49:33][D][wifi:546]: - 'Network! 1'[redacted] (redacted BSSID) [redacted]▂▄▆█
[14:49:33][D][wifi:546]: - 'Network! 1'[redacted] (redacted BSSID) [redacted]▂▄▆█
[14:49:33][D][wifi:546]: - 'Network! 1'[redacted] (redacted BSSID) [redacted]▂▄▆█
[14:49:33][D][wifi:546]: - 'Network 2'[redacted] (redacted BSSID) []▂▄▆█
[14:49:33][D][wifi:546]: - 'Network 2'[redacted] (redacted BSSID) [redacted]▂▄▆█
[14:49:33][W][wifi:551]: No matching network found!
[14:49:33][D][wifi:697]: Retrying with hidden networks...

I have replaced the problematic SSID with “Network! 1” and our guest network (which doesn’t have the ! in the SSID but is separated from the main network) with “Network 2” fro security reasons

I have now had the SSID changed by the admin so it doesn’t contain soaces or exclamation marks.

Now, one ESP can connect and stays permanently connected, one only connects once every few hours (otherwise it faiks with the “Auth Expired” message)