I'm working on a radar project and I want Matlab to send commands and collect radar data remotely from the USB port of a Raspberry Pi 3 B+. My setup is as follows:
I have the radar connected to the Pi 3 through the USB port and I'm using the Raspberry Pi package on MATLAB to communicate with the radar remotely through the USB port. I was able to successfuly communicate with the radar and collect radar data, but the problem is that using the setup I mentioned, I was bounded by a limit for the amount of data I can collect from the radar. For example:
When the radar is connected to the computer directly through USB I had no limit on the number of chirps I can send or on the number of samples in each chirp. For example, if I wanted to have 64 samples/chirp, I can send the max number of chirps possible which is 24 chirps.
However, when the radar is connected to the Pi I had a limit on the frame data, such that if I want to have 64 samples/chirp, I can only send 21 chirps which is down by 3 chirps.
After doing some research and experiments, I came to a conclusion that the problem is mainly located in the wireless communication between the Pi and MATLAB and mostly in the function that opens the virtual port on MATLAB (
serialdev) or in the function (
read) that reads the data from the Pi. The reason I came to that conclusion is because I tried a C code to collect the data on the pi directly to see if the problem is in the USB communication between the radar and the pi, but after running the code on the pi it was able to collect all the data with no limit and no problem.
Also, the problem is not in the wireless transmission between the Pi and the computer because using an SSH connection between the Pi and the computer I run the same C code to collect the data and I was able to collect the data on the computer with no limit on the number of sample or chirps and it works totally fine.
So, can you please help me with this, and can you tell me what is the limit for the amount of data that can be collected using the function
serialdev and the function
If you think my conclusion is wrong tell me what do you think about it.