Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <ESP8266WiFi.h>
- #include <WiFiClient.h>
- #include <ESP8266WebServer.h>
- // config:
- const char *ssid = "ESPWifiTeszt"; // You will connect your phone to this Access Point
- const char *pw = "nincs"; // and this is the password
- IPAddress ip(192, 168, 1, 10); // From RoboRemo app, connect to this IP
- IPAddress netmask(255, 255, 255, 0);
- const int port = 4000; // and this port
- ESP8266WebServer server(80);
- WiFiClient client;
- void handleRoot() {
- server.send(200, "text/html", "<h1>You are connected</h1>");
- }
- void setup() {
- Serial.begin(115200);
- WiFi.softAPConfig(ip, ip, netmask); // configure ip address for softAP
- WiFi.softAP(ssid, pw); // configure ssid and password for softAP
- Serial.println("ESP8266 RC receiver 1.1 powered by RoboRemo");
- Serial.println((String)"SSID: " + ssid + " PASS: " + pw);
- Serial.println((String)"RoboRemo app must connect to " + ip.toString() + ":" + port);
- server.on("/", handleRoot);
- server.begin();
- Serial.println("HTTP server started");
- }
- void loop() {
- server.handleClient();
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement