11:54:30 17 5 2023 [28] 29 .send() took 253 us
Thank you @clinker8
I have no objections to UDP. I am just not sure if the option is available…
// UDP port.
EthernetUDP udp(32); // (##)-packet buffer allocate for incoming messages
setReceiveQueueSize(size): Sets the receive queue size. The minimum possible value is 1 and the default is 1. If a value of zero is used, it will default to 1. If the new size is smaller than the number of items in the queue then all the oldest frames will get dropped.
Raw frame receive buffering
Similar to UDP buffering, if raw frames come in at a faster rate than they are consumed, some may get dropped. To help mitigate this, the receive queue size can be adjusted with the EthernetFrame.setReceiveQueueSize(size) function. The default queue size is 1 and the minimum size is also 1 (if a zero is passed in then 1 will be used instead).
C:\T_Drive\tCode\libraries\QNEthernet\src\QNEthernetFrame.cpp:
75 FLASHMEM EthernetFrameClass::EthernetFrameClass()
76 : inBuf_(1) {
[B][U] 77: setReceiveQueueSize(1);[/U][/B]
78 }
79
..
155 }
156
157: void EthernetFrameClass::setReceiveQueueSize(size_t size) {
158 if (size < 1) {
159 size = 1;
C:\T_Drive\tCode\libraries\QNEthernet\src\QNEthernetFrame.h:
130 // This disables interrupts while changing the queue so as not to interfere
131 // with the receive function if called from an ISR.
132: void setReceiveQueueSize(size_t size);
...Do you think using UDP may help?
...
`EthernetFrame` is for raw Ethernet frames (probably not what you want here), `EthernetUDP` is for IP-based UDP, and `EthernetClient` is for IP-based TCP.