CASP supports exchanging data between micro-controller or SBC and host computer or between any to computers with very low latency Ethernet or WiFi communication. Data received from the other micro-controller/SBC/computer can then be used in CASP models on host computer or can be visualized with the help of CASP GUI widgets such as plotters, dials, 2D/3D graphs.

This example project demonstrates how to establish WiFi communication between a Linux based SBC with on-board WiFi and the host (native) computer using CASP. We try to acquire analog periodic signal from the target board to the host PC through Ethernet and plot the signal on the host computer. UDP protocol is used for communicating between the target board and the host PC.

Pre-Requisites

  • Raspberry Pi-4 or 5 SBC.
  • CASP software is installed along with CASP Python Libraries (optional).
  • Raspberry Pi BSP is installed.
  • The project files are located at CASP installed directory ‘CASP/support/examples/communication/6_linux_ip’. These are also available for download at this link.

Connection Diagram

Procedure to properly program Raspberry Pi-4

  • Setup the target board as shown in our video tutorial ‘Single Board Computers’. Link: https://youtu.be/IlJL3tXhdeA
  • Run CASP and load the ‘target_model’ project.
  • Open Home->Simulation->Setup Simulation Parameters menu item. Under TargetHW->Remote Build & RTV tab set ‘Remote Target IP Address’ parameter to the IP address of the target and set ‘Target ID’ under TargetHW->General tab as explained in our video tutorial.
  • Click Run button to build and run on the target board. Screen shot of the target after successful execution is shown below

Procedure to run the native model on the host PC

Load the ‘native_model’ project and open the ‘native.wsp’ workspace file. Double click on the ‘SimPanel IP’ block and set Remote IP address shown in below figure.

  • Run the model by clicking on the Run button. A simulation panel window should start and communicate with the board.
  • Screen shot of the target and native simulation panel windows is shown in below figure.