Acquire data from a python device in continuous (synchronuous) mode on a PC with Matlab installed.

2 views (last 30 days)
Hi.
I've a raspberry device on wich I've installed Python.
My raspberry reads in realtime data from an MLX 90640 IR Thermal Camera and write it on a txt file.
If I copy this txt file on a PC with Matlab installed, I can read thermal data and process it in Matlab to produce, i.e., an heatmap.
This process, however, is an asynchronous process since I must :
  1. acquire thermal data on raspberry
  2. stop the acquisition
  3. copy the data on the PC with Matlab installed
  4. run the matlab application to view the heatmap
Obviuosly I'd like to trasforf this process from asynchronous to synchronous so that I can view real time data acquired from raspberry-Python device on Matlab in the same time that they are acquired and in contunuous mode.
The question is: is there any way to do this? And if yes, how?
Any idea?
Thanks in advance

Answers (1)

surya venu
surya venu on 19 Apr 2024 at 10:15
Hi,
Yes, there is a way to make this process synchronous and view real-time data acquired from the Raspberry-Python device on MATLAB in continuous mode. You can use MATLAB's built-in support for Python and TCP/IP communication to establish a real-time connection between your Raspberry Pi and MATLAB.Here's a high-level overview of the steps you can follow:
  1. Python Server on Raspberry Pi: Write a Python script on the Raspberry Pi that acts as a server. This script will read real-time data from the MLX 90640 IR Thermal Camera and send it to MATLAB using TCP/IP communication.
  2. MATLAB Client: Write a MATLAB script that acts as a client. This script will connect to the Python server on the Raspberry Pi using TCP/IP communication, receive the real-time data, and process it to create the heatmap.
Hope it helps.

Categories

Find more on MATLAB Support Package for Raspberry Pi Hardware in Help Center and File Exchange

Products


Release

R2020b

Community Treasure Hunt

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

Start Hunting!