I have problem using ETHERNET3 library.
My code works on ETHERNET & ETHERNET2, but have problems with unexpected send delays, so I'm trying ETHERNET3 whis seems to be more robust, but I have problem with secondary server running on other TCP port. I'm using one server for streaming of meassurement data and secondary for Configuration of device.
Code is running on ARDUINO DUE, and main loop contains many other functions so I extracted only related parts. Streeming connection seems to be fine, but control one is not working.
Can you advice what is wrong (same approach was ok with ETHERNET.h). Thank you for help.
// Ethernet data streaming to PC
if (DataStream) {
if (DataStream.connected()) {
// ETH TCP connection status
if (DataStream.available()) {
// If some bufers are full to be send
DataStream.write(DAQ_buff[DAQ_buff_indx_sent].Bytes,ETH_sent_buff_length);
}
}
}
else { //No active connection
}
// Ethernet configuration channel to PC
if (EthConfig) {
if (EthConfig.connected()) {
if (EthConfig.available()) {
//Read 5 characters of command
EhtCmd_string="";
for(int i=0; i < 5; i++){
EthChar=EthConfig.read();
EhtCmd_string += EthChar;
}
if (EhtCmd_string == "GETCS"){ //Send parameters
EthConfig.write(CS.Bytes,sizeof(CS));
//EthConfig.write(reinterpret_cast<char*>(&CS),sizeof(CS));
InfoMsg("GETCS");
}
if (EhtCmd_string == "GETCA"){ //Send Act calibration parameters
EthConfig.write(Calibration.Bytes,sizeof(Calibration));
}
if (EhtCmd_string == "GETxx"){ //Test
EthConfig.write(DAC0);
}
}
}
}
Hello,
I have problem using ETHERNET3 library. My code works on ETHERNET & ETHERNET2, but have problems with unexpected send delays, so I'm trying ETHERNET3 whis seems to be more robust, but I have problem with secondary server running on other TCP port. I'm using one server for streaming of meassurement data and secondary for Configuration of device. Code is running on ARDUINO DUE, and main loop contains many other functions so I extracted only related parts. Streeming connection seems to be fine, but control one is not working. Can you advice what is wrong (same approach was ok with ETHERNET.h). Thank you for help.
See my code extracted here:
EthernetServer server(80); EthernetServer server1(88);
EthernetClient DataStream; EthernetClient EthConfig;
void setup() { //For Ethernet library V 3.0
Ethernet.setCsPin(10); //Set CS = 10
Ethernet.init(1); //-> 1 Socket with 16k RX/TX buffer
}
void loop() { // Ethernet // Listen for incoming clients EthernetClient DataStream = server.available(); EthernetClient EthConfig = server1.available();
// Ethernet data streaming to PC
if (DataStream) {
if (DataStream.connected()) { // ETH TCP connection status
if (DataStream.available()) { // If some bufers are full to be send
DataStream.write(DAQ_buff[DAQ_buff_indx_sent].Bytes,ETH_sent_buff_length); } } } else { //No active connection
}