TCP socket not receiving all the data
Bryan from United States  [1 posts]
3 years
I'm sending a series of points from a Raspberry pi over a TCP socket. I have confirmed with putty that the receiving computer is getting all the data but roborealm isn't grabbing everthing.  I setup Socket Communications to the correct IP and port as TCP/IP.  Console is set to Ascii.  Refresh AFAP.  No initialization sequence. Disabled send sequence.  and recieve sequence is b,[LOADED_VAR]\0

This seems like a buffer issue.  Any thoughts?
Steven Gentner from United States  [1375 posts] 3 years

There is a little discrepancy between what the console shows and what is actually being read. The console is NOT 100% reflective of the data read as its only meant for debugging purposes and can very quickly get overtaxed due to updates (it just cannot keep up with that much screen refreshes). So the AFAP really only pertains to the console and NOT the actual data read. I suspect that the Loaded_var is being set with all the data that may or may not be reflected in the console.

However, data may still be being overwritten depending on how you are processing the results. I.e. are you sending the data in chunks from the PI or is everything in one shot? The reason I ask is that if your pipeline is a bit slow to process the Loaded_Var it may actually get overwritten with the next chunk BEFORE you even have a chance to process that data. Keep in mind that the pipeline is processed sequentially and will NOT guarantee to run on every new chunk of loaded_var that you get. The socket receive is asynchronously with respect to the pipeline to ensure it doesn't get clogged with data while waiting for the pipeline execution to arrive at that module.

We can alter this behavior (and did so with the Serial module which has a similar issue) if that's indeed the case. I.e. the socket receive would stall until it knew that the data has been processed before overwriting the current chunk.

Alternatively, using the distributor modules or the API might be another way to go if you have large amounts of data to transmit.

Let us know either way and we can help further.


This forum thread has been closed due to inactivity (more than 4 months) or number of replies (more than 50 messages). Please start a New Post and enter a new forum thread with the appropriate title.

 New Post   Forum Index