Simulink GPS serial read from Raspberry pi problems
2 次查看(过去 30 天)
显示 更早的评论
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!
0 个评论
回答(1 个)
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
0 个评论
另请参阅
类别
在 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!