ESP8266: receive and count UDP msg from two sources

Hi guys

No idea whether I am right here but I just try it . Also, I am pretty new to this topic.

I have two sensors (e.g. sensor A & B) connected to a WiFi. Both sensor send UDP msg when an object is crossing the sensors.

I would like to count continuously the UDP messages (with a ESP8266) sent from sensor A and sensor B and display it on a screen

How can I do this?

Any tips how I can start with that?

Cheers!
Georg

description of project is rather vague
do you have a display? if so give a link
what microcontrollers/WiFi are you using on sensors A and B?
how far apart are sensors A and B and the ESP8266?
you could run a UDP server of the ESP8266 - sensor A and B transmit UDU datagrams to it
alternatively consider ESP-NOW

Thanks horace!

I try to be more specific.

description of project is rather vague: I have tried to upload a picture to better understand the project but I have not (yet) found out how to do that.

do you have a display? if so give a link: I have not yet purchased the display but will do so soon. This can be quite a simple one like a 1.3inch OLED, 128x64

what microcontrollers/WiFi are you using on sensors A and B? The sensor are running on a Raspberry Pi

how far apart are sensors A and B and the ESP8266? The sensors are roughly 300m away. I have a Hotspot in the middle that creates the WiFi and the sensors are logged into this WiFi. They send the UDP msg to this Hotspot. Hence, my idea is to connect the the ESP8266 to the hotspot via WiFi and read the UDP msg out of the Hotspot. The ESP8266 will be maybe 0.5m (or less) away from the Hotspot

you could run a UDP server of the ESP8266 - sensor A and B transmit UDU datagrams to it

alternatively consider ESP-NOW

Does that help?
Georg

I assume Raspberry Pico WiFi RP2040 modules
what does the hotsport do with the UDP data?

not sure how "read the UDP msg out of the Hotspot" would work
do you have control of the hotspot? if so it could transmit UDP datagrams to the ESP8266
could you program the RPi Picos to transmit UDP datagrams directly to the ESP8266 or even use UDP multicast

The Hotspot is only creating a WiFi that goes far enough. It does nothing with the UDP msg. That's what I want to use the ESP module for (basically, I want to measure the time from UDM msg from sensor A and UDM msg from sensor B).
The Sensor are built on Raspberry Pi 3B.

if the ESP8266 connects to the hotspot and listens for UDP datagrams and the sensors RPi use UDP multicast the esp8266 should receive the datagrams

Ah...thanks! I would have assumed so. Question is more whether I can see from which sensor the msg is.

the messages from the sensor should carry something to indicate the source, e.g. value 3.1415926 from sensor 1
1:3.1415926