Closed DrBit closed 1 year ago
I have the same issue
Hey, I'd like to bump this issue as well... it seems to work fine when running as regular wifi client, it doesn't seem to receive or send anything when running as WIFI_AP/softAP. Using an ESP32 Wroom module.
Hi there
I've encountered a problem with the library
I'm using ESP8266 as an access point so another ESP8266 can conect to it. When using ESP8266 as AP turns out it does not transmit any artnet data. Same exaple works perfect as wifi client.
here my code to test:
include
include
include
ifndef APSSID
define APSSID "ESPap"
define APPSK "thereisnospoon"
endif
/ Set these to your desired credentials. / const char ssid = APSSID; const char password = APPSK;
// Please include ArtnetWiFi.h to use Artnet on the platform // which can use both WiFi and Ethernet
include
// this is also valid for other platforms which can use only WiFi // #include
// WiFi stuff const IPAddress ip(192, 168, 2, 2); const IPAddress gateway(192, 168, 2, 1); const IPAddress subnet(255, 255, 255, 0);
ArtnetWiFiSender artnet; const String target_ip = "192.168.4.2"; uint32_t universe = 1;
const uint16_t size = 512; uint8_t data[size]; uint8_t value = 0;
void setup() { Serial.begin(115200); Serial.println("\nArtnet serial test started");
}
void setup_ap() { Serial.print("Setting soft-AP configuration ... "); Serial.println(WiFi.softAPConfig(ip, gateway, subnet) ? "Ready" : "Failed!");
Serial.print("Setting soft-AP ... "); Serial.println(WiFi.softAP(ssid, password) ? "Ready" : "Failed!");
Serial.print("Soft-AP IP address = "); Serial.println(WiFi.softAPIP()); }
void loop() { loop_ap_info();
}
int lastStationsConected = -1; elapsedMillis checkClientsTimer; elapsedMillis ledToggleTimer;
void loop_ap_info() { if (checkClientsTimer > 1500) { checkClientsTimer = 0; int newStationsConnected = WiFi.softAPgetStationNum(); if (lastStationsConected != newStationsConnected) { lastStationsConected = newStationsConnected; Serial.printf("Stations connected to soft-AP = %d\n", newStationsConnected); } }
}
void toggleLed (int pinLedToToggle) { digitalWrite (pinLedToToggle, !digitalRead(pinLedToToggle)); }