EthernetENC icon indicating copy to clipboard operation
EthernetENC copied to clipboard

Sending UDP message Error

Open rajeshdoshi opened this issue 3 years ago • 7 comments

Is it possible to broadcast a message on UDP ? I tried with 255.255.255.255 as IP address in UDP.beginPacket. It does return 1, however, message is not sent on the network.

I can not IP address with only last digits as 255 because when device is connected on a network, the IP address of the PC is not known.

rajeshdoshi avatar Jun 04 '22 10:06 rajeshdoshi

yes, it should work. how do you know it is not sent?

JAndrassy avatar Jun 04 '22 10:06 JAndrassy

I am not receiving any data on PacketSender. But if I change destination IP address from 255.255.255.255 to that of my PC, then it works.

rajeshdoshi avatar Jun 04 '22 11:06 rajeshdoshi

Is there a way to receive broadcast messages by making any change in the library?

rajeshdoshi avatar Jun 04 '22 12:06 rajeshdoshi

UDP broadcast

rajeshdoshi avatar Jun 04 '22 12:06 rajeshdoshi

now I am confused. send and receive broadcast? receiving broadcast is turned off on ENC level by default with this library. I guess you changed the setting to receive broadcast and in your other issued you write it is limited to 18 bytes.

JAndrassy avatar Jun 04 '22 13:06 JAndrassy

The observations have confused me as well. It seems UDP communication depends a lot on the traffic on the network. Today on a Sunday, when there are no other PCs connected on network, everything is working fine. As such observations are

  1. I have not made in changes in the library. Still broadcast receipt works up to 18 characters maximum.
  2. ESP is able to receive maximum of 18 characters in Broadcast mode.
  3. Receipt of broadcast message seems to be dependent on traffic on the network.
  4. Broadcast messages sent from ESP seem to be working fine.
  5. When sending message from PC through packetSender directly to the IP address of ESP, if IP addresses of ESP and PC are not in same domain, ESP does not receive message. Even if I change the subnet to 0,0,0,0; ESP is not receiving the data.

rajeshdoshi avatar Jun 05 '22 07:06 rajeshdoshi

Just trying to enable udp broadcast receiving but with no luck. Anyone have any idea how to configure enc to receive udp broadcast packets? My change (not working)@Enc28J60Network.cpp: writeReg(ERXFCON, ERXFCON_UCEN|ERXFCON_CRCEN|ERXFCON_PMEN|ERXFCON_BCEN); writeRegPair(EPMM0, 0x303f); writeReg(EPMM2, 0x80); writeRegPair(EPMCSL, 0xe6ff);

UPDATE: Broadcast receiving work but dest ip address must be 255.255.255.255! In the above code ERXFCON_BCEN is not necessary. Pattern match filter do the trick.

martinez20m avatar Jan 26 '23 15:01 martinez20m