Tell me what you want, What you really, really want.

Moderator: Mmiscool

User avatar
By Electroguard
#43952 The way I understand things (but may be wrong), unicast is a one to one connection, multicast is a 'shout' from one to a group-of-many, and broadcast is a 'yell' to everyone (on that same subnet). Unicast has the complication of making specific connections between sources and destinations, and Multicast has the complication of defining groups of addresses.

But as far as I know, UDP broadcast is just a matter of sending to a 'global' node address of 255, which allows all listening subnet nodes to receive that message if they have the appropriate UDP listening port open.

So I think it is basically just a matter of all Basic listening nodes being able to have the same UDP listening port nnnn open, and any Basic node that needs to transmit simply sends its outgoing UDP message to port nnnn at the global broadcast address of 255. (ie: 192.168.1.255) which all other listening nodes should receive.

If so, it means that all DHCP nodes could have an identical 'listening' network configuration (port=nnnn), and any nodes needing to transmit also have a common 'sending' configuration (nnn.nnn.nnn.255).

Therefore all DHCP nodes would be capable of communicating with each other using identical UDP network settings which don't need any unique per-node IP tailoring.
So if I've understood things correctly ? that could offer a very simple and non-technical way for users to be able to link interactive ESP Basic nodes together.
User avatar
By cicciocb
#44042 Little update :
I made some tests and it seems easier than expected.
The UDP seems works well, I haven't been faced to any problem so far.
There are new commands coming :
udpbegin portnum : opens an UDP server unicast
udpbeginmulticast multicast_p, portnum : opens an UDP multicast server with the multicast;the multicast address is something like 224.0.0.67
udpwrite ip_address, portnum, message : write an udp message (unicast)
udpwritemulticast, ip_address_multi, port, message : write an udp message multicast
udpreply message : reply to the sender with a message
udpstop : stop the udp server
udpbranch label : act like an interrupt; as soon as an UDP message is received, jumps to 'label" and continue until reaching the 'return' command; after that it continues from the interrupted line
let a = udpread() : read the message received

These commands will be included in one of the next releases; MMISCOOL is working hard to clean the code and improve the documentation so this will not occur immediately.

If someone want make some beta testing, let me know and I'll send a preliminary version.

CiccioCB