LoRa WIR-1286/1186/1143 Communication with CASP

This example project demonstrates how to communicate between host PC and Arduino board via two LoRa WIR-1286 modules.

Hardware Required

Arduino MKR-1000 board is used in this project. However, any supported boards running on 3.3V voltage can be used.

Two WIR-1286 LoRa modules

Description

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.

Circuit Diagram

Model

Target Model

Now, open 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.

Native Model

Open the ‘wir_native’ project and open the ‘wir_native.wsp’ workspace file, double click on the ‘SimPanel COM’ block and set the ‘Serial Port’ parameter as shown in below 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.

References

Please go through our video tutorials, tutorial projects and CASP main documentation for getting started with CASP.