Serial communication with Arduino

I just don’t get it. I know exactly when the data is coming from the arduino device, exactly how many bytes, how it is formatted. In one case I programmed it to send the data in chunks of 256 bytes. The xojo device is always listening. I check the payload and if it is all there I parse the data for the way it is formatted. If it fails, depending on how critical it is I may request another packet, or just wait until the next packet is sent. No mysteries. I prefer the tcp socket method too because I can send just about infinite sized chunks of data. Similar to the way that files were transferred many moons ago with the various protocols.

Then you’re doing it right. That’s what we’ve been advising. As long as you don’t blithely assume that every DataAvailable is a complete packet, you’re fine.

Well then I am clearly not understanding what Matt is asking. It seemed to me that he was basically reading a sensor then sending that reading out to the serial port instead of collecting all of the data and sending it in a structured format. Anyhow I hope it gets worked out for him.