How to communicate between Arduino and RasPi using Simulink Serial Read/Write blocks?
조회 수: 18 (최근 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!