Page 1 of 1

Turn off wifi and bt?

Posted: Tue Nov 26, 2019 5:20 am
by zliudr
I suspect that my prototype board has some interference issue so I would like to turn off wifi and bt. Is there any esp-idf calls that can do that? Thanks.

Re: Turn off wifi and bt?

Posted: Wed Nov 27, 2019 2:39 am
by Aussie Susan
It might be my ignorance or my misunderstanding your question, but I thought you had to turn on both BT and WiFi.
Therefore neither should be working if you have not called the functions to turn them on.

Re: Turn off wifi and bt?

Posted: Wed Nov 27, 2019 8:12 pm
by zliudr
I am not sure. So I am as ignorant as the next person with this question. I suspect that the hardware might be on by default but it would be great to hear from someone who has a clear answer.

Re: Turn off wifi and bt?

Posted: Thu Nov 28, 2019 12:38 am
by ESP_Angus
Not on by default, so not using it should be equivalent to enabling and then disabling.

If you need to disable after calling esp_wifi_init() then you can call esp_wifi_deinit(): ... fi_deinitv

You can also de-initialize the BT controller: ... er_deinitv

But these APIs should only be called after the corresponding APIs to enable wifi/BT have been called.

Re: Turn off wifi and bt?

Posted: Sun Dec 01, 2019 2:04 am
by zliudr
Thanks ESP_Angus. It's good to know that. I think my misunderstanding stems from my earlier exposure with ESP8266-Arduino. It always auto-reconnects to the last AP when restarted that must mean that "ESP8266 starts with WiFi turned on". It might have been a feature in ESP8266-Arduino to make it easy to use?! Once I got my first ESP32, it was MicroPython time! Now it's ESP-IDF time, down to the layer that everything else has been built on. If only I had time to read all the 2,000 pages of documents, I'd be better of already ;)