Chat freely about anything...

User avatar
By John Hill
#86670 Hi Hopefully someone can point me in the right direction, I'm using a WEMOS D1 mini to prototype my device, the actual product will utilise an ESP07S, My device uses Ethernet (Wiznet 5100) as Wifi is not used, but I am also using SPIFFS along with an SD card, however due to a know issue with FS.h and SD sharing the File class I have had to declare a define in my code FS_NO_GLOBAL, whilst this is fine and the SPIFFS and SD now work, I was including the Wifi Library only to switch of the Wifi off by using WiFi.mode(WIFI_OFF) that's it.

The problem is it would not compile, I found the reason for this is because FS.h is also used in the SSL within the Wifi library, hence if I comment the Wifi Library out all is ok.

I want to turn the WiFi off and wondered is there a direct register statement I can used without using the entire WiFi Library? I'm not an experience programmer but I can work most things out, I have looked through the various files that makeup the WiFi library, I have found were the various modes are selected but I cant find the small section of code that actually turns the WiFi off.

Obviously I guess my other option is to try and find every instance of File and change it to fs::File, however I'm not sure how many instances of this are used throughout the entire WiFi Library.

Any help would be most appreciated.

Many Thanks

Jono
User avatar
By schufti
#86680 some time ago this was circulated to switchoff wifi

Code: Select all#include <user_interface.h>
   wifi_station_disconnect();
   wifi_set_opmode(NULL_MODE);
   wifi_set_sleep_type(MODEM_SLEEP_T);
   wifi_fpm_open();
   wifi_fpm_do_sleep(FPM_SLEEP_MAX_TIME);
User avatar
By John Hill
#86685 Hi schufti,

Thankyou so much, I've added as you described, this line "wifi_fpm_do_sleep(FPM_SLEEP_MAX_TIME);" didn't recognise FPM_SLEEP_MAX_TIME, I looked it up and entered what I think is the maximum time in hex 0xFFFFFFF (think its supposed to be in uint32), however its complied I guess I will have to check current draw to see if this has worked although that's no critical for me, but the device is no longer visible on my network.

Thank you so much
Regards

Jono :)