Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR C

cannot reach esp8266 via udp while he is running with a static ip

#include <ESP8266WiFi.h>
#include <WiFiUdp.h>

IPAddress ip_ap(192, 168, 1, 123);
IPAddress gw_ap(192, 168, 1, 1);
IPAddress sn_ap(255, 255, 255, 0);
WiFiUDP udp;

void setup() {
	Serial1.begin(921600);
	WiFi.softAPConfig(ip_ap, gw_ap, sn_ap);
	WiFi.softAP("testtest", "testtest");
}

void loop() {
	delay(1000);
	udp.beginPacket(IPAddress(192, 168, 1, 255), 2424);
	udp.print("TEST TEST");
	udp.endPacket();
}
Source by github.com #
 
PREVIOUS NEXT
Tagged: #reach #udp #running #static #ip
ADD COMMENT
Topic
Name
4+2 =