-->
Page 2 of 3

Re: Disable WiFi completely

PostPosted: Sat Dec 02, 2017 5:03 am
by Barnabybear
Hi, if you use an output pin that doesn't support SPI you will get the notification but it should still compile and run. Off hand pin 2 on the ESP is SPI data (SDA) - pin14 is the clock to match that (SCL) but you don't need to use that.

Re: Disable WiFi completely

PostPosted: Mon Dec 04, 2017 3:46 am
by sofos1990
btidey wrote:Add
Code: Select allWiFi.mode( WIFI_OFF );
WiFi.forceSleepBegin();


into setup()


Hmm...I might be doing something wrong but it doesn't work for me.
1111.JPG


I get the "'WiFi' was not declared in this scope" error.


Barnabybear wrote:Hi, if you use an output pin that doesn't support SPI you will get the notification but it should still compile and run. Off hand pin 2 on the ESP is SPI data (SDA) - pin14 is the clock to match that (SCL) but you don't need to use that.


Great that works!
PinD2 works I just have to write the GPIO number which is 4. So I chose the wrong pin it seems. Thank you!

Re: Disable WiFi completely

PostPosted: Mon Dec 04, 2017 12:57 pm
by martinayotte
sofos1990 wrote:I get the "'WiFi' was not declared in this scope" error.


Code: Select all#include <ESP8266WiFi.h>

Re: Disable WiFi completely

PostPosted: Tue Dec 05, 2017 2:52 am
by sofos1990
martinayotte wrote:
sofos1990 wrote:I get the "'WiFi' was not declared in this scope" error.


Code: Select all#include <ESP8266WiFi.h>


Cool yeah now it works but I'm not sure if it's right or not.
If I put it inside a separate setup() I can't compile the sketch giving me the following error.
1.JPG


If I include it into the setup() that exists already in the sketch I can compile it.
2.JPG