Forum > Networking and Web Programming

listen broadcast message

<< < (2/3) > >>

ProfHarry:

--- Quote from: Thaddy on June 05, 2024, 08:25:47 am ---It depends on you having control over the software from the esp32's.
--- End quote ---

I have several ESP32s doing measurements and I have a control of their code but :
- they connect via DHCP to the wifi network
- I don't know their IP (no access to the DHCP server)
- they have no way of displaying their IP addresses (no LCD or other display)
- I need their IP to access their web servers to display the measurements taken.

The solution I have come up with is to regularly broadcast the name and IP of each ESP32. The lazarus application will be used to locate them and indicate the addresses of each of them.

ProfHarry:

--- Quote from: MarkMLl on June 05, 2024, 09:04:33 am ---Note that UDP broadcasts are generally discarded by routers.

--- End quote ---

This is a Wi-Fi network in a school. The lazarus application is on a laptop on the same network as the ESP32s, so it should work.  Fingers crossed ;-)

MarkMLl:

--- Quote from: ProfHarry on June 05, 2024, 11:58:46 am ---
--- Quote from: MarkMLl on June 05, 2024, 09:04:33 am ---Note that UDP broadcasts are generally discarded by routers.

--- End quote ---

This is a Wi-Fi network in a school. The lazarus application is on a laptop on the same network as the ESP32s, so it should work.  Fingers crossed ;-)

--- End quote ---

Yes, but in many cases an access point will behave more like a router rather than like a switch.

MarkMLl

marcov:
I do the same with my electronics boards.  They have fixed IP, but I broadcast for other reasons (no need to configure destination IP and sending packets to multiple PCs would require an extra operation to set it)

Originally I used a simple UDP listener based on the Indy10 udp client demo to capture them, so that could be a start. If it doesn't work, try to temporarily disable the firewall.

ProfHarry:

--- Quote from: marcov on June 05, 2024, 12:18:39 pm ---Originally I used a simple UDP listener based on the Indy10 udp client demo to capture them, so that could be a start.
--- End quote ---

Thanks, I'll have a look too.

Navigation

[0] Message Index

[#] Next page

[*] Previous page

Go to full version