Open ancabilloni opened 1 year ago
Hello, I can confirm that Arduino Portenta doesn't receive UDP multicast packets. Please fix this as soon as possible, as I need to buy a total of 10 Portenta Machine Control boards and I need them to work reliably. I'm currently testing on a Portenta Breakout board. I tested sending UDP multicast packets from a small C program, and I can always receive them from another C program and an Android app on my phone without issues. I can even send multicast packets from the Portenta, and receive them on both the PC and the phone. Receiving them on the Portenta is, however, a no-go. My Arduino and C code is pretty much equivalent to the code posted by @ancabilloni. I can share it if necessary. Regards, Marco Cipriani
Hi Marco, the issue is due to https://github.com/ARMmbed/mbed-os/issues/13233 , so STM32 emac does not implement multicast... To enable the multicast functionality you can call
#include "stm32xx_emac.h"
void set_all_multicast(bool all)
{
STM32_EMAC &emac = STM32_EMAC::get_instance();
ETH_MACFilterConfigTypeDef pFilterConfig;
if (HAL_ETH_GetMACFilterConfig(&emac.EthHandle, &pFilterConfig) != HAL_OK) {
return;
}
pFilterConfig.PassAllMulticast = all ? ENABLE : DISABLE;
HAL_ETH_SetMACFilterConfig(&emac.EthHandle, &pFilterConfig);
}
after Ethernet.begin()
.
@manchoz can we test this extensively and properly patch mbed-os before the next release?
@facchinm Yes, sure. @ancabilloni @marcocipriani01 I'll update the issue as soon as I complete the tests.
Thank you very much, the code worked first try!
Hello,
I am using Portenta H7 + vision shield, and I set up the codes to receive UDP multicast data. The codes compiled but I'm not receiving any data. Can someone help to clarify if Udp multicast is possible on Portenta H7 and vision shield? Or if I am missing something in the codes?
Arduino IDE version 1.8.19 Arduino Mbed OS Portenta Boards, version 3.5.4
Below is my codes on the Arduino as UDP Multicast Receiver, static ip: 195.0.0.92
On the UDP Multicast Sender, here is my code in Python running from my laptop, static ip 195.0.0.91
To further clarify, I could ping Portenta (195.0.0.92) from my laptop (195.0.0.91) after upload the codes to Portenta. I also verified the multicast sender working by reading multicast data from a 2nd laptop with the below Python codes: