How to connect to an ESP32 device even with WiFi network OFF and only via USB cable

Hi.
I’m newbie to ESP Home.
I’ve just configured an ESP32 device in my Home Assistant environment that run on Raspberry Pi 4.
Opening the web interface I see the ESP32 device regularly online:


The issue is that when I close my WiFi connection the device goes offiline.
I know that the reason is due to the initial configuration of the device in wich I’d to put SSID and password to connect to my WiFi network:
conf
However , because the ESP32 is connected to Raspberry my means an USB cable, I’d like that the device will be online even with WiFi router OFF.
How must I modify the ESP32 configuration’s file in a manner that this will work?
Any idea?
Thanks in advance.

That could be tricky. The ‘online’ indication is for the availability of your esphome device in your network (typically WiFi but also Ethernet) and is done using mDNS.

Over serial (USB) on the other hand there is no “communication line” like mDNS or even TCP/IP to reach other network devices.

The usb-serial connection you have is limited to flash (called “install” in the dashboard) esphome to a esp. This should be working even if you turn WiFi off (the esphome node is “offline”) as long you have a serial connection.

1 Like

Hi.
Thanks for you reply.
The problem is that when I shut down the WiFi network not only I view the ESP32 device offline but also sensors like BLE devices (i.e. Xiaomi Mijia BLE Sensors) go offline.

I would like that BLE devices were online even whit no WiFi network enabled.
Any other idea?

Exactly that behavior is expected. The esphome node needs WiFi (if you are not working with Ethernet) to have a connection to home assistant established. That all sensors for that (offline) esphome device then are unavailable too is logical.

If you gonna stick with esphome just get yourself a wired network connection for that device:

Another solution (if the distance to the ble devices isn’t to far) is to use the ha server with ble hardware.

1 Like

Another solution (if the distance to the ble devices isn’t to far) is to use the ha server with ble hardware.

I’m using Rapberry PI 4 as HA server, is it suitable ?

Chances are not to low that the internal rpi 4 Bluetooth should work for that use case.

You could try this custom component:

1 Like