Can an Arduino with a Wi-Fi screen send a UDP message using a multicast IP address?

I have an Arduino Uno R3 with a WiFi screen. The WiFi screen has the latest firmware (V1.1.0). In short, I'm trying to communicate with Arduino from an Android smartphone. I successfully managed to do this locally using the local IP addresses assigned by the router; however, now I want to expand this without having Android on the same network. For example, communication with Arduino from anywhere in the world on an Android device. I know that I can do this by simply going to the router configuration and configuring the port on the Arduino; however, I would like to get around this using Universal Plug and Play (UPnP). To be able to find the Internet gateway on the network, I must be able to send a UDP message using the multicast address 239.255.255.250:1900. This is where my problem arises. It seemsthat the WiFi screen is not capable of sending a UDP packet through a multicast address with the latest WiFi library. Is there a way to change the WiFi library so that it is possible?

Note. I can successfully send and receive UDP packets using unicast addresses on Arduino, just not using multicast.

In addition, there is a library that does this through the Arduino and Ethernet shield located at: https://github.com/deverick/Arduino-Upnp-PortMapping . I tried to change this library to work with the WiFi screen. I assume that the Ethernet library is capable of sending UDP packets using a multicast address, since this library does just that.

EDIT: When I said that the WiFi screen is “not capable,” I meant that since I cannot send a UDP packet using a multicast address. I do not get the errors that I know of; the code works without errors, except for the fact that it does not actually send a packet. I use the latest Wi-Fi library for Arduino on GitHub: https://github.com/arduino/Arduino/tree/master/libraries/WiFi . I just start the packet with 239.255.255.250 and port 1900, write the string to the socket, and then end the packet to send it. A packet is never transmitted. If I send a packet to my computer using its local IP address, it works like a charm. The WiFi library does not seem to support the ability to send a packet using a multicast address.

+4
1

Sketch Arduino PIC Wifly RN-XV Wifly : https://dl.dropboxusercontent.com/u/101922388/WiflySanUSB.zip : 192.168.1.195/YT, HTML-. Wifly ( 192.168.1.195/YT ) ( AD Google).

0

Source: https://habr.com/ru/post/1530749/


All Articles