Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Portenta H7 UDP Multicast not working - mbed v2.4.1 #321

Closed
Zuroy opened this issue Sep 13, 2021 · 11 comments · Fixed by #337
Closed

Portenta H7 UDP Multicast not working - mbed v2.4.1 #321

Zuroy opened this issue Sep 13, 2021 · 11 comments · Fixed by #337

Comments

@Zuroy
Copy link

Zuroy commented Sep 13, 2021

UDP Multicast is still not working in this version.

@facchinm
Copy link
Member

Hi @Zuroy,
does it fail to compile or "simply" doesn't work?
Can you provide the code you are using?
Thanks

@Zuroy
Copy link
Author

Zuroy commented Sep 13, 2021

I'm trying to use the MDNS_generic Library which uses UDP Multicast. The code il correctly compiled but it does not work.
I wrote to the arduino support team and the said that UDP multicast is not supported yet..

@facchinm
Copy link
Member

AFAIU MDNS_generic doesn't work out of the box for the Portenta since it requires WiFiNINA_generic ; did you patch it somehow?

@Zuroy
Copy link
Author

Zuroy commented Sep 13, 2021

Nope. since I'm using the ethernet connection. Do you have any suggestion?

khoih-prog added a commit to khoih-prog/MDNS_Generic that referenced this issue Sep 13, 2021
### Releases v1.3.0-beta1

1. Add support to Portenta_H7, using WiFi or Ethernet. **Still not working**, just for preliminary tests. Check 

