EthernetENC
EthernetENC copied to clipboard
Sending UDP message Error
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.
yes, it should work. how do you know it is not sent?
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.
Is there a way to receive broadcast messages by making any change in the library?
UDP broadcast
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.
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
- I have not made in changes in the library. Still broadcast receipt works up to 18 characters maximum.
- ESP is able to receive maximum of 18 characters in Broadcast mode.
- Receipt of broadcast message seems to be dependent on traffic on the network.
- Broadcast messages sent from ESP seem to be working fine.
- 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.
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.