Simulink GPS serial read from Raspberry pi problems

조회 수: 2 (최근 30일)
Joop Bree
Joop Bree 2020년 6월 23일
답변: Prasanth Sunkara 2020년 7월 2일
Hello,
Im having some problems configuring the Lora GPS hat on my Raspberry pi 3 model b+ using simulink. I have configured the raspberry pi using all the support packages from matlab.
The raspberry pi is configured and the Lora GPS does work on the raspberry pi using openshell.
When using
mypi = raspi('ip','login','password');
myserialdevice = serialdev(mypi,'/dev/ttyS0',9600,8) %ttyS0 is the configuration of the lora gps, 9600 the bautrate and 8 the bitlengt
read(myserialdevice,1000,'char') %to get the GPS information in the NMEA format or using
read(myserialdevice,1000,'uint8') %to get the data in raw numbers
The gps does spit out data in the matlab command window.
The only problem is when i try to use the serial read block within simulink, when i configure the serial read in the same way as the myserialdevice. I use this program and run it on the raspberry pi
When i monitor and run this script on the raspberry pi the displays just show zero's, even when i simplify the script with only 2 displays connected to the serial read then the displays still show only zero's.
Hopefully somebody can tell me what wrong or has incountered the same problem some time ago and found a solution.
Thanks in advance!

답변 (1개)

Prasanth Sunkara
Prasanth Sunkara 2020년 7월 2일
Hello Joop,
I believe you are using "Monitor & Tune" to see the signal values while the model is running.
For monitor & tune, please ensure the required signal are logged.
Basically, right click the Serial read output signal and select "Log signal data" and run the Monitor & Tune(external mode) again.
Please let me know if this solves the issue.
Thanks,
Prasanth

카테고리

Help CenterFile Exchange에서 Run on Target Hardware에 대해 자세히 알아보기

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by