noam-io / lemma-arduino

Arduino Lemma Library and Tests
Other
5 stars 0 forks source link

200ms latency in ping-pong cycle #3

Closed evanShap closed 10 years ago

evanShap commented 10 years ago

There is a 200ms delay in a simple ping-pong.

These branches: https://github.com/noam-io/evan-arduino/tree/latency_error https://github.com/noam-io/evan-arduino/tree/latency_error_deeper

describes characterization of the 200ms latency issue with the Arduino mega. I think my testing has the issue pretty well narrowed down to something outside the Arduino, and the fact that we don't see this type of latency on similar tests with other platforms gives me a hunch it might have something to do with the throttled player on the server.

evanShap commented 10 years ago

I did a test by setting up the Host to instantiate a non-attenuated player connection for the Arduino, and the behavior still persists.

This swings things more towards being a problem with the EthernetServer.

Things to test - • does Arduino EthernetClient (speaking messages) result in similar delays in messages? • Paired down test sending data to Ethernet server, getting rid of all Noam stuff • Do we see the same performance issue in the non-mega Arduino Ethernet? • change ear.rb per Doug's instruction ...

If this issue persists, we'll have to reimplement Arduino Lemma communications using something else (EthernetClient, UDP, WebSocket) as the 200ms delays really kill the functionality of Arduinos on receive ends.

evanShap commented 10 years ago

Fixed by change to server.

When Arduino requests bytes from wiznet that don't exist, it appears there's a 200ms delay that kicks off in the wiznet to wait for bytes.

The fix ensured length and data always sent as same packet.