Documentation - Improvement - WiFiSubnetMask

possibly the code fragment associated with the example should be amended.


Might read


or similar as the code does not actually output the ‘subnet’ obtained from the WiFi.subnetMask(); call.
Some formatting may be required.

Complete code fragment is shown below, there is only one Serial.println();

Web page retrieved from:

#include <WiFi.h>
int status = WL_IDLE_STATUS; // the Wifi radio’s status

//SSID of your network
char ssid = “yourNetwork”;
//password of your WPA Network
char pass = “secretPassword”;

IPAddress ip;
IPAddress subnet;
IPAddress gateway;

void setup()
WiFi.begin(ssid, pass);

if ( status != WL_CONNECTED) {
Serial.println(“Couldn’t get a wifi connection”);
// if you are connected, print out info about the connection:
else {

// print your subnet mask:
subnet = WiFi.subnetMask();
Serial.print("NETMASK: ");


void loop () {

Reported to the issue tracker at:

Thanks for pointing this issue out!

The example code has now been fixed. Thanks Conseils!