1.1 [**Portenta H7 UDP Multicast not working - mbed v2.4.1** #321](arduino/ArduinoCore-mbed#321)
1.2 [**Portenta H7 MDNS Library compatibility** #4](#4)

for latest situation.
khoih-prog added a commit to khoih-prog/MDNS_Generic that referenced this issue Sep 13, 2021
### Releases v1.3.0-beta1

1. Add support to Portenta_H7, using WiFi or Ethernet. **Still not working**, just for preliminary tests. Check 

* 1.1 [**Portenta H7 UDP Multicast not working - mbed v2.4.1** #321](arduino/ArduinoCore-mbed#321)
* 1.2 [**Portenta H7 MDNS Library compatibility** #4](#4)

for latest situation.
khoih-prog added a commit to khoih-prog/MDNS_Generic that referenced this issue Sep 13, 2021
### Releases v1.3.0-beta1

1. Add support to Portenta_H7, using WiFi or Ethernet. **Still not working**, just for preliminary tests. Check 

* 1.1 [**Portenta H7 UDP Multicast not working - mbed v2.4.1** #321](arduino/ArduinoCore-mbed#321)
* 1.2 [**Portenta H7 MDNS Library compatibility** #4](#4)

for latest situation.
@khoih-prog
Copy link

@facchinm

You can test by using the latest MDNS_Generic releases v1.3.0-beta1 for Portenta_H7, either Ethernet or WiFi.

  • For WiFi, please use examples in WiFi
  • For Ethernet, please use examples in Ethernet

Thanks for looking at this issue,

Best Regards,

@khoih-prog
Copy link

Already try with ArduinoCore-mbed mbed_portenta core from v2.0.0 up to v2.4.1 without success, with or without the patches in Portenta_Patches.

The Patches are copied / modified from this core's PR WiFi UDP & Multicast Functionality #14

@Zuroy
Copy link
Author

Zuroy commented Sep 27, 2021

Do you have any news? I'm trying to rewrite the C code but I'm stuck on the phy configuration.

@facchinm
Copy link
Member

We allocated some time to look for a fix in our backlog, hope it will be fixed by the next core release 🙂

@Zuroy
Copy link
Author

Zuroy commented Sep 28, 2021

We allocated some time to look for a fix in our backlog, hope it will be fixed by the next core release 🙂

Thank you very much!

@facchinm
Copy link
Member

@Zuroy @khoih-prog I pushed #337 , tested it with Portenta, ArduinoMDNS and WiFi and it works fine 🎉
On Ethernet, these lines should be added to the sketch after Ethernet.begin() (I'll integrate them in the next core revision)

  STM32_EMAC &emac = STM32_EMAC::get_instance();

  ETH_MACFilterConfigTypeDef pFilterConfig;
  HAL_ETH_GetMACFilterConfig(&emac.EthHandle, &pFilterConfig);
  pFilterConfig.PassAllMulticast = ENABLE;
  HAL_ETH_SetMACFilterConfig(&emac.EthHandle, &pFilterConfig);

@manchoz @pennam

@khoih-prog
Copy link

Hi @facchinm , @Zuroy , @pennam , @manchoz

I've just tested and confirmed the PR SocketWrapper: UDP: send packet on endPacket(), not on write() #337 fixes the UDP Multicast issue.

Many thanks for the beautiful fix

BR,


Test Results

  1. Using Portenta_H7 WiFi

1.1 Terminal output

Start WiFiRegisteringServices on PORTENTA_H7_M7
MDNS_Generic v1.3.0-b1
Attempting to connect to SSID: HueNet1
SSID: HueNet1
Local IP address: 192.168.2.94
Signal strength (RSSI):-35 dBm
Registering mDNS hostname: portenta-h7-m7
To access, using portenta-h7-m7.local
[MDNS] ::begin: UDP beginMulticast statusCode= OK
[MDNS] ::_sendMDNSMessage: xid= 0
[MDNS] ::_sendMDNSMessage: queryCount= 0
[MDNS] ::_sendMDNSMessage: answerCount= 1024
[MDNS] ::_sendMDNSMessage: authorityCount= 0
[MDNS] ::_sendMDNSMessage: additionalCount= 256
[MDNS] ::_sendMDNSMessage: statusCode = 1

1.2 Ping using mDNS hostname => OK

kh@kh-Inspiron-3593:~$ ping portenta-h7-m7.local
PING portenta-h7-m7.local (192.168.2.94) 56(84) bytes of data.
64 bytes from 192.168.2.94 (192.168.2.94): icmp_seq=1 ttl=255 time=49.4 ms
64 bytes from 192.168.2.94 (192.168.2.94): icmp_seq=2 ttl=255 time=153 ms
64 bytes from 192.168.2.94 (192.168.2.94): icmp_seq=3 ttl=255 time=73.4 ms
64 bytes from 192.168.2.94 (192.168.2.94): icmp_seq=4 ttl=255 time=95.7 ms
64 bytes from 192.168.2.94 (192.168.2.94): icmp_seq=5 ttl=255 time=119 ms
64 bytes from 192.168.2.94 (192.168.2.94): icmp_seq=6 ttl=255 time=22.0 ms
64 bytes from 192.168.2.94 (192.168.2.94): icmp_seq=7 ttl=255 time=30.4 ms
64 bytes from 192.168.2.94 (192.168.2.94): icmp_seq=8 ttl=255 time=47.7 m
  1. Using Portenta_H7 Ethernet

2.1 Terminal output

Start RegisteringServices on PORTENTA_H7_M7 using Ethernet using Portenta_Ethernet Library
MDNS_Generic v1.3.0-b1
=========================
Default SPI pinout:
MOSI:8
MISO:10
SCK:9
SS:7
=========================
[MDNS] Board : PORTENTA_H7_M7 , setCsPin: 10
=========================
Currently Used SPI pinout:
MOSI:8
MISO:10
SCK:9
SS:7
=========================
Using mac index = 11
Connected! IP address: 192.168.2.87
Registering mDNS hostname: portenta-h7-m7-15
To access, using portenta-h7-m7-11.local
[MDNS] ::begin: UDP beginMulticast statusCode= OK
AddService : PORTENTA_H7_M7_mDNS_Webserver._http
[MDNS] ::_sendMDNSMessage: xid= 0
[MDNS] ::_sendMDNSMessage: queryCount= 0
[MDNS] ::_sendMDNSMessage: answerCount= 1024
[MDNS] ::_sendMDNSMessage: authorityCount= 0
[MDNS] ::_sendMDNSMessage: additionalCount= 256
[MDNS] ::_sendMDNSMessage: statusCode = 1

2.2 Ping using mDNS hostname => OK

kh@kh-Inspiron-3593:~$ ping portenta-h7-m7-15.local
PING portenta-h7-m7-15.local (192.168.2.87) 56(84) bytes of data.
64 bytes from 192.168.2.87 (192.168.2.87): icmp_seq=1 ttl=255 time=0.964 ms
64 bytes from 192.168.2.87 (192.168.2.87): icmp_seq=2 ttl=255 time=0.216 ms
64 bytes from 192.168.2.87 (192.168.2.87): icmp_seq=3 ttl=255 time=1.07 ms
64 bytes from 192.168.2.87 (192.168.2.87): icmp_seq=4 ttl=255 time=4.40 ms
64 bytes from 192.168.2.87 (192.168.2.87): icmp_seq=5 ttl=255 time=0.314 ms
64 bytes from 192.168.2.87 (192.168.2.87): icmp_seq=6 ttl=255 time=0.635 ms
64 bytes from 192.168.2.87 (192.168.2.87): icmp_seq=7 ttl=255 time=0.996 ms
64 bytes from 192.168.2.87 (192.168.2.87): icmp_seq=8 ttl=255 time=4.47 ms

khoih-prog added a commit to khoih-prog/MDNS_Generic that referenced this issue Sep 28, 2021
Check [SocketWrapper: UDP: send packet on endPacket(), not on write() #337](arduino/ArduinoCore-mbed#337) and [Portenta H7 UDP Multicast not working - mbed v2.4.1 #321](arduino/ArduinoCore-mbed#321).

To be used temporarily until the PR included into new core
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants