Basic functions

wifi.on(baudrate)
Turns on the WIFI-module

Example:

wifi.on(115200);

wifi.off()
Turns off the WIFI-module

Example:

wifi.off();

wifi.restart()
Restarts the WIFI-module

Example:

wifi.restart();

wifi.info()
Returns a Version information of the WIFI-module as String

Example:
This code prints the Version info to the USB-Terminal


#include "wino.h"

void setup() {
wifi.on();
SerialUSB.begin(115200);
}

void loop() {
delay(2000);
SerialUSB.println(wifi.info());
}

wifi.wait(timeout)
Waits until module is connected and TCP-address is received

timeout = timeout to wait in milliseconds

Example:
The module starts and waits until it is connected


#include "wino.h"

void setup() {
SerialUSB.begin(115200);
wifi.on();
  if (wifi.wait(15000)) {
  SerialUSB.println("WIFI is connected");
  } else {
  SerialUSB.println("could not connect to WIFI");
  }
}
void loop() {
}

wifi.sleepmode(mode)
Sets the module in sleep mode to save energy
mode = 0 -> disable sleep mode
mode = 1 -> light sleep mode
mode = 2 -> normal sleep mode

Example:

wifi.sleepmode(2);

wifi.sleep(time)
Turns the WIFI-module into deepsleep for a certain time (no WIFI connection available in this time)
time -> time in milliseconds (e.g. use 1000 for 1 second)

Example:

wifi.sleep(1000);

wifi.getStatus()
Returns the current connection status as boolean

true = Module is ready
false = no response

Example:
This code prints the Status of the WIFI-module to the USB-Terminal


#include "wino.h"

void setup() {
wifi.on();
SerialUSB.begin(115200);
}

void loop() {
delay(2000);
  if (wifi.getStatus()) {
    SerialUSB.println("Module is ready");
  } else {
    SerialUSB.println("Module is not responding");
  }
}