Advertisement
Guest User

Untitled

a guest
Jun 27th, 2019
90
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.79 KB | None | 0 0
  1. #include <ESP8266WiFi.h>
  2. int status = WL_IDLE_STATUS;
  3.  
  4. const char* ssid = "alohaWIFI";
  5. const char* pass = "qwerty123456";
  6. const char* host = "192.168.4.1";
  7. WiFiClient client;
  8. void setup() {
  9. Serial.begin(9600);
  10. WiFi.begin(ssid,pass);
  11. Serial.print("connection to ");
  12. Serial.print(ssid);
  13. delay(500);
  14.  
  15. while(WiFi.status() != WL_CONNECTED)
  16. {
  17. delay(500);
  18. Serial.print(".");
  19. }
  20. if(client.connect(host, 1660))
  21. {
  22. Serial.print("assss");
  23. client.print("Hello! Tu Olek i Szymon\r");
  24. }
  25. else
  26. {
  27. client.print("`errrrrrrooooor!\r");
  28. }
  29. Serial.println();
  30. Serial.print("Connected!");
  31. Serial.print("SSID: ");
  32. Serial.println(WiFi.SSID());
  33. IPAddress ip = WiFi.localIP();
  34. Serial.print("IP Address: ");
  35. Serial.println(ip);
  36. }
  37. //
  38. void loop() {}
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement