Turn off wifi and bt?

zliudr
Posts: 66
Joined: Thu Oct 03, 2019 5:15 am

Turn off wifi and bt?

Postby zliudr » Tue Nov 26, 2019 5:20 am

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.

Aussie Susan
Posts: 13
Joined: Thu Aug 22, 2019 3:48 am

Re: Turn off wifi and bt?

Postby Aussie Susan » Wed Nov 27, 2019 2:39 am

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.
Susan

zliudr
Posts: 66
Joined: Thu Oct 03, 2019 5:15 am

Re: Turn off wifi and bt?

Postby zliudr » Wed Nov 27, 2019 8:12 pm

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.

ESP_Angus
Posts: 1897
Joined: Sun May 08, 2016 4:11 am

Re: Turn off wifi and bt?

Postby ESP_Angus » Thu Nov 28, 2019 12:38 am

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():
https://docs.espressif.com/projects/esp ... fi_deinitv

You can also de-initialize the BT controller:
https://docs.espressif.com/projects/esp ... er_deinitv

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

zliudr
Posts: 66
Joined: Thu Oct 03, 2019 5:15 am

Re: Turn off wifi and bt?

Postby zliudr » Sun Dec 01, 2019 2:04 am

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 ;)

Who is online

Users browsing this forum: Google [Bot] and 21 guests