---
title: "[WIZ750SR] Multicast problem"
url: "https://maker.wiznet.io/forum/13483"
markdown_url: "https://maker.wiznet.io/forum/13483/md"
type: "Forum topic"
category: "Serial-to-Ethernet & ConfigTool"
author: "looki"
created: "2019-09-17T15:03:37+09:00"
last_activity: "2019-11-27T14:18:53+09:00"
language: "en"
views: 1164
replies: 13
source: "WIZnet Makers forum (https://maker.wiznet.io/forum/)"
---

# [WIZ750SR] Multicast problem

## Question

Asked by looki on 2019-09-17 in Serial-to-Ethernet & ConfigTool.

Hi,

I am working with Wiz750SR (firmware version: 1.2.4).
Could you share some information about sending multicast UDP packets from WIZ750SR?

I tried the following, but it did not work:
Operation mode: UDP
Local IP: 192.168.11.11
Subnet mask: 255.255.255.0
Remote host: 239.1.1.11

If I change the remote host to 192.168.11.3 (unicast) it works, but I would need multicast support.

Thanks

## Replies

### Reply 1 by becky, 2019-09-18

The WIZ750SR firmware does not support multicast.
For multicast communication, you must set Multicast IP and port in Destination IP and port and set Sn_MR [7] = 1 before opening socket.

So I prepared a bin file for you.
I added multicast configuration to v1.2.4 firmware as shown below.

