How to use WifiClient in esp32

I see the example program already connected wifi network. How to use mqtt and webserver function? Because of the wifi object has been used.

You can use wifi library.
When a device acquires an IP address, call mDashStart() function.

How to use the following object after embed mDash core?

WiFiClient espClient;
PubSubClient client(espClient);

Any example for reference?

mDash is just a library, so use it like any other library.
Think about that the other way around.
Build your sketch using WiFiClient and PubSubClient.
Then, add mDash to it - that could be done by sticking a single line with mDashStart() call into a right place.

Does that make sense?


My device will sleep periodically. How can I check if FOTA occur and stop sleeping?

Could you elaborate please?

I can ugrade firmware but program sleep will stop the process of OTA. How to check ota is processing in program loop in arduino?

Create a global variable int ota = 0;
Create a custom RPC function that changes that variable to 1.
Before upgrading your device, call that function to set the variable to 1.
In your Arduino loop, check the value of the variable.

Understand thx.
Other questions, how the production occurs that each device use deferent keys and names? 100 device use 100 firmware?

No. The firmware should be the same. WiFi config should reside in the config file. Please read the docs.

When I change the project to platform IO, there is build error

.pio/build/esp32dev/src/main.cpp.o:(.literal._Z4loopv+0x15c): undefined reference to `mDashInit’

Or Any tip to choose partitions scheme in VScode?