Read real time data on raspberry PI

조회 수: 9 (최근 30일)
Cosimo Mercuro
Cosimo Mercuro 2021년 2월 10일
답변: Prasanth Sunkara 2021년 2월 18일
Hi.
Is there any way to read realtime, live, data produced on a raspberry PI directly on Matlab ( don't using ThigSpeak)?
I.e. I'd like to read live Raspberry CPU temp in matlab without using ThingSpeak.
Any idea?
Thanks in advance

답변 (3개)

Manash Sahoo
Manash Sahoo 2021년 2월 10일
I'm not experienced with directly reading from raspberry Pi/arduino, but this link might help you out.
https://www.mathworks.com/help/supportpkg/raspberrypiio/ref/raspi.serialdev.read.html
  댓글 수: 1
Cosimo Mercuro
Cosimo Mercuro 2021년 2월 11일
Hi Manash.
Thanks for you reply.
Actually I need to read a data that are produced from a runnig code on Raspberry PI.
Like CPU temp in this example:
I haven't nay serial device attached to my Raspberry Pi

댓글을 달려면 로그인하십시오.


Vinod
Vinod 2021년 2월 11일
Have you looked at the Raspberry Pi Support Package?
  댓글 수: 1
Cosimo Mercuro
Cosimo Mercuro 2021년 2월 12일
Hi Vinod.
Thanks for you reply.
Yes, I've read carefully all docs on Raspberry Pi Support Package but I don't know how create a "link" between Matlab and Raspberry so that , i.e., every value of the CPU's temp printed on Raspberry (and that I can view by means Putty) at the same time will be trasferred to Matlab.
I can do this via ThingSpeak but not directly from Raspberry PI to Matlab on my PC.
Obviously Rasberry and my PC are conntected on the same LAN.
Any idea?

댓글을 달려면 로그인하십시오.


Prasanth Sunkara
Prasanth Sunkara 2021년 2월 18일
Hi Cosimo,
One approach is to use the "timer" feature in MATLAB and in the timer callback, you can call the function which reads the cpu temperature( probably using "system" command of Raspbery Pi Support package).
Please see the below timer example for reference:
Alternatively, you may find the "Raspberry Pi Resource Monitor App" handy for similar usecases.
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