Can UDP socket support multicast using AT commands?

ftdiyun
Posts: 25
Joined: Tue Jul 19, 2016 5:32 pm

Can UDP socket support multicast using AT commands?

Postby ftdiyun » Wed Jul 20, 2016 2:35 pm

Thanks

pratik

Re: Can UDP socket support multicast using AT commands?

Postby pratik » Thu Jul 21, 2016 12:19 pm

Yes, it does.
If you have many devices listening to the same post, you can send a packet to the UDP broadcast address (instead of a particular device), which will be broadcast to all the other devices that are listening.
The broadcast address is the last host address within the range defined by the subnet mask.

ftdiyun
Posts: 25
Joined: Tue Jul 19, 2016 5:32 pm

Re: Can UDP socket support multicast using AT commands?

Postby ftdiyun » Fri Jul 22, 2016 11:23 am

Hi Pratik,
Thanks for your reply. Can you share an example using the AT commands for UDP multicast? Thanks.

akouz
Posts: 27
Joined: Tue May 10, 2016 1:10 pm

Re: Can UDP socket support multicast using AT commands?

Postby akouz » Fri Jul 22, 2016 11:38 am

  • AT+CIPSTART=4,"UDP","192.168.1.255",1300,1300,2 - command to module: open connection 4, UDP, broadcast address, port 1300, time-out 2 sec
  • 4,CONNECT
    OK
    - module replies
  • AT+CIPSEND=4,16 - command to module: connection 4, 16 bytes to send
  • OK
    >
    - module is ready to read data
  • send 16 bytes of data
  • Recv 16 bytes
    SEND OK
    - module replies
  • AT+CIPCLOSE=4 - command to module: close connection 4
  • 4,CLOSED
    OK
    - module replies

ftdiyun
Posts: 25
Joined: Tue Jul 19, 2016 5:32 pm

Re: Can UDP socket support multicast using AT commands?

Postby ftdiyun » Mon Aug 08, 2016 1:48 pm

Hi akouz,

Thanks for your information. It basically works.
A minor feedback of this "AT+CIPSTART=4,"UDP","192.168.1.255",1300,1300,2 - command to module: open connection 4, UDP, broadcast address, port 1300, time-out 2 sec", 2 is not time-out for UDP, but it is for TCP. For UPD transmission, it is UDP mode.

One more question, for UDP broadcasting, how should we know where is the message received from? To implement recvfrom function, we need to know the client's IP address and port number. Can you suggest which API in the SDK can be used? Thanks.

lucio.macellari.mac
Posts: 2
Joined: Wed Nov 09, 2016 4:42 pm

Re: Can UDP socket support multicast using AT commands?

Postby lucio.macellari.mac » Wed Nov 09, 2016 5:13 pm

Hi,

I need to receive broadcast UDP datagrams with AT commands but it does not work.
Using the following command

AT+CIPSTART=4,"UDP","0",0,1300,2

the 8266 only receive datagrams directed to its own IP and does not receive broadcasts.

Someone can help?

RogerFL
Posts: 16
Joined: Fri Jul 24, 2015 10:32 pm

Re: Can UDP socket support multicast using AT commands?

Postby RogerFL » Tue Jun 06, 2017 4:00 am

The problem I see is that if you do not know the netmask then you cannot know the broadcast address.
(The examples above only work when the netask is 0xFFFFFF00.)
I do not see any way to get the netmask with the AT commands. Is there a way?

Who is online

Users browsing this forum: No registered users and 4 guests