Simulink GPS serial read from Raspberry pi problems

2 visualizaciones (últimos 30 días)
Joop Bree
Joop Bree el 23 de Jun. de 2020
Respondida: Prasanth Sunkara el 2 de Jul. de 2020
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!

Respuestas (1)

Prasanth Sunkara
Prasanth Sunkara el 2 de Jul. de 2020
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

Categorías

Más información sobre Raspberry Pi Hardware en Help Center y File Exchange.

Community Treasure Hunt

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

Start Hunting!

Translated by