[W7500x_S2E_App_1.2.4_multicast.bin](https://maker.wiznet.io/forum/legacyFile.asp?path=rHlpLxsAquBhSpGVe4Lr6jnx3mZ.bin) (41.1 KB)

[![image](https://maker.wiznet.io/forum_uploads/wiznet/original/2X/f/fde470ebacf883d4c72405017e70d1ffe04a8bc0.png) image716×511 7.47 KB](https://maker.wiznet.io/forum_uploads/wiznet/original/2X/f/fde470ebacf883d4c72405017e70d1ffe04a8bc0.png)

This can be modified from the link below.

[github.com](https://github.com/Wiznet/WIZ750SR/blob/master/Projects/S2E_App/src/Serial_to_Ethernet/seg.c)

#### [Wiznet/WIZ750SR/blob/master/Projects/S2E_App/src/Serial_to_Ethernet/seg.c](https://github.com/Wiznet/WIZ750SR/blob/master/Projects/S2E_App/src/Serial_to_Ethernet/seg.c)

```
#include <string.h>
#include "common.h"
#include "W7500x_wztoe.h"
#include "W7500x_gpio.h"
#include "W7500x_board.h"
#include "socket.h"
#include "seg.h"
#include "timerHandler.h"
#include "uartHandler.h"
#include "gpioHandler.h"

/* Private define ------------------------------------------------------------*/
// Ring Buffer
BUFFER_DECLARATION(data_rx);

/* Private variables ---------------------------------------------------------*/
uint8_t flag_s2e_application_running = 0;

uint8_t opmode = DEVICE_GW_MODE;
static uint8_t mixed_state = MIXED_SERVER;
```

This file has been truncated. [show original](https://github.com/Wiznet/WIZ750SR/blob/master/Projects/S2E_App/src/Serial_to_Ethernet/seg.c)

### Reply 2 by looki, 2019-09-18

Thanks for the fast response!
I made a quick test and it looks like it works.

On the firmware I guess I should check if the destination IP is a multicast IP and only then apply the changes you made (so that a unicast IP still works).

### Reply 3 by becky, 2019-09-19 (in reply to reply 2)

I updated the firmware version to v1.2.5.
You can download bin file on github.
It check if the destination IP is a multicast IP as you say.

![](https://github.githubassets.com/favicons/favicon.svg) [GitHub](https://github.com/Wiznet/WIZ750SR)

![](https://maker.wiznet.io/forum_uploads/wiznet/original/2X/7/70bca430ecd249ead35d3e1dfb8d6ac08179b372.png)

### [GitHub - Wiznet/WIZ750SR: WIZnet Serial to Ethernet(S2E) module based on...](https://github.com/Wiznet/WIZ750SR)

WIZnet Serial to Ethernet(S2E) module based on W7500 chip, WIZ107/108SR S2E compatible device - GitHub - Wiznet/WIZ750SR: WIZnet Serial to Ethernet(S2E) module based on W7500 chip, WIZ107/108SR S2E...

Thank you for your opinion

### Reply 4 by looki, 2019-11-19

Hi Becky,

I finally had some time to test the new multicast feature, but had some problems if working with two or more devices (wiznet module + serial device). The problem is that each device receives the outgoing traffic of all other devices, i.e. not only the remote host (linux machine) which joins the multicast group receives the udp packets, but all other devices too.

What I’m trying to achieve:
Each device sends Uart-Udp data to multicast IP address.
Each device listens for Uart-Udp data using local IP address and NOT joining multicast group.

Example configuration:
Device A:

- Operation mode: UDP

- Local IP: 192.168.11.11

- Subnet mask: 255.255.255.0

- Remote host: 239.1.1.11

Device B:

- Operation mode: UDP

- Local IP: 192.168.11.12

- Subnet mask: 255.255.255.0

- Remote host: 239.1.1.11

Remote host:

- Local IP: 192.168.11.100

- Opens Udp Multicast socket and joins multicast group at 239.1.1.11

- Sends data to device A and B using their local IP addresses (192.168.11.11 and 192.168.11.12)

I hope you can help me with this matter.

Best,
Lukas

### Reply 5 by becky, 2019-11-21 (in reply to reply 4)

Is device A and deviceB WIZ750SR and Server is Linux?
In multicast socket, WIZ750SR can receive unicast data, but can not send to unicast address.
WIZ750SR in default setting receive unicast data in multicast mode.

![](https://avatars.discourse-cdn.com/v4/letter/l/6a8cbe/48.png) looki:

> Remote host:

So it is not WIZ750SR, the actions you said are possible without modification.

### Reply 6 by looki, 2019-11-21

becky:

> Is device A and deviceB WIZ750SR and Server is Linux?

Yes.

becky:

> So it is not WIZ750SR, the actions you said are possible without modification.

In multicast socket, I want that WIZ750SR sends data to multicast IP and ONLY receives data on local unicast IP. I do not want that WIZ750SR receives multicast data.

The problem is, that WIZ750SR joins the multicast group and therefore receives multicast data sent from other WIZ750SR modules.

I used Wireshark to analyse the network traffic and saw that each WIZ750SR joins the multicast group and sends IGMPv2 Membership Report messages.

Is it possible to use multicast socket without joining the multicast group?

### Reply 7 by becky, 2019-11-22

Unfortunately there is no function to block multicast packets in multicast mode.
If not, it seems that you have to open and close a socket every time you send data to a multicast group.

EX)

1. Unicast socket open

2. unicast socket close-multicast socket open-data send-multicast socket close-unicast socket open

Seems to have to repeat.

In this case, an IGMP leave packet is sent whenever the socket is closed.
is it OK?

### Reply 8 by looki, 2019-11-22

I’m afraid that is not possible for my use case.

1. What about using only unicast socket but sending to a multicast IP?

2. What about using multicast socket but not joining multicast group?

Anyway, thanks for your help and fast replies.

### Reply 9 by becky, 2019-11-25

![](https://avatars.discourse-cdn.com/v4/letter/l/6a8cbe/48.png) looki:

> What about using only unicast socket but sending to a multicast IP?

It is possible, but Multicast join packet is not transmitted.
I tested it like this:
192.168.0.5 is W7500, open socket with Unicast, and send data to multicast address when receiving data.

1.Transfer data to 192.168.0.5 via Hercules
2. The W7500 receives the data and sends it to 234.5.6.7 (multicast).
3. Check the data sent by the W7500 with the Multicast Test Tool Receiver.
The Multicast Test Tool I used received the data the W7500 sent without a join packet. I think you should check this on your Server.

[![image](https://maker.wiznet.io/forum_uploads/wiznet/original/2X/e/ea317f28fe7496454ef89f8a23ca20cf43744c73.png) image622×620 11.6 KB](https://maker.wiznet.io/forum_uploads/wiznet/original/2X/e/ea317f28fe7496454ef89f8a23ca20cf43744c73.png)

[![image](https://maker.wiznet.io/forum_uploads/wiznet/original/2X/0/0c162d2898c519e73611c5340dfce25e699a266b.png) image769×191 12.2 KB](https://maker.wiznet.io/forum_uploads/wiznet/original/2X/0/0c162d2898c519e73611c5340dfce25e699a266b.png)

[![image](https://maker.wiznet.io/forum_uploads/wiznet/original/2X/3/3d9bd666891b214c3f6be10a92654fbaec99e669.png) image728×748 13.9 KB](https://maker.wiznet.io/forum_uploads/wiznet/original/2X/3/3d9bd666891b214c3f6be10a92654fbaec99e669.png)

### Reply 10 by looki, 2019-11-25

I think this is exactly what I am looking for!

I tested this with WIZ750SR firmware version 1.2.4 but could not get any output, i.e. WIZ750SR did not send any multicast packet (I checked with Wireshark and had an UDP multicast socket join the multicast group).

Could you tell me your exact configuration (port, subnet, …)? And did you use a different firmware version?

Thanks again

### Reply 11 by becky, 2019-11-26

I use DHCP funcion but you should add code to send data to multicast mac address.
So i used mac send command because sendto() in ioLibrary use send command.
I attach the modified bin file and modified project .
[W7500x_S2E_App.bin](https://maker.wiznet.io/forum/legacyFile.asp?path=agKqOaPFzKKXt7sjzfWvvBd3E0J.bin) (99.9 KB)
[WIZ750SR-forlooki.zip](https://maker.wiznet.io/forum/legacyFile.asp?path=bOKInkHexk1jYmfvN4sCpM2Mp9d.zip) (2.6 MB)

I commented “for looki” on the edit. This is in the seg.c.
please check it.

[![image](https://maker.wiznet.io/forum_uploads/wiznet/original/2X/f/f8d7f26aa95a5b013cf45f93e5b3d86e8b49011f.png) image794×378 8.68 KB](https://maker.wiznet.io/forum_uploads/wiznet/original/2X/f/f8d7f26aa95a5b013cf45f93e5b3d86e8b49011f.png)

![image](https://maker.wiznet.io/forum_uploads/wiznet/original/2X/c/c581b580dac5e79eacd817c7d9b5b7d73c0ba2bd.png)

### Reply 12 by looki, 2019-11-26

Hi Becky,

I tested the modified firmware and it worked ![:slight_smile:](https://emoji.discourse-cdn.com/twitter/slight_smile.png?v=12)

One (hopefully) last request: Would it be possible to add an if/else statement to check if the remote IP is unicast or multicast and only apply this modifications if remote IP is multicast?

- if remote IP is multicast: use the modifications you made

- if remote IP is unicast: use sendto() as in previous firmware version

Again, thanks a lot for your help and fast responses!

### Reply 13 by becky, 2019-11-26 (in reply to reply 12)

Here are that.![:grinning:](https://emoji.discourse-cdn.com/twitter/grinning.png?v=12)
It’s good that it helped.

[W7500x_S2E_App.bin](https://maker.wiznet.io/forum/legacyFile.asp?path=hpb4LaBLytfkenulXhwilp0Ppj5.bin) (99.9 KB)

[![image](https://maker.wiznet.io/forum_uploads/wiznet/original/2X/f/fa8fdd7b4b05803a282183405dda6ff2720d5008.png) image899×412 22.1 KB](https://maker.wiznet.io/forum_uploads/wiznet/original/2X/f/fa8fdd7b4b05803a282183405dda6ff2720d5008.png)

---

Source: https://maker.wiznet.io/forum/13483
