How to communicate between Arduino and RasPi using Simulink Serial Read/Write blocks?
11 views (last 30 days)
I'm attempting to send data from my Arduino to a connected Raspberry Pi, with both using deployed Real-Time Simulink code. The approach I've been trying is to connect them via the USB port (port 0 for the Arduino, and /dev/ttyACM0 for the Pi in this case). I am able to read the data using the Arduino IDE serial monitor in the RasPi's interface as well as through PySerial. However, the Serial Read block is returning a Data Unavailable (Status 32) error.
What could be causing this? I may be mis-formatting my data for what Simulink is expecting (I have tried doubles sent using 'write' as well as ASCII with 'println'), but my understanding is that I'd just get junk rather that 'Data Unavabilable'. Is there potentially some other way that I could get around this problem? Perhaps by reading the data with PySerial and then somehow sending it to the realtime Simulink program?
Cheers for any help!
Blocks on the Arduino:
Blocks on the RasPi:
Milan Padhiyar on 28 Jan 2021
As per my understanding you are facing issue with the real time communcation between Arduino and Raspberry Pi using Simulink.
Please refer to the below links as this might help you in your workflow.