OSC bridge in AP mode

Default gw ip 192.168.4.1
This commit is contained in:
philsson 2018-09-17 22:19:52 +02:00
parent e99e8e3211
commit a3a83ea6f9

View File

@ -8,14 +8,15 @@
#include <OSCBundle.h> #include <OSCBundle.h>
#include <OSCData.h> #include <OSCData.h>
char ssid[] = "FaRgO2G4"; char ssid[] = "ROBOT";
char pass[] = "Johansson85"; char pass[] = "myrobotisawesome";
WiFiUDP Udp; WiFiUDP Udp;
// remote IP (not needed for receive) // remote IP (not needed for receive)
// Will be updated once the first package is received // Will be updated once the first package is received
IPAddress outIp(192,168,1,10); // Gateway IP normally is 192.168.4.1
IPAddress outIp(192,168,4,2);
const unsigned int outPort = 9999; const unsigned int outPort = 9999;
const unsigned int localPort = 8888; const unsigned int localPort = 8888;
@ -46,12 +47,13 @@ uint8_t buffer[bufferSize];
Packet* pPacket = (Packet*)buffer; Packet* pPacket = (Packet*)buffer;
void setup() { void setup() {
WiFi.softAP(ssid, pass);
IPAddress apip = WiFi.softAPIP();
pinMode(LED_BUILTIN, OUTPUT); pinMode(LED_BUILTIN, OUTPUT);
Serial.begin(57600); Serial.begin(57600);
Serial.println(); Serial.println();
Serial.print("Connecting to "); Serial.print("AP IP: ");
Serial.println(ssid); Serial.println(apip);
WiFi.begin(ssid, pass);
Udp.begin(localPort); Udp.begin(localPort);
pPacket->MagicWordLow = 0x0DED; pPacket->MagicWordLow = 0x0DED;