CASP supports exchanging data between micro-controllers using LoRa communication. This example project demonstrates data communication between host PC and Arduino board via two LoRa WIR-1286 modules.

Pre-Requisites

  • Arduino MKR-1000 or any three micro-controller boards supported by CASP with serial interface.
  • WIR-1286 modules – 2 No.
  • CASP software is installed along with CASP Python Libraries (optional).
  • Arduino BSP is installed.
  • The project files are located at CASP installed directory ‘CASP/support/examples/communication/11_lora_wir’. These are also available for download at this link.

Connection Diagram

Connect two WIR-1286 modules, one to the Arduino MKR-1000 and the other to the host PC through FTDI serial converter module as shown in the circuit diagram. First configure the LoRa module connected to the host PC manually. Typical configuration parameters include configuring Network ID, Hardware ID and the Destination ID. For this, user may have to connect the PROG pin of the module to GND. Refer manufacture catalogue for details on how to configure the module.

CASP Model for Target Board

  • Connect the target to the host PC via a USB cable.
  • Note the serial port number to which the board is connected to the host PC, from the host operating system.
  • Run CASP and load the target project ‘wir_target’.
  • Open the model and set the LoRa block parameters that are compatible with the module parameters that is connected to the host PC.
  • Run the model and program the board

CASP Model for Host Computer

  • Run another instance of CASP and load the ‘wir_native’ project. Open the workspace file ‘wir_native.wsp’.
  • Double click on the ‘SimPanel COM’ block and set the ‘Serial Port’ parameter as shown in above figure. Build and run the model to start simulation panel. After the simulation panel started, both modules should connect and the data from Arduino MKR-1000 should be visible in UDI0 of EP0.

Debugging

Serial debugging can be enabled by selecting ‘Local & Remote‘ option from Setup Simulation->Build->Code Debug and re-building the project. The output can be viewed in ‘Serial Monitor’ window from CASP main window.