Urgent help needed on UDP multicasting

Hi,

Greetings!

I am using Arduino + ESP8266 ESP-WROOM-02D WiFi module.
Here I wish to multicast UDP packet and also wish receive back the transmitted packet.
As per this packet is sent successfully but it does not get received back on ESP-WROOM-02D.
However if I sends packets from computer then it get received perfectly.

Below are the steps which I am folliwng (please note that I have given only UDP related code, rest of the things I have already taken care)

#include <WiFiUdp.h>
#include <ESP8266WiFi.h>

#define receivePort   9760ul
#define txDestPort    9760ul

static WiFiUDP udpRxSocket;
char txBuf[100ul] = {'1', '2', '3', '4', '5', '1', '2', '3', '4', '5', '1', '2', '3', '4', '5', '1', '2', '3', '4', '5'};
char buf[100ul];

void setup() {
  // WiFi Setup
  WiFi.begin("testSSID", "");
  // put your setup code here, to run once:
  // UDP Receive
  udpRxSocket.begin(receivePort);
}

void loop() {
  // put your main code here, to run repeatedly:
  WiFiUDP udpTxSocket;

  // UDP Multicast
  IPAddress multicastIP((WiFi.localIP() | (~WiFi.subnetMask()));
  udpTxSocket.begin(multicastIP, txDestPort);
  udpTxSocket.write(txBuf, 20ul);
  udpTxSocket.endPacket();

  if (udpRxSocket.parsePacket())
  {
    // Data received
    udpRxSocket.read(buf, 100ul);
  }
  delay(3000ul);
}

Anyone please help me out.
Any help is highly appriciated, thanks in advance

Regards,

Dinesh

"Urgent" implies that you want your question answered before other people who were in the queue before you. That's not nice.

Have you figured out how to do UDP multicasting from a program on your PC (i.e. without any ESP8266)? There will likely be far more online help for that. And when you know how to do it on a PC it should be straightforward to apply it on an ESP8266.

...R

dinesh4761:
Here I wish to multicast UDP packet and also wish receive back the transmitted packet.

Sent packets are never received by the sender, unless you are running token-ring.

Why would you want to get a copy of data you have sent?

Whandall:
Sent packets are never received by the sender, unless you are running token-ring.

Why would you want to get a copy of data you have sent?

I need those packets just to consider them as feedback, nothing else.

BTW it’s OK, I think UDP is not suitable for my application due data loss, so I might move to connection oriented protocols :slight_smile:

dinesh4761:
BTW it's OK, I think UDP is not suitable for my application due data loss, so I might move to connection oriented protocols :slight_smile:

Which by design don't have any multicasts/broadcast.