Contents

Add Network



To use network-based connections, such as Server or Cloud, RemoteXY requires creating a network management object called RemoteXYNet. This object manages the network connection. Later, when assigning a communication method to a graphical interface, you must specify this network management object.

The network object is also used to obtain real-time data from the Internet and to send push notifications.

Some networks are managed by standard Arduino IDE libraries. You can use any devices supported by these libraries. The corresponding standard library must be included before including the remotexy.h library.

Example:

#include <Ethernet.h> #include <RemoteXY.h> void setup() { RemoteXYNet * net = new CRemoteXYNet_Ethernet (); RemoteXYGui * gui = RemoteXYEngine.addGui (RemoteXY_CONF_PROGMEM, &RemoteXY); gui->addConnectionServer (net, 6377); // port }

Ethernet.h Library

RemoteXYNet * net = new CRemoteXYNet_Ethernet ();

RemoteXYNet * net = new CRemoteXYNet_Ethernet (char * macAddress);

WiFi.h Library for Connecting to a Wi-Fi Network

RemoteXYNet * net = new CRemoteXYNet_WiFi (ssid, password);

ssid — the name of the access point to connect to;

password — the password for the access point.

WiFi.h Library in Access Point Mode

RemoteXYNet * net = new CRemoteXYNet_WiFiPoint (ssid, password);

ssid — the name of the access point being created;

password — the password for connecting to the access point (must be at least 8 characters, or an empty string for an open network).

ESP8266 as an AT Modem for Connecting to a Wi-Fi Network

RemoteXYNet * net = new CRemoteXYNet_ModemESP8266 (stream, ssid, password);

stream — an object of type CRemoteXYStream used to communicate with the ESP8266;

ssid — the name of the access point to connect to;

password — the password for the access point.

ESP8266 as an AT Modem in Access Point Mode

RemoteXYNet * net = new CRemoteXYNet_ModemESP8266Point (stream, ssid, password);

stream — an object of type CRemoteXYStream used to communicate with the ESP8266;

ssid — the name of the access point being created;

password — the password for connecting to the access point (must be at least 8 characters, or an empty string for an open network).