When I send a command to Onkyo, the response time is several seconds. Until today, I thought that the receiver is just slow, but I just made an observation that might tell a different story:
Playing around with an ESP8266, I implemented a client that talks to a Linux host. The line where it reads back from the host is: String reply = client.readStringUntil('\r'); The same function is used to implement a server on embedded systems (such as the Onkyo I assume).
The observation is that the line always blocks one second. The Linux Host sends the reply immediately, but my ESP8266 woud wait an entire second before the above line terminates. Turns out that the Linux Host never sends \r (\r\n is a Windows thing) but a \n instead and the default timeout for readStringUntil is 1000ms. Changing the \r to \n caused the device to reply immediately because it didn't wait for the timeout any more.
Could it be that the slow Onkyo isn't that slow in reality? On the app, the reaction is immediate. Could it be that onkyo-eiscp sends just \n if it is run on Linux hosts but the Onkyo expects \r ?
When I send a command to Onkyo, the response time is several seconds. Until today, I thought that the receiver is just slow, but I just made an observation that might tell a different story:
Playing around with an ESP8266, I implemented a client that talks to a Linux host. The line where it reads back from the host is:
String reply = client.readStringUntil('\r');
The same function is used to implement a server on embedded systems (such as the Onkyo I assume).The observation is that the line always blocks one second. The Linux Host sends the reply immediately, but my ESP8266 woud wait an entire second before the above line terminates. Turns out that the Linux Host never sends
\r
(\r\n
is a Windows thing) but a\n
instead and the default timeout forreadStringUntil
is 1000ms. Changing the\r
to\n
caused the device to reply immediately because it didn't wait for the timeout any more.Could it be that the slow Onkyo isn't that slow in reality? On the app, the reaction is immediate. Could it be that onkyo-eiscp sends just
\n
if it is run on Linux hosts but the Onkyo expects\r
?