How to communicate between Arduino and RasPi using Simulink Serial Read/Write blocks?
29 次查看(过去 30 天)
显示 更早的评论
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:

1 个评论
回答(1 个)
Milan Padhiyar
2021-1-28
Hello,
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.
Thanks
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Run on Target Hardware 的更多信息
产品
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!