Chat here is you are connecting ESP-xx type modules to existing AVR based Arduino

Moderator: igrr

User avatar
By dominator99
#50085 Below is my output over the serial port from your 'MyAPClient' sketch running on my client Huzzah

The only change to your 'MyAPServer' sketch running on my server Huzzah was changing int led = 16 to int led = 2 (GPIO2 on my Adafruit Huzzah) to flash the blue onboard led.

When both 'Huzzahs' are running the blue led on the server (AP) flashes for an extended period, then stops flashing for a short period then turns off for a short period then the whole process repeats.

I can't work out why!
Can you help?

Connecting to MyESPAP
.......................................................
WiFi connected
IP address:
192.168.4.2
connecting to 192.168.4.1
connected
Requesting URL: /frate
HTTP/1.1 404 Not Found
Content-Type: text/plain
Content-Length: 18
Connection: close
Access-Control-Allow-Origin: *

Not found: /search
closing connection
connecting to 192.168.4.1
connected
Requesting URL: /srate
HTTP/1.1 404 Not Found
Content-Type: text/plain
Content-Length: 18
Connection: close
Access-Control-Allow-Origin: *

Not found: /search
closing connection
connecting to 192.168.4.1
connected
Requesting URL: /frate
HTTP/1.1 404 Not Found
Content-Type: text/plain
Content-Length: 18
Connection: close
Access-Control-Allow-Origin: *

Forget the above; I just re-downloaded your original sketch and all now seems OK
User avatar
By dominator99
#50874 Altered text to make myself clearer

I've been running 3 'clients' (STA) using UDP successfully, connected to my Arduino Mega2560 Access Point (AP) but have noticed that the IP addresses allocated to each client do not remain the same at every boot of the sytem. The first client to connect is allocated the first IP address of 192.168.4.2, the second client to connect is allocated IP address 192.168.4.3 & so on.
The problem is that on booting the system the first client to connect is not always client1

Is there a way to set a static UDP IP address for each of the clients so regardless of which client connects first the IP address remains associated with the same client ie client1 always has the same IP address of 192.168.4.2, client2 always has the same IP address of 192.168.4.3 etc?

ps I'm not interested in an internet (IoT) connection just sending data over my local WLAN

The access point IP address stays the same at 192.168.4.1

I hope this makes sense!