Tuesday, December 11, 2018

XMRemoteRobot - SignalR - nice messaging but watch out for the size limit

Early successes with SignalR for Internet communications got us thinking, "let's use SignalR for everything!". Sending images from the robot camera being first on our TODO list. As in see through the robot's eyes. We attempted sending images as "base64" strings. We can share with you that SignalR does not handle big strings in one message. When we tried this we had no error messages and apparently almost-working results like the first image received as a small black image. That looked promising enough to keep trying until we thought of  testing with smaller message sizes and our broken communications started working.

Time for a Google search. "signalr maximum text length" which found
"There's no maximum message size but we recommend < 32K per message" on the Github home site. ref: https://github.com/SignalR/SignalR/issues/1205

That got us trialling different sizes of messages on XMRemoteRobot with the finding that our maximum reliable message string length is 32700 characters.

We process the still images from our robots into 'base64' encoded strings of about 640K in length so that is not going to work as a single chunk. Next steps in this development:



A possible alternative. "Ricardo" writes about achieving video streaming without audio over SignalR:
https://weblogs.asp.net/ricardoperes/video-streaming-with-asp-net-signalr-and-html5