Can UDP socket support multicast using AT commands?
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.
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.
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
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.
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.
-
- 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?
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?
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?
(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 170 guests
Login
Newbies Start Here
Are you new to ESP8266?
Unsure what to do?
Dunno where to start?
Start right here!
Latest SDK
Documentation
Complete listing of the official ESP8266 related documentation release by ESPRESSIF!
Must read here!
- All times are UTC+08:00
- Top
- Delete all board cookies
About Us
Espressif Systems is a fabless semiconductor company providing cutting-edge low power WiFi SoCs and wireless solutions for wireless communications and Internet of Things applications. We are the manufacturer of ESP8266EX.