What is the best way for a raspberry pi to intermittently report on its activity?

조회 수: 1 (최근 30일)
I am new to both raspberry pi and Simulink and also networking generally. I am interested in deploying Matlab functionality to the pi and have set up the Simulink support package to facilitate this. One of the things I am interested in doing is having the pi running independently on a network and intermittently reporting on its activity. I am not sure of the most sensible protocol to employ for achieving this. I don’t particularly want to have a computer always listening for pi activity on the network, however, if this is necessary then I can do this. One option I thought would be to utilise the Simulink block ‘to file’ to write various data to a file on the pi. I can then retrieve this file via the getFile java method of the raspberrypi object that I can instantiate when I want to check on the pi activity. However, one problem with this approach is that I need to stop the simulink model running to move the file. When I restart the simulink model the existing file is overwritten. In practice I don’t really want to have to stop and start models running I simply want them to make available any data they have accumulated. If the pi could simply send this file to another computer on the network this would be ideal. However, I did notice various blocks in the support package, such as UDP send and TCP/IP that could potentially be more appropriate ways of achieving this type of communication. Any advice on whether these might offer a more appropriate implementation would be welcome.
  댓글 수: 2
Joel Handy
Joel Handy 2019년 6월 12일
UDP would probably make more sense in this case because you wouldnt need to maintain an open connection to another computer on the pi. You would however need to have a computer listening for said message.
You may be able to set something up using UDP where the pi responds when promptesd by another machine so that the pi is the machine listening on the network. Depending on just how much data you are looking to transfer, you could put together some sort of activity buffer that gets transmitted back to whomever sends the pi a simple message.
John Anderson
John Anderson 2019년 6월 12일
Hi Joel, Thanks for this feedback and the buffer idea. I will have a try with UDP and see how I get on and report back.

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

답변 (0개)

카테고리

Help CenterFile Exchange에서 Raspberry Pi Hardware에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by